async def test_open_jira_page(self): from osbot_aws.apis.Secrets import Secrets self.api = API_Browser(headless=False) login_needed = False self.secrets_id = 'GS_BOT_GS_JIRA' (server, username, password) = Secrets( self.secrets_id).value_from_json_string().values() if login_needed: Dev.pprint(server, username, password) await self.api.open(server + '/login.jsp') page = await self.api.page() await page.type('#login-form-username', username) await page.type('#login-form-password', password) await page.click('#login-form-submit') #await self.api.open(server + '/browse/GSP-95') #page = await self.api.page() #await self.api.js_execute("$('#show-more-links-link').click()") #from time import sleep #sleep(1) await self.api.page_size(2000, 3000) await self.api.screenshot( file_screenshot='/tmp/tmp-jira-screenshot.png', full_page=True)
def __init__(self, headless=True): self.web_page = '/vivagraph/simple.html' self.web_root = Files.path_combine(Files.parent_folder(__file__), '../web_root') self.api_browser = API_Browser(headless=headless).sync__setup_browser() self.web_server = Web_Server(self.web_root) self.render_page = Render_Page(api_browser=self.api_browser, web_server=self.web_server)
def setup(self): login_details = json.loads(Secrets(self.aws_secrets_id).value()) self.username = login_details.get('username') self.password = login_details.get('password') self.server_url = login_details.get('server_url') if self._browser is None: self._browser = API_Browser(headless=self.headless).sync__setup_browser() return self._browser
def __init__(self, web_page, headless=True): self.web_page = web_page self.title = 'browser view' self.web_root = Files.path_combine(Files.parent_folder(__file__), '../web_root') self.api_browser = API_Browser(headless=headless).sync__setup_browser() self.web_server = Web_Server(self.web_root) self.render_page = Render_Page(api_browser=self.api_browser, web_server=self.web_server)
def __init__(self, headless=True): self.web_page = '/vivagraph/simple.html' self.jira_icons = '/vivagraph/icons' self.web_root = path_combine(Files.parent_folder(__file__), '../web_root') self.api_browser = API_Browser(headless=headless).sync__setup_browser() self.browser_width = None self.render_wait = None self.web_server = None # Web_Server(self.web_root)
def setup(self): self.load_browser_dependencies() from osbot_browser.browser.API_Browser import API_Browser from osbot_browser.browser.Render_Page import Render_Page self.api_browser = API_Browser( headless=self.headless).sync__setup_browser() self.render_page = Render_Page(api_browser=self.api_browser, web_root=self.web_root()) return self
def __init__(self, target_server, headless=True, api_browser=None, path_screenshot=None, user_agent=None): self.api_browser = api_browser or API_Browser(headless=headless) self.user_agent = user_agent or 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36' self.path_screenshot = path_screenshot self.target_server = target_server
def __init__(self): self.web_page = '/datatables/simple.html' self.web_root = Files.path_combine(Files.parent_folder(__file__), '../web_root') self.api_browser = API_Browser().sync__setup_browser() self.render_page = Render_Page(api_browser=self.api_browser, web_root=self.web_root) self.table_width = '100%' self.columns_defs = None self.table_title = None
def __init__(self, headless=True): self.web_page = '/gs/risk/risks-dashboard.html' self.web_root = Files.path_combine(Files.parent_folder(__file__), '../web_root') self.headless = headless self.api_browser = API_Browser(self.headless, self.headless).sync__setup_browser() self.render_page = Render_Page(api_browser=self.api_browser, web_root=self.web_root) self.graph_name = None self.jira_key = None
def __init__(self, headless=True): self.web_page = '/vis-js/simple.html' self.web_root = Files.path_combine(Files.parent_folder(__file__), '../web_root') chrome = Chrome().headless(headless) self.api_browser = API_Browser(chrome.sync().browser()) self.render_page = Render_Page(api_browser=self.api_browser, web_root=self.web_root) self.bot_name = 'GS_Bot' self.options = None
def __init__(self, api_browser=None, headless=True, web_root=None, web_server=None): if web_server: self.web_server = web_server else: self.web_server = Web_Server(web_root) if api_browser: self.api_browser = api_browser else: self.api_browser = API_Browser(headless=headless)
def run(event, context=None): load_dependencies('syncer,requests,pyppeteer2,websocket-client') from osbot_browser.browser.API_Browser import API_Browser url = event.get('url') #return url # error in this line: Read-only file system: '/home/sbx_user1051 api_browser = API_Browser().sync__setup_browser() # we don't get here if url: api_browser.sync__open(url) return api_browser.sync__screenshot_base64()
def setup(self): if os.getenv('AWS_REGION'): load_dependency('syncer') load_dependency('requests') #self.setup_AWS() # else: # self.setup_local() from osbot_browser.browser.API_Browser import API_Browser from osbot_browser.browser.Render_Page import Render_Page self.api_browser = API_Browser(headless=self.headless).sync__setup_browser() self.render_page = Render_Page(api_browser=self.api_browser, web_root=self.web_root()) return self
def __enter__(self): self.api_browser = API_Browser(headless=self.headless) self.browser = self.api_browser.sync__browser() if self.open_page: self.api_browser.sync__open(self.open_page) return self
def __init__(self): self.browser = API_Browser()
def setUp(self): self.api = API_Browser(headless=False)
def setUp(self): self.api = API_Browser(headless=True)
def api_browser( self ): # todo: figure out if this is the best way to expose this object from osbot_browser.browser.API_Browser import API_Browser return API_Browser(self.browser())
def setUp(self): self.api = API_Browser(headless=False) self.png_file = '/tmp/tmp-jira-screenshot.png'