@testivai/witness-playwright 1.6.3 → 1.7.0
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/README.md +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -34,11 +34,11 @@ npm install -D @testivai/witness-playwright
|
|
|
34
34
|
3. **Capture snapshots in your tests**
|
|
35
35
|
```typescript
|
|
36
36
|
import { test, expect } from '@playwright/test';
|
|
37
|
-
import {
|
|
37
|
+
import { witness } from '@testivai/witness-playwright';
|
|
38
38
|
|
|
39
39
|
test('homepage visual', async ({ page }, testInfo) => {
|
|
40
40
|
await page.goto('https://example.com');
|
|
41
|
-
await
|
|
41
|
+
await witness(page, testInfo, 'homepage');
|
|
42
42
|
});
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -79,18 +79,18 @@ export default defineConfig({
|
|
|
79
79
|
|
|
80
80
|
## API Reference
|
|
81
81
|
|
|
82
|
-
### `
|
|
82
|
+
### `witness(page, testInfo, name?, config?)`
|
|
83
83
|
|
|
84
84
|
Capture a visual snapshot of the current page.
|
|
85
85
|
|
|
86
86
|
```typescript
|
|
87
|
-
import {
|
|
87
|
+
import { witness } from '@testivai/witness-playwright';
|
|
88
88
|
|
|
89
89
|
// Basic usage
|
|
90
|
-
await
|
|
90
|
+
await witness(page, testInfo, 'my-snapshot');
|
|
91
91
|
|
|
92
92
|
// With per-snapshot overrides
|
|
93
|
-
await
|
|
93
|
+
await witness(page, testInfo, 'checkout-page', {
|
|
94
94
|
ignoreSelectors: ['.live-chat', '[data-testid=clock]'], // hidden for this capture
|
|
95
95
|
stabilize: false, // opt out of animation-freeze + font-wait for this snapshot
|
|
96
96
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.testivai = exports.snapshot = void 0;
|
|
3
|
+
exports.testivai = exports.witness = exports.snapshot = void 0;
|
|
4
4
|
const snapshot_1 = require("./snapshot");
|
|
5
5
|
Object.defineProperty(exports, "snapshot", { enumerable: true, get: function () { return snapshot_1.snapshot; } });
|
|
6
|
+
Object.defineProperty(exports, "witness", { enumerable: true, get: function () { return snapshot_1.snapshot; } });
|
|
6
7
|
const ci_1 = require("./ci");
|
|
7
8
|
exports.testivai = {
|
|
8
9
|
witness: snapshot_1.snapshot,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testivai/witness-playwright",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Playwright sensor for Testivai Visual Regression Test system",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"fs-extra": "^11.3.5",
|
|
48
48
|
"sharp": "^0.34.5",
|
|
49
49
|
"simple-git": "^3.21.0",
|
|
50
|
-
"@testivai/
|
|
51
|
-
"@testivai/
|
|
50
|
+
"@testivai/common": "0.2.2",
|
|
51
|
+
"@testivai/witness": "1.11.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@playwright/test": "^1.60.0",
|