forked from omnistrate-oss/customer-portal
-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (105 loc) · 4.25 KB
/
Copy pathplaywright.yml
File metadata and controls
118 lines (105 loc) · 4.25 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Playwright Tests - SaaSBuilder
permissions:
contents: read
actions: write
on:
pull_request:
branches:
- master
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
reason:
description: "Reason for running tests"
required: false
default: "Manual trigger"
jobs:
test:
name: Playwright Tests - SaaSBuilder
if: github.event.pull_request.draft == false
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Checkout HAR submodule
run: |
git config --global url."https://x-access-token:${{ secrets.HAR_REPO_TOKEN }}@github.com/".insteadOf "https://github.com/"
git submodule update --init --recursive
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: lts/*
cache: 'yarn'
- name: Enable Corepack and activate Yarn
run: |
corepack enable
corepack prepare yarn@4.5.0 --activate
- name: Install dependencies
# Scripts are disabled by default to prevent supply-chain attacks; only
# the security-reviewed allowlist is rebuilt. Browsers are provisioned
# explicitly by the `Install Playwright Browsers` step below.
run: |
YARN_ENABLE_SCRIPTS=false yarn install --immutable
yarn rebuild sharp tree-sitter tree-sitter-json @tree-sitter-grammars/tree-sitter-yaml
- name: Log Installed Dependency Versions
run: |
echo "::group::Installed dependency versions"
yarn info --name-only
echo "::endgroup::"
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Build and start saasbuilder server
run: |
yarn build
yarn start &
# Wait for server to be ready
yarn wait-on http://localhost:8080 --timeout 60000
env:
PROVIDER_EMAIL: ${{ secrets.PROVIDER_EMAIL }}
PROVIDER_PASSWORD: ${{ secrets.PROVIDER_PASSWORD }}
NEXT_PUBLIC_BACKEND_BASE_DOMAIN: https://api.omnistrate.dev
ENVIRONMENT_TYPE: DEV
MAIL_USER_EMAIL: ${{ secrets.MAIL_USER_EMAIL }}
MAIL_USER_PASSWORD: ${{ secrets.MAIL_USER_PASSWORD }}
- name: Run Playwright tests (replay mode)
id: tests
run: yarn test:replay
env:
CI: true
HAR_MODE: replay
YOUR_SAAS_DOMAIN_URL: http://localhost:8080
USER_EMAIL: ${{ secrets.USER_EMAIL }}
USER_PASSWORD: ${{ secrets.USER_PASSWORD }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCP_PROJECT_NUMBER: ${{ secrets.GCP_PROJECT_NUMBER }}
BYOA_AWS_ACCOUNT_ID: ${{ secrets.BYOA_AWS_ACCOUNT_ID }}
NEXT_PUBLIC_BACKEND_BASE_DOMAIN: "https://api.omnistrate.dev"
ENVIRONMENT_TYPE: DEV
PROVIDER_EMAIL: ${{ secrets.PROVIDER_EMAIL }}
PROVIDER_PASSWORD: ${{ secrets.PROVIDER_PASSWORD }}
- name: Check for backend soft failures
if: always()
id: soft-failures
run: |
if [ -f tests/backend-failures.json ]; then
echo "has_soft_failures=true" >> "$GITHUB_OUTPUT"
echo "## Backend Soft Failures" >> "$GITHUB_STEP_SUMMARY"
echo "The following tests were skipped due to backend infrastructure issues (not UI bugs):" >> "$GITHUB_STEP_SUMMARY"
echo '```json' >> "$GITHUB_STEP_SUMMARY"
cat tests/backend-failures.json >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
else
echo "has_soft_failures=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 7
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: steps.soft-failures.outputs.has_soft_failures == 'true'
with:
name: backend-failures
path: tests/backend-failures.json
retention-days: 7