Fallseite bei gescheitertem Scan und Schnappschuss bei untypischen Elementen

This commit is contained in:
Rsclub2_2 committed 2026-11-15 03:23:22 +01:00
1 parent 95a23c0e45
commit 89538ed67c
6 files changed
+34 -3

No files matched your search

+2
View File
@@ -37,6 +37,8 @@ PAGES = {
"<form><input type='password' name='pw'><button>Abmelden</button></form>",
"/frame-password": "<p>Abmelden</p><iframe src='/pwframe'></iframe><button>Abmelden bestätigen</button>",
"/pwframe": "<form><input type='text' name='u'><input type='password' name='pw'></form>",
# a button that carries type=radio has no "checked" property of its own
"/odd-type": "<p>Bitte bestätigen</p><button type='radio'>Abmelden bestätigen</button>",
# overrides Array.prototype.push, which the snapshot script uses, to plant a prompt marker in an element number
"/tamper-push": "<p>Bitte bestätigen</p><button>Abmelden bestätigen</button><script>"
"const push = Array.prototype.push; Array.prototype.push = function (...items) {"
+7
View File
@@ -221,6 +221,13 @@ def test_embedded_private_content_is_blocked_but_the_page_still_works(browser, s
assert "http://192.168.8.111/pixel.gif" in refused # the embedded request was made and refused
def test_non_input_element_with_checkbox_type_is_not_a_page_error(browser, site):
llm = Script('{"action":"done","result":"unclear","reason":"seen"}')
r = run(browser, site, "/odd-type", llm)
assert r["reason"] != "page_error" and len(llm.prompts) == 1
assert '[1] button' in llm.prompts[0] and 'Abmelden bestätigen"' in llm.prompts[0] # offered as an element
def test_page_that_tampers_with_the_snapshot_ends_as_page_error_without_the_model(browser, site):
llm = Script()
r = run(browser, site, "/tamper-push", llm)