Skip to content

Commit bea9200

Browse files
committed
Fix CI pipeline for Playwright migration
Updated CircleCI configuration to properly support Playwright e2e tests: - Removed Cypress orb reference as it's no longer needed - Updated Docker image from cypress/browsers to mcr.microsoft.com/playwright:v1.56.1-noble - Removed Cypress cache path - Added e2e_tests job that installs Playwright browsers and runs tests - Added e2e_tests to workflow to ensure e2e tests run in CI The PR migrated from Cypress to Playwright but the CI config wasn't fully updated to run the new Playwright tests, causing CI failures.
1 parent ec6be0c commit bea9200

2 files changed

Lines changed: 971 additions & 2453 deletions

File tree

.circleci/config.yml

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
version: 2.1
22

3-
orbs:
4-
cypress: cypress-io/cypress@2.2.0
5-
63
executors:
74
default:
85
docker:
9-
- image: cypress/browsers:22.15.0
6+
- image: mcr.microsoft.com/playwright:v1.56.1-noble
107

118
parameters:
129
workspace_root:
@@ -51,7 +48,6 @@ jobs:
5148
paths:
5249
- node_modules
5350
- << pipeline.parameters.workspace_root >>.cache/yarn
54-
- << pipeline.parameters.workspace_root >>.cache/Cypress
5551
- run: node --version
5652
- run: yarn --version
5753

@@ -65,10 +61,6 @@ jobs:
6561
- run:
6662
name: Run tests
6763
command: yarn test:ci
68-
- persist_to_workspace:
69-
root: << pipeline.parameters.workspace_root >>
70-
paths:
71-
- project/vitest-coverage
7264

7365
lint:
7466
executor: default
@@ -82,27 +74,19 @@ jobs:
8274
command: |
8375
yarn lint:ci
8476
85-
report_coverage:
77+
e2e_tests:
8678
executor: default
8779
steps:
8880
- checkout
8981
- *attach_workspace
9082
- *restore_cache
9183
- *yarn_install
9284
- run:
93-
name: Merge reports into one file
94-
command: |
95-
mkdir reports
96-
mkdir .nyc_output
97-
ls -al cypress-coverage
98-
cp cypress-coverage/coverage.node-*.json reports
99-
cp vitest-coverage/coverage-final.json reports/from-vitest.json
100-
yarn nyc merge reports
101-
mv coverage.json .nyc_output/out.json
85+
name: Install Playwright browsers
86+
command: npx playwright install --with-deps chromium
10287
- run:
103-
name: Convert finalized report from JSON to lcov
104-
command: |
105-
yarn nyc report --reporter lcov --report-dir coverage
88+
name: Run E2E tests
89+
command: yarn test:e2e:headless
10690

10791
workflows:
10892
default:
@@ -117,35 +101,6 @@ workflows:
117101
requires:
118102
- install_dependencies
119103

120-
- cypress/run:
121-
name: integration_tests
104+
- e2e_tests:
122105
requires:
123106
- install_dependencies
124-
executor: default
125-
pre-steps:
126-
- checkout
127-
- *attach_workspace
128-
- *restore_cache
129-
- *yarn_install
130-
attach-workspace: true
131-
browser: 'chrome' # actually use Chrome (and not Electron)
132-
record: true # record results on Cypress Dashboard
133-
parallel: true # split all specs across machines
134-
parallelism: 3 # use X number of CircleCI machines
135-
command-prefix: yarn # dont use npx
136-
group: 'all tests' # name this group "all tests" on the dashboard
137-
start: 'yarn dev' # start server before running tests
138-
wait-on: http://localhost:3000 # wait until server is ready
139-
post-steps:
140-
- run:
141-
name: Get each parallelized node's coverage report
142-
command: cp cypress-coverage/coverage-final.json "cypress-coverage/coverage.node-$CIRCLE_NODE_INDEX.json"
143-
- persist_to_workspace:
144-
root: << pipeline.parameters.workspace_root >>
145-
paths:
146-
- project/cypress-coverage
147-
148-
- report_coverage:
149-
requires:
150-
- unit_tests
151-
- integration_tests

0 commit comments

Comments
 (0)