Skip to main content

Selenium wrapper for CloudBeat Pytest Kit

Project description

CloudBeat Python Integrations

CloudBeat logo

Release Status Downloads

Learn more about CloudBeat at https://cloudbeat.io/

~ 🧾 Documentation – official documentation for CloudBeat
~ 🙋🏻 Contact and Support – contact us and we'd love to help
~ 📣 Blog – stay updated with our latest news
~ 💻 Demo – request a demo


Quick start

Make sure your requirements.txt includes:

cloudbeat-pytest
cloudbeat-selenium

Standard Installation

cd pytest-selenium
python -m venv env
env\Scripts\activate
pip install -r requirements.txt

Installation using UV

uv venv
uv pip install -r requirements.txt

Set up CloudBeat reporter in confitest.py

import uuid

import pytest
from selenium import webdriver
from cloudbeat_common.models import CbConfig
from cloudbeat_common.reporter import CbTestReporter
from cloudbeat_selenium.wrapper import CbSeleniumWrapper


@pytest.fixture(scope="module")
def cb_config():
    """Prepare configuration class for further CB reporter initialization."""
    config = CbConfig()
    config.run_id = str(uuid.uuid4())
    config.instance_id = str(uuid.uuid4())
    config.project_id = str(uuid.uuid4())
    config.capabilities = {"browserName": "chrome"}
    return config


@pytest.fixture(scope="module")
def cb_reporter(cb_config):
    reporter = CbTestReporter(cb_config)
    return reporter


@pytest.fixture()
def setup(cb_reporter):
    driver = webdriver.Chrome()
    wrapper = CbSeleniumWrapper(cb_reporter)
    wrapped_driver = wrapper.wrap(driver)
    yield wrapped_driver
    driver.quit()

Set python src path if necessary

set PYTHONPATH=src

Run your tests

Standard

cd pytest-selenium
env\Scripts\activate

All tests

pytest 

Parallel tests

pytest -n 4

Single test

pytest -v -s Tests/test_login.py 

Using UV

uv run pytest # run all tests
uv run pytest -n 4 # run parallel tests
uv run pytest -v -s Tests/test_login.py # run a single test

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

cloudbeat_selenium-1.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloudbeat_selenium-1.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file cloudbeat_selenium-1.0.1.tar.gz.

File metadata

  • Download URL: cloudbeat_selenium-1.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for cloudbeat_selenium-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7341e9a7a50f936fd3bbe52f278d8edeea0f56fe04931bdf138d480bd6cb482b
MD5 a48f0d8c0b1798caeb431aa96b4253ad
BLAKE2b-256 7eef0f39ef25c095168a76768e0cefbbe1fe87f23c3a4828f655ee4bfcd92465

See more details on using hashes here.

File details

Details for the file cloudbeat_selenium-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cloudbeat_selenium-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce6141ed9dbabaea4beb2b459f0be499fadaacbc75a35697dcdaa83708faa14f
MD5 1de46fda8c814c5d84856053cf34ce44
BLAKE2b-256 cc43a5d9127fbb7b4414a1c31fdf475ca7513a8b5c62cee35ffd7b232ec4c636

See more details on using hashes here.

Supported by

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