@testmuai/playwright-bindings 0.1.10-beta.2 → 0.1.11-beta.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.
- package/dist/healPatch.d.ts.map +1 -1
- package/dist/healPatch.js +18 -4
- package/dist/healPatch.js.map +1 -1
- package/package.json +1 -1
package/dist/healPatch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"healPatch.d.ts","sourceRoot":"","sources":["../src/healPatch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"healPatch.d.ts","sourceRoot":"","sources":["../src/healPatch.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAgB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAiFrD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,IAAI,GAAG,IAAI,CAUvD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAU3D"}
|
package/dist/healPatch.js
CHANGED
|
@@ -9,6 +9,15 @@ const HEAL_METHODS = [
|
|
|
9
9
|
const COORD_METHODS = new Set(['click', 'dblclick', 'hover']);
|
|
10
10
|
const originals = new Map();
|
|
11
11
|
let installed = false;
|
|
12
|
+
/**
|
|
13
|
+
* A Playwright strict-mode violation is a plain Error whose message names the
|
|
14
|
+
* condition — Playwright doesn't expose a dedicated error class for it, so we
|
|
15
|
+
* match on the message.
|
|
16
|
+
*/
|
|
17
|
+
function isStrictModeViolation(err) {
|
|
18
|
+
return (typeof err?.message === 'string' &&
|
|
19
|
+
err.message.toLowerCase().includes('strict mode violation'));
|
|
20
|
+
}
|
|
12
21
|
function wrap(name, original) {
|
|
13
22
|
return async function wrapped(...args) {
|
|
14
23
|
const stepInfo = currentStep();
|
|
@@ -20,10 +29,15 @@ function wrap(name, original) {
|
|
|
20
29
|
}
|
|
21
30
|
catch (e) {
|
|
22
31
|
const err = e;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
const strict = isStrictModeViolation(err);
|
|
33
|
+
// Heal on a timeout where the element is absent (count === 0), or a
|
|
34
|
+
// strict-mode violation where the selector matched >1 element (count > 0
|
|
35
|
+
// is expected, so skip the absence check). Both gated to coord-healable
|
|
36
|
+
// methods. The count() probe only runs on the timeout branch — the OR
|
|
37
|
+
// short-circuits for strict mode so we don't pay for it.
|
|
38
|
+
if (COORD_METHODS.has(name) &&
|
|
39
|
+
(strict || (err?.name === 'TimeoutError' && (await this.count()) === 0))) {
|
|
40
|
+
// Element absent or ambiguous — try vision-coordinate heal.
|
|
27
41
|
// getVisionCoordinates may throw (Python 13d9f6b: no silent fallback
|
|
28
42
|
// when smart is ON); on any vision failure, re-throw the original
|
|
29
43
|
// TimeoutError so the test surfaces the real problem.
|
package/dist/healPatch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"healPatch.js","sourceRoot":"","sources":["../src/healPatch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"healPatch.js","sourceRoot":"","sources":["../src/healPatch.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAC5C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc;IAC3C,eAAe,EAAE,wBAAwB,EAAE,OAAO,EAAE,KAAK;CACjD,CAAC;AAEX,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAE9D,MAAM,SAAS,GAAG,IAAI,GAAG,EAAmB,C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