Stop pinning cli_real_flows assertion to live page text
Some checks failed
Build Debian package / build (amd64) (push) Has been cancelled
Build Debian package / build (arm64) (push) Has been cancelled
Build Docker image / buildx (push) Has been cancelled
Run linters / lint (push) Has been cancelled
Build Pip package / build (push) Has been cancelled
Release State / release-state (push) Has been cancelled
Run tests / python_tests (ubuntu-22.04, 3.13) (push) Has been cancelled
Run tests / docker_tests (push) Has been cancelled
Build Debian package / test (amd64, ubuntu-24.04) (push) Has been cancelled
Build Debian package / test (arm64, ubuntu-24.04-arm) (push) Has been cancelled
Build Debian package / release (push) Has been cancelled

pirate.github.io/stress-tests/challenge.html is a live URL whose
contents can be edited at any time. The previous assertion required
the exact title text "Browser-use Challenge for AI Browser Drivers"
to appear in the wget output, which broke as soon as the page title
was renamed (e.g. to "Browser Agent Challenge…").

Instead, verify the URL was fetched into its own wget snapshot directory
with non-trivial HTML content. That still covers the actual invariant
(wget archived the URL successfully) without coupling the test to
page-content drift on an external site.
This commit is contained in:
Claude 2026-05-22 17:34:34 +00:00
parent 19be823378
commit 055b7f09c7
No known key found for this signature in database

View File

@ -180,7 +180,13 @@ def test_cli_add_real_urls_with_options_writes_inspectable_outputs(tmp_path, pro
combined_html = "\n".join(path.read_text(errors="ignore") for path in html_outputs)
assert "Example Domain" in combined_html
assert "Browser-use Challenge for AI Browser Drivers" in combined_html
# Don't pin to exact page text — pirate.github.io/stress-tests/challenge.html
# can be edited at any time. Verify the URL was fetched into its own wget
# snapshot with non-trivial HTML content instead.
challenge_html_files = [p for p in html_outputs if "pirate.github.io" in str(p)]
assert challenge_html_files, f"No wget html output for challenge.html in {[str(p) for p in html_outputs]}"
assert any(p.stat().st_size > 1024 for p in challenge_html_files), \
f"challenge.html wget output is empty/trivial: {[(str(p), p.stat().st_size) for p in challenge_html_files]}"
assert processes
assert any("wget" in (pwd or "") or "wget" in (cmd or "") for _type, _status, _exit, pwd, cmd in processes)