GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - acorvello/e2e-playwright-python: Cross-browser E2E test automation with Playwright (Python) and Pytest for OWASP Juice Shop: Chromium, Firefox and WebKit, isolated browser contexts per test, failure diagnostics, and a headless Docker runner integrated in a Jenkins CI/CD pipeline.

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pytest.ini
pytest.ini
 
 
requirements.txt
requirements.txt
 
 
sonar-project.properties
sonar-project.properties
 
 

Repository files navigation

🎭 Cross-Browser E2E Automation Framework: Playwright, Python & Pytest

Python Playwright Pytest Docker Jenkins License: MIT

End-to-End Web Testing with Playwright (Python bindings) and Pytest

This repository is an automated end-to-end (E2E) testing suite built with Playwright for Python and pytest-playwright. It runs user journeys against the OWASP Juice Shop application across Chromium, Firefox and WebKit, using isolated browser contexts and a headless Docker runner.

It is the Playwright layer of a larger CI/CD ecosystem: docker-test-env runs it with Juice Shop inside a Jenkins pipeline, alongside the Cypress, Selenium and API suites.


πŸ—ΊοΈ Quick Navigation

  • Engineering Highlights
  • Architecture
  • Where It Fits: CI/CD Pipeline
  • Tech Stack
  • Project Structure
  • Covered Scenarios
  • Running Locally
  • Running via Docker
  • Roadmap

πŸ’‘ Engineering Highlights

  • Cross-Browser Execution: Runs the same tests on Chromium, Firefox and WebKit, reducing platform-specific surprises.
  • Isolated Browser Contexts: Each test gets a fresh, independent browser context, so cookies, cache and session state do not leak between tests.
  • Failure Diagnostics: Built on pytest-playwright, which supports screenshots and traces on failure to help root-cause analysis.
  • Environment-Driven Configuration: The base URL is a parameter, so the same suite runs on a developer machine or inside containers.

🧭 Architecture

flowchart LR
    PT["Pytest<br/>conftest.py and tests"] --> PP["pytest-playwright<br/>Fixtures"]
    PP --> CTX["Isolated Browser Context<br/>per test"]
    CTX --> CH["Chromium"]
    CTX --> FF["Firefox"]
    CTX --> WK["WebKit"]
    CH --> JS["OWASP Juice Shop"]
    FF --> JS
    WK --> JS
    PT -.->|"on failure"| ART["Screenshots and Traces"]
Loading

🧭 Where It Fits: CI/CD Pipeline

flowchart LR
    JK["Jenkins Pipeline"] --> D["Docker Compose<br/>docker-test-env"]
    D --> JS["OWASP Juice Shop"]
    D --> PWC["Playwright Python Container<br/>mcr.microsoft.com/playwright/python<br/>this repository"]
    PWC -->|"Headless browsers"| JS
    PWC --> R["Test Results<br/>and Failure Artifacts"]
    R --> JK
Loading

πŸ› οΈ Tech Stack and Dependencies

  • Automation Engine: Playwright 1.48+ (Python bindings)
  • Test Runner: pytest with pytest-playwright
  • Infrastructure: Official Microsoft Playwright container image for headless runs in Jenkins CI/CD (via docker-test-env)

πŸ“ Project Structure

e2e-playwright-python/
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ pytest.ini
└── tests/
    β”œβ”€β”€ conftest.py
    └── test_juice_shop_login.py

πŸ” Covered Scenarios

  • Home page: loads successfully and lists the product components.
  • Navigation: the login page renders when opened from the account menu.
  • Invalid login: an error message is displayed when invalid credentials are submitted.

πŸš€ Running Locally

Prerequisites: Python 3.10+ and a running instance of Juice Shop (locally or in a container).

Windows (PowerShell):

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
playwright install
pytest --base-url=http://localhost:3001 --browser chromium --browser firefox --browser webkit

Linux / macOS:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
playwright install --with-deps
pytest --base-url=http://localhost:3001 --browser chromium --browser firefox --browser webkit

🐳 Running via Docker (CI/CD Orchestration)

This repository is consumed by the docker-test-env orchestration project. The pipeline starts Juice Shop and runs this suite inside the official mcr.microsoft.com/playwright/python container image, triggered and tracked by a unified Jenkins pipeline. See that project's docker-compose.yml for the full setup.


πŸ”— Related Projects

  • docker-test-env: Docker Compose + Jenkins + SonarQube orchestration
  • e2e-cypress-js: Cypress E2E suite
  • e2e-selenium-java: Selenium 4 + JUnit 5 suite
  • api-testing: REST API tests with Pytest
  • Profile & ecosystem overview

πŸ“ˆ Roadmap and Next Steps

  • Integrate pytest-html to generate visual reports and archive them as CI artifacts
  • Expand coverage to multi-step cart, basket and checkout flows
  • Combine UI tests with API-level setup and checks (see api-testing)

βš–οΈ License

This repository is licensed under the MIT License. Feel free to clone, study, modify, and distribute the code for educational or portfolio purposes.


πŸ‘€ Author

Alexsander Corvello da Silveira, Senior QA Engineer focused on AI-driven testing and applied machine learning. GitHub: @acorvello

About

Cross-browser E2E test automation with Playwright (Python) and Pytest for OWASP Juice Shop: Chromium, Firefox and WebKit, isolated browser contexts per test, failure diagnostics, and a headless Docker runner integrated in a Jenkins CI/CD pipeline.

www.linkedin.com/in/acorvello/details/projects/

Topics

ci-cdcross-browser-testingdockere2e-testingend-to-end-testingheadless-testingjenkinsjuice-shopowasp-juice-shopplaywrightplaywright-pythonpytestpytest-playwrightpythonquality-assurancesdettest-automationui-testingweb-testing

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.