@riddledc/riddle-proof 0.7.104 → 0.7.106
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 -1
- package/dist/{chunk-F7T5FIXO.js → chunk-7JB3XKEE.js} +15 -3
- package/dist/cli.cjs +15 -3
- package/dist/cli.js +1 -1
- package/dist/index.cjs +15 -3
- package/dist/index.js +1 -1
- package/dist/profile.cjs +15 -3
- package/dist/profile.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -306,7 +306,12 @@ Use setup assertions when the pre-click or pre-navigation state is part of the c
|
|
|
306
306
|
for example a fresh row must be present, stale copy must be absent, exactly one
|
|
307
307
|
source link must exist before clicking into the final route, or a canvas app's
|
|
308
308
|
proof state must expose a terminal flag. `assert_selector_count` accepts
|
|
309
|
-
`expected_count`; `
|
|
309
|
+
`expected_count`; `assert_text_visible` and `assert_text_absent` prefer rendered
|
|
310
|
+
selector text (`innerText`) so casing from CSS `text-transform` matches
|
|
311
|
+
`selector_text_visible`, with a `textContent` fallback for non-HTML elements.
|
|
312
|
+
Literal setup text matching also checks a whitespace-normalized form, so visible
|
|
313
|
+
phrases split across rendered line breaks can still satisfy the assertion.
|
|
314
|
+
`assert_window_value` accepts `path` / `state_path` plus
|
|
310
315
|
`expected_value` / `expected` and compares JSON-safe values exactly.
|
|
311
316
|
`assert_window_number` accepts `path` / `state_path` plus `expected_value`,
|
|
312
317
|
`min_value`, or `max_value`, and is useful for canvas-only proof state such as
|
|
@@ -3583,11 +3583,21 @@ function setupFiniteNumber(value) {
|
|
|
3583
3583
|
const number = Number(value);
|
|
3584
3584
|
return Number.isFinite(number) ? number : undefined;
|
|
3585
3585
|
}
|
|
3586
|
+
function normalizeSetupMatchText(value) {
|
|
3587
|
+
return String(value || "").replace(/\s+/g, " ").trim();
|
|
3588
|
+
}
|
|
3586
3589
|
function setupTextMatches(sample, action) {
|
|
3590
|
+
const rawSample = String(sample || "");
|
|
3587
3591
|
if (action.pattern) {
|
|
3588
|
-
try {
|
|
3592
|
+
try {
|
|
3593
|
+
const rawPattern = new RegExp(action.pattern, action.flags || "");
|
|
3594
|
+
if (rawPattern.test(rawSample)) return true;
|
|
3595
|
+
return new RegExp(action.pattern, action.flags || "").test(normalizeSetupMatchText(rawSample));
|
|
3596
|
+
} catch { return false; }
|
|
3589
3597
|
}
|
|
3590
|
-
|
|
3598
|
+
const expected = String(action.text || "");
|
|
3599
|
+
return rawSample.includes(expected)
|
|
3600
|
+
|| normalizeSetupMatchText(rawSample).includes(normalizeSetupMatchText(expected));
|
|
3591
3601
|
}
|
|
3592
3602
|
async function waitForAnyVisibleSelector(context, selector, timeout) {
|
|
3593
3603
|
const deadline = Date.now() + setupNumber(timeout, 15000);
|
|
@@ -3732,7 +3742,9 @@ async function setupActionScope(action, timeout) {
|
|
|
3732
3742
|
return { ok: true, context: frame, frame_selector: frameSelector, frame_index: frameIndex, frame_count: frameCount };
|
|
3733
3743
|
}
|
|
3734
3744
|
async function setupLocatorText(locator, index) {
|
|
3735
|
-
|
|
3745
|
+
const target = locator.nth(index);
|
|
3746
|
+
return await target.innerText({ timeout: 1000 })
|
|
3747
|
+
.catch(async () => await target.textContent({ timeout: 1000 }).catch(() => ""));
|
|
3736
3748
|
}
|
|
3737
3749
|
function compactSetupResultText(value) {
|
|
3738
3750
|
const text = String(value || "").replace(/\s+/g, " ").trim();
|
package/dist/cli.cjs
CHANGED
|
@@ -10460,11 +10460,21 @@ function setupFiniteNumber(value) {
|
|
|
10460
10460
|
const number = Number(value);
|
|
10461
10461
|
return Number.isFinite(number) ? number : undefined;
|
|
10462
10462
|
}
|
|
10463
|
+
function normalizeSetupMatchText(value) {
|
|
10464
|
+
return String(value || "").replace(/\s+/g, " ").trim();
|
|
10465
|
+
}
|
|
10463
10466
|
function setupTextMatches(sample, action) {
|
|
10467
|
+
const rawSample = String(sample || "");
|
|
10464
10468
|
if (action.pattern) {
|
|
10465
|
-
try {
|
|
10469
|
+
try {
|
|
10470
|
+
const rawPattern = new RegExp(action.pattern, action.flags || "");
|
|
10471
|
+
if (rawPattern.test(rawSample)) return true;
|
|
10472
|
+
return new RegExp(action.pattern, action.flags || "").test(normalizeSetupMatchText(rawSample));
|
|
10473
|
+
} catch { return false; }
|
|
10466
10474
|
}
|
|
10467
|
-
|
|
10475
|
+
const expected = String(action.text || "");
|
|
10476
|
+
return rawSample.includes(expected)
|
|
10477
|
+
|| normalizeSetupMatchText(rawSample).includes(normalizeSetupMatchText(expected));
|
|
10468
10478
|
}
|
|
10469
10479
|
async function waitForAnyVisibleSelector(context, selector, timeout) {
|
|
10470
10480
|
const deadline = Date.now() + setupNumber(timeout, 15000);
|
|
@@ -10609,7 +10619,9 @@ async function setupActionScope(action, timeout) {
|
|
|
10609
10619
|
return { ok: true, context: frame, frame_selector: frameSelector, frame_index: frameIndex, frame_count: frameCount };
|
|
10610
10620
|
}
|
|
10611
10621
|
async function setupLocatorText(locator, index) {
|
|
10612
|
-
|
|
10622
|
+
const target = locator.nth(index);
|
|
10623
|
+
return await target.innerText({ timeout: 1000 })
|
|
10624
|
+
.catch(async () => await target.textContent({ timeout: 1000 }).catch(() => ""));
|
|
10613
10625
|
}
|
|
10614
10626
|
function compactSetupResultText(value) {
|
|
10615
10627
|
const text = String(value || "").replace(/\s+/g, " ").trim();
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -12312,11 +12312,21 @@ function setupFiniteNumber(value) {
|
|
|
12312
12312
|
const number = Number(value);
|
|
12313
12313
|
return Number.isFinite(number) ? number : undefined;
|
|
12314
12314
|
}
|
|
12315
|
+
function normalizeSetupMatchText(value) {
|
|
12316
|
+
return String(value || "").replace(/\s+/g, " ").trim();
|
|
12317
|
+
}
|
|
12315
12318
|
function setupTextMatches(sample, action) {
|
|
12319
|
+
const rawSample = String(sample || "");
|
|
12316
12320
|
if (action.pattern) {
|
|
12317
|
-
try {
|
|
12321
|
+
try {
|
|
12322
|
+
const rawPattern = new RegExp(action.pattern, action.flags || "");
|
|
12323
|
+
if (rawPattern.test(rawSample)) return true;
|
|
12324
|
+
return new RegExp(action.pattern, action.flags || "").test(normalizeSetupMatchText(rawSample));
|
|
12325
|
+
} catch { return false; }
|
|
12318
12326
|
}
|
|
12319
|
-
|
|
12327
|
+
const expected = String(action.text || "");
|
|
12328
|
+
return rawSample.includes(expected)
|
|
12329
|
+
|| normalizeSetupMatchText(rawSample).includes(normalizeSetupMatchText(expected));
|
|
12320
12330
|
}
|
|
12321
12331
|
async function waitForAnyVisibleSelector(context, selector, timeout) {
|
|
12322
12332
|
const deadline = Date.now() + setupNumber(timeout, 15000);
|
|
@@ -12461,7 +12471,9 @@ async function setupActionScope(action, timeout) {
|
|
|
12461
12471
|
return { ok: true, context: frame, frame_selector: frameSelector, frame_index: frameIndex, frame_count: frameCount };
|
|
12462
12472
|
}
|
|
12463
12473
|
async function setupLocatorText(locator, index) {
|
|
12464
|
-
|
|
12474
|
+
const target = locator.nth(index);
|
|
12475
|
+
return await target.innerText({ timeout: 1000 })
|
|
12476
|
+
.catch(async () => await target.textContent({ timeout: 1000 }).catch(() => ""));
|
|
12465
12477
|
}
|
|
12466
12478
|
function compactSetupResultText(value) {
|
|
12467
12479
|
const text = String(value || "").replace(/\s+/g, " ").trim();
|
package/dist/index.js
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
resolveRiddleProofProfileTimeoutSec,
|
|
59
59
|
slugifyRiddleProofProfileName,
|
|
60
60
|
summarizeRiddleProofProfileResult
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-7JB3XKEE.js";
|
|
62
62
|
import {
|
|
63
63
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
64
64
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -3626,11 +3626,21 @@ function setupFiniteNumber(value) {
|
|
|
3626
3626
|
const number = Number(value);
|
|
3627
3627
|
return Number.isFinite(number) ? number : undefined;
|
|
3628
3628
|
}
|
|
3629
|
+
function normalizeSetupMatchText(value) {
|
|
3630
|
+
return String(value || "").replace(/\s+/g, " ").trim();
|
|
3631
|
+
}
|
|
3629
3632
|
function setupTextMatches(sample, action) {
|
|
3633
|
+
const rawSample = String(sample || "");
|
|
3630
3634
|
if (action.pattern) {
|
|
3631
|
-
try {
|
|
3635
|
+
try {
|
|
3636
|
+
const rawPattern = new RegExp(action.pattern, action.flags || "");
|
|
3637
|
+
if (rawPattern.test(rawSample)) return true;
|
|
3638
|
+
return new RegExp(action.pattern, action.flags || "").test(normalizeSetupMatchText(rawSample));
|
|
3639
|
+
} catch { return false; }
|
|
3632
3640
|
}
|
|
3633
|
-
|
|
3641
|
+
const expected = String(action.text || "");
|
|
3642
|
+
return rawSample.includes(expected)
|
|
3643
|
+
|| normalizeSetupMatchText(rawSample).includes(normalizeSetupMatchText(expected));
|
|
3634
3644
|
}
|
|
3635
3645
|
async function waitForAnyVisibleSelector(context, selector, timeout) {
|
|
3636
3646
|
const deadline = Date.now() + setupNumber(timeout, 15000);
|
|
@@ -3775,7 +3785,9 @@ async function setupActionScope(action, timeout) {
|
|
|
3775
3785
|
return { ok: true, context: frame, frame_selector: frameSelector, frame_index: frameIndex, frame_count: frameCount };
|
|
3776
3786
|
}
|
|
3777
3787
|
async function setupLocatorText(locator, index) {
|
|
3778
|
-
|
|
3788
|
+
const target = locator.nth(index);
|
|
3789
|
+
return await target.innerText({ timeout: 1000 })
|
|
3790
|
+
.catch(async () => await target.textContent({ timeout: 1000 }).catch(() => ""));
|
|
3779
3791
|
}
|
|
3780
3792
|
function compactSetupResultText(value) {
|
|
3781
3793
|
const text = String(value || "").replace(/\s+/g, " ").trim();
|
package/dist/profile.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveRiddleProofProfileTimeoutSec,
|
|
20
20
|
slugifyRiddleProofProfileName,
|
|
21
21
|
summarizeRiddleProofProfileResult
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7JB3XKEE.js";
|
|
23
23
|
export {
|
|
24
24
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
25
25
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|