How to use the arsenic.browsers.Firefox 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 / test_real_browsers.py View on Github external
async def test_chained_actions(session):
    if isinstance(session.browser, Firefox) and isinstance(
        session.driver.connection, RemoteConnection
    ):
        raise pytest.skip("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()

    await session.get("/actions/")

    output = await session.wait_for_element(5, "#output")
github HDE / arsenic / tests / infra / services.py View on Github external
import os
from urllib.parse import urlparse, parse_qsl, urlunparse

import attr
import shutil

import sys

from arsenic.browsers import Firefox
from arsenic.services import Geckodriver, Remote


BROWSERS = {
    'firefox': Firefox,
}


@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),
github HDE / arsenic / examples / tornado_example.py View on Github external
async def get_example_h1_functional(service, engine):
    driver = await service.start(engine)
    try:
        session = await driver.new_session(Firefox())
        try:
            await session.get('http://example.com/')
            element = await session.get_element('h1')
            print(await element.get_text())
        finally:
            await session.close()
    finally:
        await driver.close()
github HDE / arsenic / examples / tornado_example.py View on Github external
async def get_example_h1_context_manager(service, engine):
    async with service.run(engine) as driver:
        async with driver.session(Firefox()) as session:
            await session.get('http://example.com/')
            element = await session.get_element('h1')
            print(await element.get_text())
github HDE / arsenic / examples / aiohttp_example.py View on Github external
async def get_example_h1_functional(service, engine):
    driver = await service.start(engine)
    try:
        session = await driver.new_session(Firefox())
        try:
            await session.get('http://example.com/')
            element = await session.get_element('h1')
            print(await element.get_text())
        finally:
            await session.close()
    finally:
        await driver.close()
github HDE / arsenic / examples / aiohttp_example.py View on Github external
async def get_example_h1_context_manager(service, engine):
    async with service.run(engine) as driver:
        async with driver.session(Firefox()) as session:
            await session.get('http://example.com/')
            element = await session.get_element('h1')
            print(await element.get_text())