Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def browser(web_app, request):
browser = get_instance(os.environ['ARSENIC_BROWSER'], browsers)
if os.environ.get('BROWSERSTACK_LOCAL_IDENTIFIER', None):
if not os.environ.get('BROWSERSTACK_API_KEY', False):
raise pytest.skip('BROWSERSTACK_API_KEY not set')
browser.capabilities['name'] = request.node.name
return browser
async def hello_world():
service = services.Geckodriver(binary=GECKODRIVER)
browser = browsers.Firefox()
async with get_session(service, browser) as session:
await session.get("https://images.google.com/")
search_box = await session.wait_for_element(5, "input[name=q]")
await search_box.send_keys("Cats")
await search_box.send_keys(keys.ENTER)
await asyncio.sleep(10)
async def wrapper():
gecko = services.Geckodriver()
ff = browsers.Firefox()
async with RunApp() as base_url, get_session(gecko, ff, base_url) as session:
return await coro(session)