-
Notifications
You must be signed in to change notification settings - Fork 9
74 lines (66 loc) · 2.56 KB
/
playwright-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build and run Playwright tests
on:
push:
branches:
- master
- QAWTO-194/feat/enable-playwright-tests-in-actions
pull_request:
branches: master
jobs:
build-and-test:
name: Build and Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install playwright browsers
run: |
playwright install
- name: Playwright test with pytest
run: |
cd web_playwright
python -m pytest tests/test_web_playwright_pytest.py --junitxml="test-result-pytest.xml"
python -m pytest tests/test_web_playwright_library_sync.py --junitxml="test-result-sync.xml"
python -m pytest tests/test_web_playwright_library_async.py --junitxml="test-result-async.xml"
- name: Upload Playwright Test Results
if: always()
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: playwright-tests-results-python-${{ matrix.python-version }}
path: web_playwright/test-result*.xml
retention-days: 7
publish-playwright-test-results:
name: "Publish Playwright Tests Results"
needs: build-and-test
runs-on: ubuntu-latest
if: success() || failure()
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Download Playwright test Artifacts
uses: actions/download-artifact@v4
with:
name: playwright-tests-results-python-${{ matrix.python-version }}
path: playwright-tests-results-python-${{ matrix.python-version }}
- name: Publish Playwright Test Results ${{ matrix.python-version }}
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: |
playwright-tests-results-python-${{ matrix.python-version }}/**/*.xml
comment_title: "Playwright Tests Results Python ${{ matrix.python-version }}"