Skip to main content

A library to make parallel selenium tests that automatically download and setup webdrivers

Project description

AutoParaSelenium

A library to make parallel selenium tests that automatically download and setup webdrivers

Usage

Installation

pip install autoparaselenium

Code

The API is very simple

from typing import Union

from selenium import webdriver

from autoparaselenium import configure, chrome, firefox, run_on, all_, Extension

# All parameters are optional, but still call it once before everything
configure(
    extensions=[
        Extension(chrome="path to chrome extension to install"),
        Extension(firefox="path to firefox extension to install"),
        Extension(chrome="chrome path", firefox="firefox path")
    ],
    headless=True, # if there are chrome extensions, chrome will not be headless as a selenium limitation
    selenium_dir="./drivers"
)

@run_on(all_)
def test_both_firefox_and_chrome(web: Union[webdriver.Firefox, webdriver.Chrome]):
    ...

@run_on(firefox)
def test_firefox_only(web: webdriver.Firefox):
    ...

@run_on(chrome)
def test_chrome_only(web: webdriver.Chrome):
    ...

Running

Use pytest --tests-per-worker PROC where PROC is the number of parallel threads

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autoparaselenium-0.3.1.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

autoparaselenium-0.3.1-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page