From b792f22f2c2ef4dfb7bd300e7381a186e34e0c18 Mon Sep 17 00:00:00 2001 From: Tianren Dong Date: Sat, 16 May 2026 14:01:00 -0400 Subject: 0.15.25: fix reload after stale singleton --- test-suite/challenges/39-strict-csp-fallback.html | 14 +++++++ test-suite/challenges/39-strict-csp-fallback.js | 27 +++++++++++++ .../challenges/40-dynamic-wait-readiness.html | 41 ++++++++++++++++++++ test-suite/challenges/41-tab-lifecycle.html | 44 ++++++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 test-suite/challenges/39-strict-csp-fallback.html create mode 100644 test-suite/challenges/39-strict-csp-fallback.js create mode 100644 test-suite/challenges/40-dynamic-wait-readiness.html create mode 100644 test-suite/challenges/41-tab-lifecycle.html (limited to 'test-suite/challenges') diff --git a/test-suite/challenges/39-strict-csp-fallback.html b/test-suite/challenges/39-strict-csp-fallback.html new file mode 100644 index 0000000..93bd9cf --- /dev/null +++ b/test-suite/challenges/39-strict-csp-fallback.html @@ -0,0 +1,14 @@ + + + +39 strict CSP fallback + + + +
+

Goal: page blocks unsafe-eval. Agent should fall back to screenshot/coordinate observation and click the target without relying on snapshot/evaluate.

+

The green target is fixed at known viewport coordinates. Use a screenshot, then click inside it.

+ +
+ + diff --git a/test-suite/challenges/39-strict-csp-fallback.js b/test-suite/challenges/39-strict-csp-fallback.js new file mode 100644 index 0000000..4f2d91e --- /dev/null +++ b/test-suite/challenges/39-strict-csp-fallback.js @@ -0,0 +1,27 @@ +Challenge.init({ id: "strict-csp-fallback", instructions: "use screenshot/coordinates; click CSP TARGET" }); + +const btn = document.getElementById("cspTarget"); +btn.style.cssText = [ + "position:fixed", + "left:220px", + "top:220px", + "width:180px", + "height:72px", + "font:700 16px system-ui", + "background:#1f7a1f", + "color:white", + "border:0", + "border-radius:10px", + "box-shadow:0 0 0 4px rgba(31,122,31,.25)" +].join(";"); + +document.getElementById("cspTarget").addEventListener("click", (e) => { + const r = btn.getBoundingClientRect(); + const bad = []; + if (!e.isTrusted) bad.push("click isTrusted=false"); + if (e.clientX < r.left || e.clientX > r.right || e.clientY < r.top || e.clientY > r.bottom) { + bad.push(`click coordinates ${e.clientX},${e.clientY} outside target rect ${Math.round(r.left)},${Math.round(r.top)},${Math.round(r.right)},${Math.round(r.bottom)}`); + } + if (bad.length) Challenge.fail(...bad); + else Challenge.pass("strict CSP page completed via trusted viewport click"); +}); diff --git a/test-suite/challenges/40-dynamic-wait-readiness.html b/test-suite/challenges/40-dynamic-wait-readiness.html new file mode 100644 index 0000000..adf006d --- /dev/null +++ b/test-suite/challenges/40-dynamic-wait-readiness.html @@ -0,0 +1,41 @@ + + +40 dynamic wait readiness + + + +
+

Goal: wait until an async control exists and is enabled, then click it. Direct early clicks or fixed sleeps should not be required.

+
Loading async action…
+
+
+ + diff --git a/test-suite/challenges/41-tab-lifecycle.html b/test-suite/challenges/41-tab-lifecycle.html new file mode 100644 index 0000000..2ba002d --- /dev/null +++ b/test-suite/challenges/41-tab-lifecycle.html @@ -0,0 +1,44 @@ + + +41 tab lifecycle + + + +
+

Goal: create a new tab, inspect it, close it, return to parent, then verify lifecycle state.

+

+ +
+ + -- cgit v1.2.3