Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/
Expand Down
3 changes: 1 addition & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
addopts = --headed --browser=chromium
python_functions = test_*
Loading