-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
87 lines (79 loc) · 2.39 KB
/
Copy pathaction.yml
File metadata and controls
87 lines (79 loc) · 2.39 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
name: "AI Visual Testing"
description: "Detects UI changes in PRs with AI-powered visual testing"
author: "Joao Garin"
branding:
icon: "eye"
color: "purple"
inputs:
base-url:
description: "URL of the baseline site (e.g., staging)"
required: true
pr-url:
description: "URL of the PR deployment"
required: true
pages:
description: "JSON array of page paths to test (e.g., ['/', '/about', '/contact']). If not provided, only the homepage is tested."
required: false
threshold:
description: "Diff sensitivity (0-1, lower = stricter)"
required: false
default: "0.1"
bruni-token:
description: "Token for sending reports to Bruni API"
required: false
bruni-api-url:
description: "URL for the Bruni API endpoint"
required: false
default: "https://app.brunivisual.com/api/tests"
secrets:
OPENAI_API_KEY:
description: "OpenAI API key for the agent"
required: true
runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
working-directory: ${{ github.action_path }}
run: |
npm install
shell: bash
- name: Build TypeScript
working-directory: ${{ github.action_path }}
run: |
npm run build
shell: bash
- name: Install Playwright
working-directory: ${{ github.action_path }}
run: |
npx playwright install --with-deps chromium
npx playwright install-deps chromium
shell: bash
- name: Start MCP Server
working-directory: ${{ github.action_path }}
run: |
npx @playwright/mcp@latest --port 8931 &
sleep 5 # Give the server time to start
shell: bash
- name: Run URL comparison
working-directory: ${{ github.action_path }}
env:
OPENAI_API_KEY: ${{ env.OPENAI_API_KEY }}
GITHUB_TOKEN: ${{ github.token }}
PYTHONPATH: ${{ github.action_path }}
run: |
node dist/index.js \
--base-url "${{ inputs.base-url }}" \
--pr-url "${{ inputs.pr-url }}" \
--pages "${{ inputs.pages }}" \
--bruni-token "${{ inputs.bruni-token }}" \
--bruni-api-url "${{ inputs.bruni-api-url }}"
shell: bash
- name: Stop MCP Server
working-directory: ${{ github.action_path }}
run: |
pkill -f "@playwright/mcp" || true
shell: bash