Patternfly5 widget library for Widgetastic.
Project description
widgetastic.patternfly5
Overview
This library offers Widgetastic Widgets for PatternFly v5/v6, serving as an extended iteration of widgetastic.patternfly4.
Built on top of widgetastic.core with Playwright as the browser automation engine, this library provides a robust and modern approach to UI testing for PatternFly components.
Note: The
mainbranch now uses Playwright for browser automation. For the legacy Selenium implementation, please refer to the legacy-selenium-support branch.
Installation
# Install from PyPI
pip install widgetastic.patternfly5
# Or install from source
git clone https://github.com/RedHatQE/widgetastic.patternfly5.git
cd widgetastic.patternfly5
pip install -e .
Supported Components
Components
- alert
- breadcrumb
- button
- card
- chip
- clipboard-copy
- date and time
- description-list
- drawer
- dual-list-selector
- expandable-section
- forms
- menus
- modal
- navigation
- pagination
- popover
- progress
- slider
- switch
- table
- tabs
- title
Charts:
Patterns
Development
Contribution guide
# clone the repo
git clone https://github.com/RedHatQE/widgetastic.patternfly5.git
cd widgetastic.patternfly5
# create a virtual environment
python3 -m venv .venv_pfy5
source .venv_pfy5/bin/activate
# update pip and its friends
pip install -U pip setuptools wheel
# install the package in editable mode
pip install -e .[dev]
# if you use zsh, pip install will fail. Use this instead:
pip install -e ".[dev]"
# install Playwright browsers for testing
playwright install chromium firefox
playwright install-deps
# setup pre-commit hooks
pre-commit install
Testing
The library includes comprehensive tests that run against the official PatternFly documentation pages:
- PatternFly v6 (latest)
- PatternFly v5 (archived)
Tests are powered by Playwright, providing fast, reliable, and modern browser automation.
Prerequisites
Before running tests, install Playwright browsers:
# Install Playwright (included in dev dependencies)
pip install -e ".[dev]"
# Install Playwright browsers
playwright install chromium firefox
# Install system dependencies (if needed)
playwright install-deps
Running Tests
Basic test execution:
# Run tests with default settings (chromium, v6, headed mode)
pytest -v
# Run tests against PatternFly v5
pytest -v --pf-version v5
# Run tests with Firefox
pytest -v --browser firefox
# Run tests in headless mode (no browser window)
pytest -v --headless
Advanced options:
# Run tests in parallel (speeds up execution)
pytest -v -n 3 --browser chromium --pf-version v6
# Run with slow motion for debugging (100ms delay between actions)
pytest -v --slowmo 100
# Run specific test file
pytest testing/components/test_button.py -v --browser firefox
# Run tests with coverage
pytest -v --cov=./ --cov-report=html
Available test options:
| Option | Choices | Default | Description |
|---|---|---|---|
--browser |
chromium, firefox |
chromium |
Browser to use for testing |
--pf-version |
v5, v6 |
v6 |
PatternFly version to test against |
--headless |
flag | False |
Run in headless mode (no UI) |
--slowmo |
milliseconds | 0 |
Slow down operations for debugging |
-n |
number | 1 |
Number of parallel workers (requires pytest-xdist) |
Debugging Tests
When debugging, it's helpful to:
- Run tests in headed mode (without
--headless) to see browser interactions - Use
--slowmoto slow down actions and observe what's happening - Run a single test file or test function instead of the entire suite
- Reduce parallelism (
-n 1or remove-nflag) to avoid race conditions
# Debug specific test with visible browser and slow execution
pytest testing/components/test_modal.py::test_modal_basic -v --slowmo 1000
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file widgetastic_patternfly5-26.1.5.0-py3-none-any.whl.
File metadata
- Download URL: widgetastic_patternfly5-26.1.5.0-py3-none-any.whl
- Upload date:
- Size: 55.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32dab99898915c3a4b1ee44fcb3c21d371c648b64ae94b5311c8b97d402a4d7e
|
|
| MD5 |
eeee87984875ca883db5ccd88cfc1c8b
|
|
| BLAKE2b-256 |
65fcc46a5233a15570fda4c6fc974268d26d15be034fabc007d5be93d35a94e3
|
Provenance
The following attestation bundles were made for widgetastic_patternfly5-26.1.5.0-py3-none-any.whl:
Publisher:
deploy.yml on RedHatQE/widgetastic.patternfly5
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
widgetastic_patternfly5-26.1.5.0-py3-none-any.whl -
Subject digest:
32dab99898915c3a4b1ee44fcb3c21d371c648b64ae94b5311c8b97d402a4d7e - Sigstore transparency entry: 919213164
- Sigstore integration time:
-
Permalink:
RedHatQE/widgetastic.patternfly5@98acfab37a7c1ba8d05c09a0005d6f0a5d7b413e -
Branch / Tag:
refs/tags/v26.01.05.0 - Owner: https://github.com/RedHatQE
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@98acfab37a7c1ba8d05c09a0005d6f0a5d7b413e -
Trigger Event:
push
-
Statement type: