Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust
Rust ai-agentsai-toolsbrowserbrowser-automationcloud-browserheadlessheadless-browserkitesurfplaywrightpuppeteerrustservoweb-crawlerweb-crawlingweb-scraperweb-scraping
test(ci): run complete protocol smoke suites by default
ldm03b555523ab36
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 5bae5a61a..785c0b123 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -129,21 +129,13 @@ jobs:python -m unittest discover--start-directory moli-webdriver-smoke/tests- - name: Run default CDP smoke- id: cdp_default+ - name: Run full CDP smoke+ id: cdpcontinue-on-error: trueenv:MOLI_BIN: ${{ github.workspace }}/target/release/molirun: uv run --project moli-cdp-smoke --no-sync moli-cdp-smoke- - name: Run Puppeteer CDP smoke- id: cdp_puppeteer- if: ${{ !cancelled() && steps.build_moli.outcome == 'success' }}- continue-on-error: true- env:- MOLI_BIN: ${{ github.workspace }}/target/release/moli- run: uv run --project moli-cdp-smoke --no-sync moli-cdp-smoke --group puppeteer-- name: Run full WebDriver smokeid: webdriverif: ${{ !cancelled() && steps.build_moli.outcome == 'success' }}@@ -153,23 +145,17 @@ jobs:run: >-uv run --project moli-webdriver-smoke --no-syncmoli-webdriver-smoke- --group classic,bidi,selenium,semantics,url-policy,navigation-errors--continue-on-failure- name: Require all protocol smoke suitesif: ${{ always() && !cancelled() && steps.build_moli.outcome == 'success' }}env:- CDP_DEFAULT_OUTCOME: ${{ steps.cdp_default.outcome }}- CDP_PUPPETEER_OUTCOME: ${{ steps.cdp_puppeteer.outcome }}+ CDP_OUTCOME: ${{ steps.cdp.outcome }}WEBDRIVER_OUTCOME: ${{ steps.webdriver.outcome }}run: |failed=0- if [ "$CDP_DEFAULT_OUTCOME" != success ]; then- echo "default CDP smoke: $CDP_DEFAULT_OUTCOME"- failed=1- fi- if [ "$CDP_PUPPETEER_OUTCOME" != success ]; then- echo "Puppeteer CDP smoke: $CDP_PUPPETEER_OUTCOME"+ if [ "$CDP_OUTCOME" != success ]; then+ echo "CDP smoke: $CDP_OUTCOME"failed=1fiif [ "$WEBDRIVER_OUTCOME" != success ]; thendiff --git a/moli-cdp-smoke/README.md b/moli-cdp-smoke/README.mdindex 1aafff13d..228c94e39 100644--- a/moli-cdp-smoke/README.md+++ b/moli-cdp-smoke/README.md@@ -220,7 +220,7 @@ Important gaps:- Wider network matrix: broader digest/multi-round proxy auth challenge variants, font/preload resource types, parser-discovered resource interception, and broader response-stage coverage beyond the current page/popup fetch/XHR response-stage smoke.- Storage/profile depth: cookie delete/clear/domain/path/SameSite, persistent profile writeback, storage partition boundaries, and deeper IndexedDB flows.- Worker/frame target depth: module-worker target lifecycle, nested DedicatedWorker targets, broader worker exception/debugger coverage, iframe subresource attribution, and future per-frame realm boundaries remain. DedicatedWorker now has first-layer CDP target/runtime/console/lifecycle coverage; SharedWorker has first-layer target/runtime/log/profiler and page-side reuse smoke, but both still need richer error matrices.-- Puppeteer parity: the optional group now covers the common connect/navigation/reload/same-document/evaluate/keyboard-input/DOM-selector-activation/coordinate-click/handle/current-viewport-screenshot/alert-dialog/popup-target/interception path and DedicatedWorker lifecycle, but full-page/clip screenshots, drag interception, confirm/prompt modal return semantics, and richer lifecycle waits remain.+- Puppeteer parity: the default managed-client group covers the common connect/navigation/reload/same-document/evaluate/keyboard-input/DOM-selector-activation/coordinate-click/handle/current-viewport-screenshot/alert-dialog/popup-target/interception path and DedicatedWorker lifecycle, but full-page/clip screenshots, drag interception, confirm/prompt modal return semantics, and richer lifecycle waits remain.Runner layout:@@ -287,10 +287,11 @@ npm ciuv run moli-cdp-smoke```-CI runs the complete default group selection and the pinned Puppeteer group as-separate gates. The other optional external-client groups remain explicit-integration runs because their binaries or dependency environments are not-owned by this project.+With no `--group`, the runner executes every raw, Playwright page, browser, and+repository-managed external-client group, including `inspector-routing` and the+pinned Puppeteer client. CI invokes that same unfiltered default. External-client+groups whose binaries or dependency environments are not owned by this project+remain explicit integration runs.List available scenario groups:@@ -320,8 +321,8 @@ uv run moli-cdp-smoke --group inspector-routingMOLI_SMOKE_GROUPS=protocol,websocket uv run moli-cdp-smoke```-The Inspector routing group is part of the default selection. Run one or more-named contracts while iterating with+The complete Inspector routing group runs by default. Select one or more named+contracts while iterating with`MOLI_INSPECTOR_ROUTING_SCENARIOS`:```bashdiff --git a/moli-cdp-smoke/moli_cdp_smoke/runner.py b/moli-cdp-smoke/moli_cdp_smoke/runner.pyindex e4aea6ec2..91d375e09 100644--- a/moli-cdp-smoke/moli_cdp_smoke/runner.py+++ b/moli-cdp-smoke/moli_cdp_smoke/runner.py@@ -76,7 +76,6 @@ class SmokeGroup:description: strphase: strrunner: RawGroupRunner | ExternalGroupRunner | PageGroupRunner | BrowserGroupRunner- default: bool = TrueRAW_GROUPS: tuple[SmokeGroup, ...] = (@@ -293,46 +292,50 @@ BROWSER_GROUPS: tuple[SmokeGroup, ...] = (),)-EXTERNAL_GROUPS: tuple[SmokeGroup, ...] = (+MANAGED_EXTERNAL_GROUPS: tuple[SmokeGroup, ...] = (+ SmokeGroup(+ "puppeteer",+ "Puppeteer over CDP workflows using the smoke project's pinned puppeteer-core module.",+ "external",+ run_puppeteer_group,+ ),+)+++OPTIONAL_EXTERNAL_GROUPS: tuple[SmokeGroup, ...] = (SmokeGroup("chrome-remote-interface","Optional chrome-remote-interface browser/page session goal-path workflows.","external",run_chrome_remote_interface_group,- default=False,),SmokeGroup("cdp-use","Optional cdp-use browser/page session goal-path workflows.","external",run_cdp_use_group,- default=False,),SmokeGroup("stagehand","Optional Stagehand deterministic goal-path workflows without LLM operations.","external",run_stagehand_group,- default=False,),SmokeGroup("agent-browser","Optional agent-browser CLI goal-path workflows with an isolated daemon session.","external",run_agent_browser_group,- default=False,- ),- SmokeGroup(- "puppeteer",- "Puppeteer over CDP workflows using the smoke project's pinned puppeteer-core module.",- "external",- run_puppeteer_group,- default=False,),)-ALL_GROUPS: tuple[SmokeGroup, ...] = RAW_GROUPS + EXTERNAL_GROUPS + PAGE_GROUPS + BROWSER_GROUPS-DEFAULT_GROUP_NAMES: tuple[str, ...] = tuple(group.name for group in ALL_GROUPS if group.default)++DEFAULT_GROUPS: tuple[SmokeGroup, ...] = (+ RAW_GROUPS + PAGE_GROUPS + BROWSER_GROUPS + MANAGED_EXTERNAL_GROUPS+)+ALL_GROUPS: tuple[SmokeGroup, ...] = DEFAULT_GROUPS + OPTIONAL_EXTERNAL_GROUPS+DEFAULT_GROUP_NAMES: tuple[str, ...] = tuple(group.name for group in DEFAULT_GROUPS)+DEFAULT_GROUP_NAME_SET = frozenset(DEFAULT_GROUP_NAMES)GROUPS_BY_NAME: dict[str, SmokeGroup] = {group.name: group for group in ALL_GROUPS}@@ -394,7 +397,7 @@ def group_listing() -> list[dict[str, Any]]:{"name": group.name,"phase": group.phase,- "default": group.default,+ "default": group.name in DEFAULT_GROUP_NAME_SET,"description": group.description,}for group in ALL_GROUPS@@ -503,7 +506,10 @@ def parse_args(argv: list[str] | None = None) -> argparse.Namespace:"--group",action="append",default=[],- help="Run only the named group. May be repeated or comma-separated. Defaults to all groups.",+ help=(+ "Run only the named group. May be repeated or comma-separated. "+ "Defaults to every repository-managed group."+ ),)parser.add_argument("--list-groups",diff --git a/moli-cdp-smoke/tests/test_action_window.py b/moli-cdp-smoke/tests/test_action_window.pyindex dff259ef7..c96ed7112 100644--- a/moli-cdp-smoke/tests/test_action_window.py+++ b/moli-cdp-smoke/tests/test_action_window.py@@ -13,7 +13,6 @@ class ActionWindowGroupTests(unittest.TestCase):group = GROUPS_BY_NAME["action-window"]self.assertEqual(group.phase, "raw")- self.assertTrue(group.default)self.assertIn(group.name, DEFAULT_GROUP_NAMES)diff --git a/moli-cdp-smoke/tests/test_group_selection.py b/moli-cdp-smoke/tests/test_group_selection.pynew file mode 100644index 000000000..38e05f906--- /dev/null+++ b/moli-cdp-smoke/tests/test_group_selection.py@@ -0,0 +1,69 @@+from __future__ import annotations++import os+import unittest+from unittest.mock import patch++from moli_cdp_smoke.runner import (+ ALL_GROUPS,+ DEFAULT_GROUP_NAMES,+ DEFAULT_GROUPS,+ GROUPS_BY_NAME,+ MANAGED_EXTERNAL_GROUPS,+ OPTIONAL_EXTERNAL_GROUPS,+ group_listing,+ resolve_group_selection,+)+++class GroupSelectionTests(unittest.TestCase):+ def test_default_runs_every_repository_managed_group(self) -> None:+ with patch.dict(os.environ, {"MOLI_SMOKE_GROUPS": ""}):+ selection = resolve_group_selection()++ self.assertEqual(+ tuple(group.name for group in selection.groups),+ DEFAULT_GROUP_NAMES,+ )+ self.assertEqual(DEFAULT_GROUP_NAMES, tuple(group.name for group in DEFAULT_GROUPS))+ self.assertIn("inspector-routing", DEFAULT_GROUP_NAMES)+ self.assertIn("puppeteer", DEFAULT_GROUP_NAMES)+ self.assertEqual(+ tuple(group.name for group in MANAGED_EXTERNAL_GROUPS),+ ("puppeteer",),+ )++ def test_only_external_environment_groups_remain_opt_in(self) -> None:+ optional_names = tuple(group.name for group in OPTIONAL_EXTERNAL_GROUPS)++ self.assertEqual(+ optional_names,+ ("chrome-remote-interface", "cdp-use", "stagehand", "agent-browser"),+ )+ self.assertTrue(set(optional_names).isdisjoint(DEFAULT_GROUP_NAMES))++ def test_registry_and_listing_mark_exact_default_set(self) -> None:+ self.assertEqual(len(ALL_GROUPS), len(GROUPS_BY_NAME))+ listed_defaults = tuple(+ group["name"] for group in group_listing() if group["default"]+ )++ self.assertEqual(listed_defaults, DEFAULT_GROUP_NAMES)++ def test_explicit_cli_and_environment_selection_stay_focused(self) -> None:+ explicit = resolve_group_selection(["protocol,puppeteer", "protocol"])+ self.assertEqual(+ tuple(group.name for group in explicit.groups),+ ("protocol", "puppeteer"),+ )++ with patch.dict(os.environ, {"MOLI_SMOKE_GROUPS": "action-window,core"}):+ from_environment = resolve_group_selection()+ self.assertEqual(+ tuple(group.name for group in from_environment.groups),+ ("action-window", "core"),+ )+++if __name__ == "__main__":+ unittest.main()diff --git a/moli-webdriver-smoke/README.md b/moli-webdriver-smoke/README.mdindex 139cca161..a99bb130e 100644--- a/moli-webdriver-smoke/README.md+++ b/moli-webdriver-smoke/README.md@@ -5,23 +5,23 @@ This is a standalone WebDriver smoke project for moli. It is a peer of`moli serve`, and exercises the public WebDriver wire surface from outsidethe Rust test harness.-The default group uses raw WebDriver Classic HTTP. The optional BiDi group uses-raw WebSocket messages. The optional Selenium group uses Selenium Python's-`webdriver.Remote` client against the same `moli serve` endpoint, so this-project now covers both protocol-level wire shape and a real Selenium client-workflow.+The default suite runs every Moli group: raw WebDriver Classic HTTP, raw BiDi+WebSocket messages, Selenium Python's `webdriver.Remote` client, cross-engine+semantics and navigation contracts, Moli's URL policy, and renderer-IO script+interruption. This covers both protocol-level wire shape and real Selenium+client workflows without requiring a group allowlist.-The optional `semantics` group contains isolated cross-engine contracts. It can+The `semantics` group contains isolated cross-engine contracts. It canrun against Moli's native WebDriver endpoint or an external ChromeDriver;Moli uses standard W3C capabilities without Chrome vendor options.-The optional `url-policy` group is a Moli hosted-product contract. It+The `url-policy` group is a Moli hosted-product contract. Ituses isolated Classic and BiDi sessions to verify the exact local-filenavigation error envelopes, unchanged browsing contexts, and absence of BiDinavigation lifecycle events. It is deliberately skipped for desktop Chromium,whose browser-granted local-file capability is a different product policy.-The optional `navigation-errors` group is a cross-engine Chromium/WPT contract.+The `navigation-errors` group is a cross-engine Chromium/WPT contract.It runs the same 37-case public-wire matrix against Moli or ChromeDriver:ten Classic malformed-body/URL cases, 22 BiDi invalid-argument cases, twomissing-context cases, and three real address failures. It also checks the W3C@@ -29,12 +29,12 @@ HTTP and BiDi error envelopes, unchanged Classic URL, and post-failure sessionliveness. The baseline was executed on 2026-08-09 with Debian Chromium145.0.7632.116 and matching ChromeDriver 145.0.7632.117.-The script-timeout boundary has two deliberately separate optional groups:+The script-timeout boundary has two deliberately separate groups:- `script-timeout-chromium` is the ChromeDriver 147 oracle. A yielding asyncscript times out near its deadline, while a bounded non-yielding loop firstreturns to the renderer and only then produces `script timeout`.-- `script-interrupt` is Moli's renderer-IO extension. It runs actual infinite+- `script-interrupt` is a default Moli group for the renderer-IO extension. It runs actual infiniteloops through both Classic sync and async execution, requires timeout-driven`Runtime.terminateExecution` near the configured deadline, and repeatsrecovery work in the same window after every termination.@@ -139,13 +139,15 @@ uv syncuv run moli-webdriver-smoke```-CI explicitly runs all six groups with `--continue-on-failure`:+With no `--group`, both local and CI runs execute all seven Moli groups:```text-classic,bidi,selenium,semantics,url-policy,navigation-errors+classic,bidi,selenium,semantics,url-policy,navigation-errors,script-interrupt```-The local default remains the smaller Classic-only loop for focused development.+CI adds `--continue-on-failure` so one failing group does not hide later smoke+results. The ChromeDriver-only `script-timeout-chromium` oracle remains an+explicit external-target run.List available groups:@@ -170,7 +172,6 @@ Collect all subgroup failures in one diagnostic run:```bashuv run moli-webdriver-smoke \- --group classic,bidi,selenium,semantics,url-policy,navigation-errors \--continue-on-failure```diff --git a/moli-webdriver-smoke/moli_webdriver_smoke/runner.py b/moli-webdriver-smoke/moli_webdriver_smoke/runner.pyindex d32aaaf53..9391ec99a 100644--- a/moli-webdriver-smoke/moli_webdriver_smoke/runner.py+++ b/moli-webdriver-smoke/moli_webdriver_smoke/runner.py@@ -46,7 +46,6 @@ class SmokeGroup:name: strdescription: strrunner: GroupRunner- default: bool = Trueasync def _run_classic_group(@@ -77,7 +76,7 @@ async def _run_bidi_group()-ALL_GROUPS: tuple[SmokeGroup, ...] = (+MOLI_GROUPS: tuple[SmokeGroup, ...] = (SmokeGroup("classic","Raw WebDriver Classic HTTP session, navigation, element, script, alert, shadow, cookie, and window state flows.",@@ -87,46 +86,46 @@ ALL_GROUPS: tuple[SmokeGroup, ...] = ("bidi","Raw WebDriver BiDi WebSocket session, browsingContext lifecycle, input actions, element origins, file uploads, network data, user contexts, emulation, explicit screenshot unsupported errors, and storage.",_run_bidi_group,- default=False,),SmokeGroup("selenium","Selenium Python Remote WebDriver session, BiDi facade, navigation, elements, forms/files/actions, explicit screenshot/print unsupported errors, cookies, windows, frame switching, script arguments, shadow roots, and dialogs.",run_selenium_group,- default=False,),SmokeGroup("semantics","Isolated cross-engine WebDriver contracts for capabilities, history, storage, frames, dialogs, and W3C errors.",run_semantics_group,- default=False,),SmokeGroup("url-policy","Hosted file-navigation rejection with exact Classic/BiDi errors, unchanged contexts, and no BiDi lifecycle events.",run_url_policy_group,- default=False,),SmokeGroup("navigation-errors","Chromium/WPT Classic and BiDi navigation argument, missing-context, address-error, envelope, and post-failure liveness matrix.",run_navigation_errors_group,- default=False,- ),- SmokeGroup(- "script-timeout-chromium",- "ChromeDriver Classic script-timeout yield boundary and repeated same-window recovery oracle.",- run_chromedriver_script_timeout_group,- default=False,),SmokeGroup("script-interrupt","Moli Classic script timeout preemption of non-yielding sync/async JavaScript through renderer IO, with repeated same-window recovery.",run_moli_script_interrupt_group,- default=False,),)-DEFAULT_GROUP_NAMES: tuple[str, ...] = tuple(group.name for group in ALL_GROUPS if group.default)++CHROMEDRIVER_ORACLE_GROUPS: tuple[SmokeGroup, ...] = (+ SmokeGroup(+ "script-timeout-chromium",+ "ChromeDriver Classic script-timeout yield boundary and repeated same-window recovery oracle.",+ run_chromedriver_script_timeout_group,+ ),+)++DEFAULT_GROUPS: tuple[SmokeGroup, ...] = MOLI_GROUPS+ALL_GROUPS: tuple[SmokeGroup, ...] = DEFAULT_GROUPS + CHROMEDRIVER_ORACLE_GROUPS+DEFAULT_GROUP_NAMES: tuple[str, ...] = tuple(group.name for group in DEFAULT_GROUPS)+DEFAULT_GROUP_NAME_SET = frozenset(DEFAULT_GROUP_NAMES)GROUPS_BY_NAME: dict[str, SmokeGroup] = {group.name: group for group in ALL_GROUPS}@@ -160,7 +159,7 @@ def group_listing() -> list[dict[str, Any]]:return [{"name": group.name,- "default": group.default,+ "default": group.name in DEFAULT_GROUP_NAME_SET,"description": group.description,}for group in ALL_GROUPS@@ -173,7 +172,10 @@ def parse_args(argv: list[str] | None = None) -> argparse.Namespace:"--group",action="append",default=[],- help="Run only the named group. May be repeated or comma-separated. Defaults to the Classic group.",+ help=(+ "Run only the named group. May be repeated or comma-separated. "+ "Defaults to every Moli group."+ ),)parser.add_argument("--list-groups",diff --git a/moli-webdriver-smoke/tests/test_group_selection.py b/moli-webdriver-smoke/tests/test_group_selection.pynew file mode 100644index 000000000..1a9ec9cc7--- /dev/null+++ b/moli-webdriver-smoke/tests/test_group_selection.py@@ -0,0 +1,67 @@+from __future__ import annotations++import os+import unittest+from unittest.mock import patch++from moli_webdriver_smoke.runner import (+ ALL_GROUPS,+ CHROMEDRIVER_ORACLE_GROUPS,+ DEFAULT_GROUP_NAMES,+ DEFAULT_GROUPS,+ GROUPS_BY_NAME,+ MOLI_GROUPS,+ group_listing,+ resolve_group_selection,+)+++class GroupSelectionTests(unittest.TestCase):+ def test_default_runs_every_moli_group(self) -> None:+ with patch.dict(os.environ, {"MOLI_WEBDRIVER_SMOKE_GROUPS": ""}):+ selection = resolve_group_selection()++ self.assertEqual(+ tuple(group.name for group in selection),+ DEFAULT_GROUP_NAMES,+ )+ self.assertEqual(DEFAULT_GROUPS, MOLI_GROUPS)+ self.assertIn("classic", DEFAULT_GROUP_NAMES)+ self.assertIn("bidi", DEFAULT_GROUP_NAMES)+ self.assertIn("selenium", DEFAULT_GROUP_NAMES)+ self.assertIn("script-interrupt", DEFAULT_GROUP_NAMES)++ def test_only_chromedriver_oracle_remains_opt_in(self) -> None:+ oracle_names = tuple(group.name for group in CHROMEDRIVER_ORACLE_GROUPS)++ self.assertEqual(oracle_names, ("script-timeout-chromium",))+ self.assertTrue(set(oracle_names).isdisjoint(DEFAULT_GROUP_NAMES))++ def test_registry_and_listing_mark_exact_default_set(self) -> None:+ self.assertEqual(len(ALL_GROUPS), len(GROUPS_BY_NAME))+ listed_defaults = tuple(+ group["name"] for group in group_listing() if group["default"]+ )++ self.assertEqual(listed_defaults, DEFAULT_GROUP_NAMES)++ def test_explicit_cli_and_environment_selection_stay_focused(self) -> None:+ explicit = resolve_group_selection(["bidi,selenium", "bidi"])+ self.assertEqual(+ tuple(group.name for group in explicit),+ ("bidi", "selenium"),+ )++ with patch.dict(+ os.environ,+ {"MOLI_WEBDRIVER_SMOKE_GROUPS": "classic,script-interrupt"},+ ):+ from_environment = resolve_group_selection()+ self.assertEqual(+ tuple(group.name for group in from_environment),+ ("classic", "script-interrupt"),+ )+++if __name__ == "__main__":+ unittest.main()