Skip to content

Commit 16dc2ff

Browse files
authored
✨ Capture page URL in all JS client SDKs (#220)
## Summary Sends the current page URL as a `url` property when capturing screenshots. This enables the backend to link individual screenshots to their corresponding deploy preview pages (preview-to-screenshot integration). - **Static Site**: `properties.url = page.url()` — Playwright page available in `captureAndSendScreenshot` - **Storybook**: `{ properties: { url: page.url() } }` passed to `vizzlyScreenshot` — was previously sending no properties - **Vitest**: `url: page.url()` added to the properties object built in `toMatchScreenshot` - **Ember**: `url: window.location.href` added to browser-side properties payload — screenshot server forwards as-is All placed before the user's `...customProperties` spread so users can override if needed. ## Test plan - [x] `npm test` — 1892 pass, 0 fail - [x] `npm run lint` — clean - [x] Storybook screenshot test mocks updated with `url()` method - [ ] Deploy and verify `url` appears in screenshot records via Vizzly dashboard
1 parent d82d78e commit 16dc2ff

9 files changed

Lines changed: 6 additions & 645 deletions

File tree

.github/workflows/sdk-unit.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,6 @@ jobs:
312312
env:
313313
CI: true
314314

315-
- name: Run integration tests
316-
working-directory: ./clients/ember
317-
run: npm run test:integration
318-
env:
319-
CI: true
320-
321315
# Status check for branch protection
322316
check:
323317
name: SDK Unit Status

clients/ember/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,9 @@
4848
],
4949
"scripts": {
5050
"test": "node --test --test-reporter=spec 'tests/unit/**/*.test.js'",
51-
"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'",
5351
"test:all": "node --test --test-reporter=spec 'tests/**/*.test.js'",
5452
"test:watch": "node --test --test-reporter=spec --watch 'tests/**/*.test.js'",
5553
"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'",
5854
"test:ember:tdd": "../../bin/vizzly.js tdd run 'npm run test:ember'",
5955
"test:ember:cloud": "../../bin/vizzly.js run 'npm run test:ember'",
6056
"lint": "biome lint src tests bin",

clients/ember/src/test-support/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ export async function vizzlyScreenshot(name, options = {}) {
266266
browser: detectBrowser(),
267267
viewport_width: width,
268268
viewport_height: height,
269+
url: window.location.href,
269270
...properties,
270271
},
271272
};

0 commit comments

Comments
 (0)