Skip to content

Commit 77731cb

Browse files
chore: replace BrowserStack with Cypress cross-browser matrix (#919)
1 parent 6727e53 commit 77731cb

6 files changed

Lines changed: 115 additions & 103 deletions

File tree

.github/workflows/browserstack.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Cross-Browser Tests
2+
3+
on:
4+
merge_group:
5+
workflow_dispatch:
6+
pull_request:
7+
types:
8+
- opened
9+
- synchronize
10+
push:
11+
branches:
12+
- main
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
20+
21+
env:
22+
NODE_VERSION: 22
23+
24+
jobs:
25+
build:
26+
name: Build Package
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v6
32+
with:
33+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
34+
35+
- name: Build package
36+
uses: ./.github/actions/build
37+
with:
38+
node: ${{ env.NODE_VERSION }}
39+
40+
- name: Upload build artifacts
41+
uses: actions/upload-artifact@v7
42+
with:
43+
name: dist-${{ github.run_id }}
44+
path: dist
45+
retention-days: 1
46+
47+
cross-browser:
48+
needs: build
49+
name: ${{ matrix.browser }}
50+
runs-on: ${{ matrix.os }}
51+
timeout-minutes: 25
52+
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
os: [windows-latest]
57+
browser: [chrome, edge, firefox]
58+
59+
steps:
60+
- name: Checkout code
61+
uses: actions/checkout@v6
62+
with:
63+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
64+
65+
- name: Download build artifacts
66+
uses: actions/download-artifact@v8
67+
with:
68+
name: dist-${{ github.run_id }}
69+
path: dist
70+
71+
- name: Setup Node
72+
uses: actions/setup-node@v6
73+
with:
74+
node-version: ${{ env.NODE_VERSION }}
75+
76+
- name: Install dependencies
77+
run: npm i
78+
79+
- name: Run cross-browser tests
80+
uses: cypress-io/github-action@v7
81+
with:
82+
browser: ${{ matrix.browser }}
83+
start: npm run start:local
84+
wait-on: 'http://127.0.0.1:4200'
85+
spec: projects/playground/e2e/integration/playground.cy.ts
86+
config-file: cypress.config.js
87+
install-command: npx cypress install
88+
89+
- name: Upload Cypress screenshots
90+
if: failure()
91+
uses: actions/upload-artifact@v7
92+
with:
93+
name: cypress-screenshots-${{ matrix.browser }}-${{ github.run_id }}
94+
path: projects/playground/e2e/screenshots
95+
retention-days: 30
96+
if-no-files-found: ignore

browserstack.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

cypress.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const { defineConfig } = require('cypress');
2+
3+
module.exports = defineConfig({
4+
e2e: {
5+
baseUrl: 'http://127.0.0.1:4200',
6+
specPattern: 'projects/playground/e2e/integration/**/*.cy.ts',
7+
screenshotsFolder: 'projects/playground/e2e/screenshots',
8+
videosFolder: 'projects/playground/e2e/videos',
9+
supportFile: false,
10+
chromeWebSecurity: false,
11+
viewportWidth: 1000,
12+
viewportHeight: 1000,
13+
reporter: 'junit',
14+
reporterOptions: {
15+
mochaFile: 'projects/playground/test-results/e2e/junit-[hash].xml',
16+
},
17+
},
18+
});

cypress.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@
5454
"@types/node": "^22.19.17",
5555
"@typescript-eslint/eslint-plugin": "^8.59.1",
5656
"@typescript-eslint/parser": "^8.59.0",
57-
"browserstack-cypress-cli": "^1.36.5",
5857
"concurrently": "^6.2.0",
5958
"cors": "^2.8.6",
6059
"cross-fetch": "^4.1.0",
61-
"cypress": "^13.17.0",
60+
"cypress": "^14.5.4",
6261
"eslint": "^8.57.0",
6362
"eslint-plugin-import": "latest",
6463
"eslint-plugin-jsdoc": "latest",

0 commit comments

Comments
 (0)