-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathauto-copilot-playwright-auto-test.yml
More file actions
104 lines (52 loc) · 2.1 KB
/
auto-copilot-playwright-auto-test.yml
File metadata and controls
104 lines (52 loc) · 2.1 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: "Copilot: Generate and Run Playwright Tests Until Passing"
on:
push:
branches:
- main
- master
jobs:
generate-and-test:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Setup Python
uses: actions/setup-python@main
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install pytest playwright pytest-playwright
- name: Install Playwright browsers
run: |
python -m playwright install
- name: Copilot Generate Playwright Scripts
uses: github/copilot-agent/playwright-generate@main # Example, customize for Python; or use Chat to generate script
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
prompt: "Generate Playwright test scripts covering every user action on this web app."
continue-on-error: true # If your agent doesn't support, replace with python script generation using Copilot Chat
- name: Run Playwright Tests
run: |
pytest tests/ # Or the path to your Playwright scripts
- name: If Tests Fail, Copilot Attempts Fix & Repeats
uses: github/copilot-agent/playwright-fix-and-loop@main # Example, requires agent loop feature
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
max_attempts: 5
continue-on-error: true
- name: Create PR with passing tests or attempted fixes
uses: peter-evans/create-pull-request@main
with:
branch: "copilot/playwright-auto-tests"
title: "Copilot generated Playwright tests (auto-fixed)"
body: "Automated Playwright test generation/fix by Copilot agent."
commit-message: "Copilot agent Playwright tests and fixes"
continue-on-error: true
- name: Auto-merge if passing
uses: pascalgn/automerge-action@main
with:
merge-method: squash
github-token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true