@syngrisi/playwright-sdk 3.1.7 → 3.2.1

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.
Files changed (2) hide show
  1. package/README.md +17 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -154,6 +154,23 @@ await driver.check({
154
154
  });
155
155
  ```
156
156
 
157
+ ### Tolerance Threshold
158
+
159
+ Tolerance allows checks with small visual differences to pass instead of failing. Set `toleranceThreshold` (0-100%) to define the maximum acceptable mismatch percentage.
160
+
161
+ **Per-check** (overrides baseline setting for this check only):
162
+ ```js
163
+ await driver.check({
164
+ checkName: 'Header',
165
+ imageBuffer: screenshot,
166
+ params: {
167
+ toleranceThreshold: 0.5 // Allow up to 0.5% pixel difference
168
+ }
169
+ });
170
+ ```
171
+
172
+ Tolerance can also be configured on the baseline via the Syngrisi UI or API (`PUT /v1/baselines/{id}`). Per-check tolerance always takes priority over baseline tolerance.
173
+
157
174
  ### 4. Stop the Test Session
158
175
 
159
176
  Once all checks are completed, stop the test session.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syngrisi/playwright-sdk",
3
- "version": "3.1.7",
3
+ "version": "3.2.1",
4
4
  "description": "Syngrisi Playwright SDK",
5
5
  "main": "dist/PlaywrightDriver.js",
6
6
  "directories": {
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@faker-js/faker": "^10.1.0",
41
41
  "@playwright/test": "^1.57.0",
42
- "@syngrisi/core-api": "^3.1.7",
42
+ "@syngrisi/core-api": "^3.2.1",
43
43
  "loglevel": "^1.9.2",
44
44
  "ua-parser-js": "^1.0.41",
45
45
  "zod": "^4.1.13"
@@ -61,5 +61,5 @@
61
61
  "typescript": "^5.9.3",
62
62
  "vitest": "^4.0.15"
63
63
  },
64
- "gitHead": "c1ab213f09448a9e08c461a16583285ebb13511c"
64
+ "gitHead": "a8d3aa06c372795a252c2788060d7bbd8d86dc76"
65
65
  }