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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file autoparaselenium-0.3.1.tar.gz.

File metadata

  • Download URL: autoparaselenium-0.3.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for autoparaselenium-0.3.1.tar.gz
Algorithm Hash digest
SHA256 85cf4f5b63906c73e8dd6736f545832300819cdd9ddde43f7bd7282cc80a0f12
MD5 ff976606cee3649d7682735b80982460
BLAKE2b-256 fb797c6d2b7686c190717b69b765c66892e056056fd0fb6e9be410d97957d5e5

See more details on using hashes here.

File details

Details for the file autoparaselenium-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for autoparaselenium-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d48d9c9b0fbc3c2c5039c14737bae7daa7563eb4dfc2315a680ca2112b6cfab
MD5 4d359f180f09cddec9e88b2dae600f78
BLAKE2b-256 ce9780ccbb2f3710aeee6173f11addba7fe77f7a9305af9a0d45eab1117c34e6

See more details on using hashes here.

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