Skip to content

Commit 31d6df2

Browse files
committed
🧪 Fix SDK E2E tests to work with vizzly tdd run
- Detect VIZZLY_SERVER_URL env var to skip starting own TDD server - Fix Vitest tests to use correct browser mode API (getByRole, getByText) - Fix Static-Site tests to use URL-style paths (/, /features) not filenames - Fix Storybook pattern matching to use story.id format (*button*) - Fix Ember assertions to check result.status instead of result.success - Add proper config structure for page discovery (pageDiscovery.useSitemap) All SDK E2E tests now pass when run via `vizzly tdd run`: - Storybook: 13/13 - Static-Site: 13/13 - Ember: 9/9 - Vitest: 24/24 - Ruby: 10/10
1 parent 8dd5b65 commit 31d6df2

File tree

14 files changed

+2373
-260
lines changed

14 files changed

+2373
-260
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,13 @@ jobs:
403403
working-directory: ./test-site
404404
run: npx playwright install firefox --with-deps
405405

406-
- name: Run E2E tests
406+
- name: Run E2E tests (TDD mode)
407+
working-directory: ./test-site
408+
run: node ../bin/vizzly.js tdd run "npm test"
409+
env:
410+
CI: true
411+
412+
- name: Run E2E tests (Cloud mode)
407413
working-directory: ./test-site
408414
run: node ../bin/vizzly.js run "npm test"
409415
env:
@@ -454,7 +460,13 @@ jobs:
454460
working-directory: ./clients/vitest
455461
run: npx playwright install chromium --with-deps
456462

457-
- name: Run E2E tests
463+
- name: Run E2E tests (TDD mode)
464+
working-directory: ./clients/vitest
465+
run: ../../bin/vizzly.js tdd run "npm run test:e2e"
466+
env:
467+
CI: true
468+
469+
- name: Run E2E tests (Cloud mode)
458470
working-directory: ./clients/vitest
459471
run: ../../bin/vizzly.js run "npm run test:e2e"
460472
env:
@@ -505,13 +517,21 @@ jobs:
505517
working-directory: ./clients/ember
506518
run: npx playwright install chromium --with-deps
507519

508-
- name: Run E2E tests
509-
working-directory: ./clients/ember
520+
- name: Build Ember test app
521+
working-directory: ./clients/ember/test-app
510522
run: |
511-
cd test-app
512523
npm install
513524
npm run build -- --mode development
514-
../../../bin/vizzly.js run "npx testem ci --file testem.cjs"
525+
526+
- name: Run E2E tests (TDD mode)
527+
working-directory: ./clients/ember/test-app
528+
run: ../../../bin/vizzly.js tdd run "npx testem ci --file testem.cjs"
529+
env:
530+
CI: true
531+
532+
- name: Run E2E tests (Cloud mode)
533+
working-directory: ./clients/ember/test-app
534+
run: ../../../bin/vizzly.js run "npx testem ci --file testem.cjs"
515535
env:
516536
CI: true
517537
VIZZLY_TOKEN: ${{ secrets.VIZZLY_EMBER_CLIENT_TOKEN }}
@@ -550,9 +570,9 @@ jobs:
550570
gem install bundler
551571
bundle install
552572
553-
- name: Run integration tests
573+
- name: Run integration tests (TDD mode)
554574
working-directory: ./clients/ruby
555-
run: VIZZLY_INTEGRATION=1 ruby -I lib test/integration_test.rb
575+
run: ../../bin/vizzly.js tdd run "VIZZLY_INTEGRATION=1 ruby -I lib test/integration_test.rb"
556576
env:
557577
CI: true
558578

clients/ember/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@
4949
"scripts": {
5050
"test": "node --test --test-reporter=spec 'tests/unit/**/*.test.js'",
5151
"test:integration": "node --test --test-reporter=spec 'tests/integration/**/*.test.js'",
52+
"test:integration:e2e": "RUN_E2E=1 node --test --test-reporter=spec 'tests/integration/e2e.test.js'",
5253
"test:all": "node --test --test-reporter=spec 'tests/**/*.test.js'",
5354
"test:watch": "node --test --test-reporter=spec --watch 'tests/**/*.test.js'",
5455
"test:ember": "cd test-app && npm install && npm run build -- --mode development && npx testem ci --file testem.cjs",
56+
"test:e2e:tdd": "../../bin/vizzly.js tdd run 'RUN_E2E=1 node --test --test-reporter=spec tests/integration/e2e.test.js'",
57+
"test:e2e:cloud": "../../bin/vizzly.js run 'RUN_E2E=1 node --test --test-reporter=spec tests/integration/e2e.test.js'",
58+
"test:ember:tdd": "../../bin/vizzly.js tdd run 'npm run test:ember'",
59+
"test:ember:cloud": "../../bin/vizzly.js run 'npm run test:ember'",
5560
"lint": "biome lint src tests bin",
5661
"lint:fix": "biome lint --write src tests bin",
5762
"format": "biome format --write src tests bin",

0 commit comments

Comments
 (0)