Skip to content

Commit 10133ad

Browse files
committed
Add GitHub Actions
Add GitHub Actions workflow for Playwright tests
1 parent dcb2cb4 commit 10133ad

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

FakeStorePlayWright/playwright.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Playwright Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test_ui:
11+
timeout-minutes: 60
12+
runs-on: windows-latest # Use Windows runner
13+
14+
steps:
15+
# Checkout the repository
16+
- uses: actions/checkout@v4
17+
18+
# Set up Python
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12" # Specify the Python version you need
23+
24+
# Install dependencies
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install pytest playwright
29+
30+
# Install Playwright browsers
31+
- name: Install Playwright browsers
32+
run: playwright install --with-deps
33+
34+
# Run Playwright tests
35+
- name: Run Playwright tests
36+
run: pytest tests/ # Replace `tests/` with the directory containing your tests
37+
38+
# Upload test report (if applicable)
39+
- uses: actions/upload-artifact@v4
40+
if: always()
41+
with:
42+
name: playwright-report
43+
path: playwright-report/ # Ensure your tests generate a report in this directory
44+
retention-days: 30

playwright-tests.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Playwright Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test_ui:
11+
timeout-minutes: 60
12+
runs-on: windows-latest # Use Windows runner
13+
14+
steps:
15+
# Checkout the repository
16+
- uses: actions/checkout@v4
17+
18+
# Set up Python
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12" # Specify the Python version you need
23+
24+
# Install dependencies
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install pytest playwright
29+
30+
# Install Playwright browsers
31+
- name: Install Playwright browsers
32+
run: playwright install --with-deps
33+
34+
# Run Playwright tests
35+
- name: Run Playwright tests
36+
run: pytest tests/ # Replace `tests/` with the directory containing your tests
37+
38+
# Upload test report (if applicable)
39+
- uses: actions/upload-artifact@v4
40+
if: always()
41+
with:
42+
name: playwright-report
43+
path: playwright-report/ # Ensure your tests generate a report in this directory
44+
retention-days: 30

0 commit comments

Comments
 (0)