Skip to content

Commit 735cffc

Browse files
chore: migrate from Cypress to Playwright
- Remove Cypress dependencies and configuration - Add Playwright with serve for testing built files - Convert all 13 test cases to Playwright syntax - Update CI workflow to install Playwright browsers - Add Playwright artifacts upload to CI - All tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 7639ff8 commit 735cffc

File tree

12 files changed

+1272
-2308
lines changed

12 files changed

+1272
-2308
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ jobs:
2727
git config --global user.name uirouter_github_actions
2828
- name: Install Dependencies
2929
run: yarn install --pure-lockfile
30+
- name: Install Playwright Browsers
31+
run: npx playwright install chromium
3032
- name: Check Peer Dependencies
3133
run: npx check-peer-dependencies
3234
- name: Run Tests
3335
run: yarn ${{ matrix.yarncmd }}
36+
- name: Upload Playwright Report
37+
uses: actions/upload-artifact@v3
38+
if: always()
39+
with:
40+
name: playwright-report
41+
path: playwright-report/
42+
retention-days: 30

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
node_modules/
22
**/.*
3-
cypress/screenshots
4-
cypress/videos
53
yarn-error.log
4+
5+
# Playwright
6+
/test-results/
7+
/playwright-report/
8+
/playwright/.cache/

cypress.json

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

cypress/fixtures/example.json

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

cypress/integration/sample_app_spec.js

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

cypress/plugins/index.js

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

cypress/support/commands.js

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

cypress/support/index.js

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

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"clean": "rimraf docs",
77
"start": "NODE_ENV=development webpack serve --config webpack.config.js",
88
"build": "npm run clean && mkdirp docs && cp index.html docs/index.html && NODE_ENV=production webpack",
9-
"test": "npm run build && cypress-runner run --path docs",
10-
"test:open": "npm run build && cypress-runner open --path docs",
9+
"test": "npm run build && playwright test",
10+
"test:ui": "npm run build && playwright test --ui",
11+
"test:report": "playwright show-report",
1112
"gh-pages": "npm run build && git add docs && git commit -m 'update github pages' docs && git push"
1213
},
1314
"author": "",
@@ -26,15 +27,17 @@
2627
"@babel/core": "^7.14.8",
2728
"@babel/preset-env": "^7.14.9",
2829
"@babel/preset-react": "^7.14.5",
29-
"@uirouter/cypress-runner": "^1.1.0",
30+
"@playwright/test": "^1.48.0",
3031
"autoprefixer": "^10.4.23",
3132
"babel-loader": "^10.0.0",
3233
"babel-plugin-transform-class-properties": "^6.24.1",
3334
"copy-webpack-plugin": "^13.0.1",
3435
"css-loader": "^7.1.2",
36+
"mkdirp": "^3.0.1",
3537
"postcss-load-config": "^6.0.1",
3638
"postcss-loader": "^8.2.0",
3739
"rimraf": "^6.1.2",
40+
"serve": "^14.2.0",
3841
"style-loader": "^4.0.0",
3942
"webpack": "^5.104.1",
4043
"webpack-cli": "^6.0.1",

playwright.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { defineConfig, devices } from '@playwright/test';
2+
3+
export default defineConfig({
4+
testDir: './tests',
5+
testMatch: '**/*.spec.js',
6+
timeout: 30000,
7+
fullyParallel: true,
8+
forbidOnly: !!process.env.CI,
9+
reporter: [['html'], ['list']],
10+
11+
use: {
12+
baseURL: 'http://localhost:4000',
13+
trace: 'on-first-retry',
14+
screenshot: 'only-on-failure',
15+
video: 'retain-on-failure',
16+
},
17+
18+
projects: [
19+
{
20+
name: 'chromium',
21+
use: { ...devices['Desktop Chrome'] },
22+
},
23+
],
24+
25+
webServer: {
26+
command: 'npx serve docs -l 4000',
27+
port: 4000,
28+
timeout: 120000,
29+
reuseExistingServer: !process.env.CI,
30+
},
31+
});

0 commit comments

Comments
 (0)