What problem does it solve?
E2E testing in a growing Python web project becomes slow and flaky when tests duplicate browser setup, sprinkle raw locators everywhere, and rely on fixed sleeps instead of reliable synchronization. This Skill standardizes Selenium + pytest structure so your coding agent can refactor tests safely while keeping interactions deterministic.
Core Features & Use Cases
- Page Object Model with explicit waits: Consolidates locators and user flows into
tests/pages/ using a shared BasePage with WebDriverWait and expected conditions, avoiding time.sleep().
- Centralized driver lifecycle: Ensures
webdriver.Chrome() (or Remote) is created only in conftest.py via a single pytest fixture, enabling consistent local/CI behavior.
- Failure diagnostics and maintainability: Captures screenshots on test failure using a pytest hook/fixture finalizer, and enforces conventions that keep tests free of raw
find_element() and By usage.
- Auth and integration coverage: Encourages dedicated authentication test modules for redirects, login/logout/session handling, and protected-page access control.
Quick Start
Ask your agent to generate a Selenium + pytest E2E test suite skeleton that follows the required tests/pages/, conftest.py, and explicit-waits structure for your application.