Skip to content

Commit 1a87bc6

Browse files
committed
GH Actions: Cypress test on Windows Edge and Mac WebKit
1 parent b23a0bf commit 1a87bc6

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,14 @@ jobs:
6565
strategy:
6666
fail-fast: false
6767
matrix:
68-
type: [e2e, component]
69-
browser: [firefox, chrome]
7068
os: [ubuntu-latest]
71-
# TODO: re-enable once macos build is stable #590
72-
# include:
73-
# - os: macos-latest
74-
# browser: edge
69+
browser: [firefox, chrome]
70+
include:
71+
- os: macos-latest
72+
browser: webkit
73+
- os: windows-latest
74+
browser: edge
75+
7576
env:
7677
COVERAGE: true
7778
steps:
@@ -84,36 +85,41 @@ jobs:
8485
node-version: 'lts/*'
8586
cache: yarn
8687

87-
- name: Test (E2E)
88-
if: matrix.type == 'e2e'
88+
- name: Install WebKit support
89+
if: matrix.browser == 'webkit'
90+
run: yarn add playwright-webkit --dev --mode=update-lockfile
91+
92+
- name: Component test
93+
# Component tests on webkit hang for some reason
94+
if: matrix.browser != 'webkit'
95+
uses: cypress-io/github-action@v6
96+
with:
97+
component: true
98+
browser: ${{ matrix.browser }}
99+
100+
- name: E2E test
89101
uses: cypress-io/github-action@v6
90102
env:
91103
BASE_URL: http://localhost:4173/
92104
with:
105+
install: ${{ matrix.browser == 'webkit' }} # Only install if not done in previous step
93106
build: yarn run build --mode offline
94107
start: yarn run preview
95108
config: baseUrl=${{ env.BASE_URL }}
96109
wait-on: ${{ env.BASE_URL }}
97110
browser: ${{ matrix.browser }}
98111

99-
- name: Test (component)
100-
if: matrix.type == 'component'
101-
uses: cypress-io/github-action@v6
102-
with:
103-
component: true
104-
browser: ${{ matrix.browser }}
105-
106112
- name: Upload screenshots
107113
uses: actions/upload-artifact@v4
108114
if: failure()
109115
with:
110-
name: 'cypress-screenshots_${{ matrix.type }}_${{ matrix.browser }}_${{ matrix.os }}'
116+
name: 'cypress-screenshots_${{ matrix.browser }}_${{ matrix.os }}'
111117
path: tests/e2e/screenshots
112118

113119
- name: Upload coverage artifact
114120
uses: actions/upload-artifact@v4
115121
with:
116-
name: 'coverage_${{ matrix.type }}_${{ matrix.browser }}_${{ matrix.os }}'
122+
name: 'coverage_cypress_${{ matrix.browser }}_${{ matrix.os }}'
117123
path: coverage/lcov.info
118124
retention-days: 4
119125

cypress.config.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ module.exports = defineConfig({
6464
},
6565

6666
morgan: false, // Disable XHR logging as it's very noisy
67+
experimentalWebKitSupport: true,
6768
})

tests/e2e/specs/userprofile.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe('User Profile', () => {
144144
.get('.node-data-cycle')
145145
.then(($els) => {
146146
expect(
147-
Array.from($els, (el) => el.innerText)
147+
Array.from($els, (el) => el.innerText.trim())
148148
).to.deep.equal(expected)
149149
})
150150
}

0 commit comments

Comments
 (0)