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 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/ 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