From 9384ec1493a3c2cf2f2407bace6ad6db35c920c0 Mon Sep 17 00:00:00 2001 From: Vern Kofford Date: Tue, 3 Feb 2026 12:43:27 -0700 Subject: [PATCH 1/3] ci: add GitHub Actions workflow for automated testing --- .github/workflows/playwright.yml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/playwright.yml diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 0000000..69c2d8f --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,38 @@ +name: Playwright Tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 + + - name: Set up Python + run: uv python install 3.12 + + - name: Install dependencies + run: uv sync + + - name: Install Playwright browsers + run: uv run playwright install --with-deps + + - name: Run Playwright tests + run: uv run pytest --tracing=retain-on-failure + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 \ No newline at end of file From cd22ce3d0f11e89b22fb780c4617b6d31ad2b640 Mon Sep 17 00:00:00 2001 From: Vern Kofford Date: Tue, 3 Feb 2026 12:50:25 -0700 Subject: [PATCH 2/3] docs: add CI badge and documentation to README --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 551ebc4..106c865 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Python Playwright - SauceDemo Test Suite +![Playwright Tests](https://github.com/vernko/python-playwright-saucedemo/actions/workflows/playwright.yml/badge.svg) + Automated testing suite for SauceDemo e-commerce site using Python and Playwright, focusing on authentication flows and user role testing. ## Setup @@ -26,6 +28,16 @@ uv run pytest tests/test_login.py -v uv run pytest --headed ``` +## CI/CD + +This project uses GitHub Actions to automatically run tests on every push and pull request. + +- Tests run on: Ubuntu Latest +- Python version: 3.12 +- Browsers: Chromium, Firefox, WebKit (headless) + +View test results in the [Actions tab](https://github.com/vernko/python-playwright-saucedemo/actions). + ## Project Structure ``` tests/ From 316ab745b4011c200706266d581dda70d9dc51dd Mon Sep 17 00:00:00 2001 From: Vern Kofford Date: Tue, 3 Feb 2026 12:55:48 -0700 Subject: [PATCH 3/3] fix: remove headed mode from pytest defaults for CI compatibility --- pytest.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pytest.ini b/pytest.ini index 69bb164..38be796 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,5 +2,4 @@ testpaths = tests python_files = test_*.py python_classes = Test* -python_functions = test_* -addopts = --headed --browser=chromium \ No newline at end of file +python_functions = test_* \ No newline at end of file