@testivai/witness-playwright 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/snapshot.js +8 -0
- package/package.json +3 -3
package/dist/snapshot.js
CHANGED
|
@@ -310,6 +310,14 @@ async function snapshot(page, testInfo, name, config) {
|
|
|
310
310
|
await page.screenshot({ path: screenshotPath, fullPage: true });
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
+
// 1.5. Local mode: also place the screenshot in the layout expected by
|
|
314
|
+
// @testivai/witness/report (subdirectory keyed by snapshot name).
|
|
315
|
+
// This is what `BaselineStore.listTemp()` and `compareAll()` enumerate.
|
|
316
|
+
if (isLocalMode) {
|
|
317
|
+
const localSnapshotDir = path.join(outputDir, snapshotName);
|
|
318
|
+
await fs.ensureDir(localSnapshotDir);
|
|
319
|
+
await fs.copyFile(screenshotPath, path.join(localSnapshotDir, 'screenshot.png'));
|
|
320
|
+
}
|
|
313
321
|
// 2. Dump page structure (HTML) - skip in local mode
|
|
314
322
|
// @renamed: domPath → structurePath (IP protection)
|
|
315
323
|
let structurePath = '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testivai/witness-playwright",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Playwright sensor for Testivai Visual Regression Test system",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"fs-extra": "^11.2.0",
|
|
52
52
|
"sharp": "^0.34.5",
|
|
53
53
|
"simple-git": "^3.21.0",
|
|
54
|
-
"@testivai/
|
|
55
|
-
"@testivai/
|
|
54
|
+
"@testivai/common": "0.2.2",
|
|
55
|
+
"@testivai/witness": "1.0.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@playwright/test": "^1.40.0",
|