Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for remote in remotes.split(' '):
parsed = urlparse(remote)
query = dict(parse_qsl(parsed.query))
browser_name = query.pop('browser', None)
browser = BROWSERS.get(browser_name, None)
if browser is not None:
unparsed = urlunparse((
parsed.scheme,
parsed.netloc,
parsed.path,
'',
'',
''
))
yield ServiceContext(
driver=Remote(unparsed),
browser=browser(**query),
name=f'remote{browser_name}'
)
async def test_chained_actions(session):
if isinstance(session.browser, Firefox) and isinstance(session.service, Remote):
pytest.xfail('remote firefox actions do not work')
async def check(actions, expected):
await session.perform_actions(actions)
output = await session.get_element('#output')
assert expected == await output.get_text()
await session.get('/actions/')
output = await session.wait_for_element(5, '#output')
assert '' == await output.get_text()
mouse = Mouse()
keyboard = Keyboard()
canvas = await session.get_element('#canvas')
ctx = (
pytest.raises(OperationNotSupported)
if
async def remote(func):
await func(
Remote(
'http://hub.browserstack.com/wd/hub',
BasicAuth(
os.environ['USERNAME'],
os.environ['PASSWORD'],
)
),
Tornado
)
async def remote(func):
await func(
Remote(
'http://hub.browserstack.com/wd/hub',
BasicAuth(
os.environ['USERNAME'],
os.environ['PASSWORD'],
)
),
Aiohttp
)