-
Notifications
You must be signed in to change notification settings - Fork 69
70 lines (57 loc) · 2.39 KB
/
playwright.yml
File metadata and controls
70 lines (57 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
name: Hosted playwright tests
on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
merge_group:
# this prevents multiple jobs from the same pr
# running when new changes are pushed.
concurrency:
group: ${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true
jobs:
playwright-tests:
runs-on:
- codebuild-image-builder-frontend-${{ github.run_id }}-${{ github.run_attempt }}
- instance-size:large
- buildspec-override:true
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get current PR URL
id: get-pr-url
run: |
# Extract the pull request URL from the event payload
pr_url=$(jq -r '.pull_request.html_url' < "$GITHUB_EVENT_PATH")
echo "Pull Request URL: $pr_url"
# Set the PR URL as an output using the environment file
echo "pr_url=$pr_url" >> $GITHUB_ENV
- name: Setup Node.js with cached dependencies
uses: ./.github/actions/setup-node-cached
- name: Install Playwright
run: npx playwright install chromium --only-shell
# This prevents an error related to minimum watchers when running the front-end and playwright
- name: Increase file watchers limit
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Update /etc/hosts
run: sudo npm run patch:hosts
- name: Start front-end server
run: |
npm run start:federated &
npx wait-on http://localhost:8003/apps/image-builder/
- name: Run testing proxy
run: docker run -d --network=host -e HTTPS_PROXY=$RH_PROXY_URL -v "$(pwd)/config:/config:ro,Z" --name frontend-development-proxy quay.io/redhat-user-workloads/hcc-platex-services-tenant/frontend-development-proxy
- name: Run front-end Playwright tests
env:
BASE_URL: https://stage.foo.redhat.com:1337
run: |
CURRENTS_PROJECT_ID=hIU6nO CURRENTS_RECORD_KEY=$CURRENTS_RECORD_KEY npx playwright test playwright/Customizations playwright/Import playwright/Cockpit playwright/Basic
- name: Store front-end Test report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 10