How to use the arsenic.services.Geckodriver 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
}


@attr.s
class ServiceContext:
    driver = attr.ib()
    browser = attr.ib()
    name = attr.ib()


SERVICE_CONTEXTS = []


if shutil.which('geckodriver'):
    SERVICE_CONTEXTS.append(ServiceContext(
        driver=Geckodriver(log_file=sys.stdout),
        browser=Firefox(),
        name='geckofirefox'
    ))


def get_remote_drivers(remotes):
    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,
github HDE / arsenic / tests / test_services.py View on Github external
async def test_geckodriver_version_ok(tmpdir, version, check, result):
    path = tmpdir.join("geckodriver")
    path.write(f'#!{sys.executable}\nprint("geckodriver {version}")')
    path.chmod(0o755)
    driver = Geckodriver(binary=str(path), version_check=check)
    if result:
        await driver._check_version()
    else:
        with pytest.raises(ValueError):
            await driver._check_version()
github HDE / arsenic / examples / tornado_example.py View on Github external
async def gecko(func):
    await func(
        Geckodriver(),
        Tornado
    )
github HDE / arsenic / examples / aiohttp_example.py View on Github external
async def gecko(func):
    await func(
        Geckodriver(),
        Aiohttp
    )