claude-proxy / e2e /form_support.py
dheraingoud's picture
Copilot App
Sync upstream v6.19.35 and preserve custom addons
a9e27c0
Raw History Blame Contribute Delete
590 Bytes
"""Browser contracts for FCC's advisory autofill opt-outs."""
def assert_autofill_opt_out(page):
failures = page.locator(
'form, textarea, input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])'
).evaluate_all("""nodes => nodes.flatMap(node => {
const valid = node.autocomplete === 'off' && node.hasAttribute('data-1p-ignore') &&
node.hasAttribute('data-bwignore') && node.getAttribute('data-form-type') === 'other';
return valid ? [] : [{id: node.id, tag: node.tagName, type: node.type}];
})""")
assert failures == [], failures