How to use the arsenic.services.Remote function in arsenic

To help you get started, we’ve selected a few arsenic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HDE / arsenic / tests / infra / services.py View on Github external
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}'
            )
github HDE / arsenic / tests / test_real_browsers.py View on Github external
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
github HDE / arsenic / examples / tornado_example.py View on Github external
async def remote(func):
    await func(
        Remote(
            'http://hub.browserstack.com/wd/hub',
            BasicAuth(
                os.environ['USERNAME'],
                os.environ['PASSWORD'],
            )
        ),
        Tornado
    )
github HDE / arsenic / examples / aiohttp_example.py View on Github external
async def remote(func):
    await func(
        Remote(
            'http://hub.browserstack.com/wd/hub',
            BasicAuth(
                os.environ['USERNAME'],
                os.environ['PASSWORD'],
            )
        ),
        Aiohttp
    )