Skip to content

fix(web): honour the settle timeout, pin Chrome, keep the session on the app tab - #4

Merged
RuudBurger merged 8 commits into
mainfrom
ruud/web-ignore-blank-window-switch
Aug 26, 2026
Merged

RuudBurger merged 8 commits into
mainfrom
ruud/web-ignore-blank-window-switch

Conversation

@RuudBurger

@RuudBurger RuudBurger commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Four web-driver fixes, all from trying to run our Lightning suite locally and then working out why CI is so slow. Lightning renders to a canvas, which is where most of these bite.

Settle timeout was ignored, and is now tunable

Both web drivers took timeoutMs in waitForAppToSettle and threw it away, so a waitToSettleTimeoutMs in a flow did nothing on web. They pass it through now. On top of that, pressKey and inputText have no per-command knob and always settle, so there's a MAESTRO_WAIT_TO_SETTLE_TIMEOUT_MS env override for the default. This matters on a canvas app: the hierarchy keeps changing while a focus animation runs, so the settle polls all 10 times and every key press pays for it. Measured on our search flow, per key press: p90 4.18s -> 1.91s, mean 1.77s -> 1.16s, 53s -> 35s of press time over 30 presses. The median doesn't move (0.9s, one key plus one hierarchy fetch), it's the tail that goes. On CI, where the box is slower, one inputText of 25 characters was taking 115s.

Chrome binary can be pinned

MAESTRO_CHROME_BINARY sets the browser binary. Current Chrome hands the app a 1x1 window under chromedriver, which collapses all the geometry and makes every flow fail in a way that looks like an app bug. Pinning Chrome for Testing is the workaround.

Blank windows no longer steal the session

detectWindowChange switched to a newly opened blank window (data:, / about:) and left the session pointing at nothing, and resolveTarget would fall back to a blank target. Both now ignore blank windows and stay on the app tab.

Lookup timeouts are tunable

MAESTRO_LOOKUP_TIMEOUT_MS and MAESTRO_OPTIONAL_LOOKUP_TIMEOUT_MS. Every false when: condition blocks for the full 7s optional timeout, which adds up fast in flows that probe for screens that may not be there. Defaults unchanged.

All four default to current behaviour, so nothing changes unless you set the env var. We need a release before our CI sees any of it, since it installs releases/latest.

@RuudBurger
RuudBurger force-pushed the ruud/web-ignore-blank-window-switch branch from fb42425 to 5adf217 Compare August 26, 2026 13:33
The empty data-testid case pinned the pre-reorder chain, where data-testid
was the last candidate and so returned '' rather than falling through.

The close-fallback test needs every pool worker parked, but idle workers left
over from its 37 connects hold slots until an offer pairs with them, so a read
submit could be rejected and the pool never reached saturation on CI.
The CLI reports CLI_VERSION.PLEX_BUILD, but the check compared against
CLI_VERSION alone and so failed on every OS.
The vega_demo_app flows were untagged for exclusion and not platform-gated, so
the Android and iOS suites ran them and failed on a package they cannot install.
resolveTarget picked whatever /json listed first, which on current Chrome is the
omnibox popup: an 830x1 browser_ui target. Every bound derived from it collapsed,
so taps landed nowhere and deviceInfo reported a 1px-high screen.

Also fixes the IIFE in scrollToPoint, which was a syntax error and returned null
on the only path that reaches it.
The fixture page renames the element to iframe-echo-output; id selectors match
the whole string, so echo-output no longer resolves.
roku_demo_app landed with the same gap vega_demo_app had, so the Android and
iOS suites ran Roku flows against a device that cannot install them.

maestro -v now prints an update banner on stderr, which the CLI check folds
into the captured output; MAESTRO_DISABLE_UPDATE_CHECK keeps it deterministic.
@RuudBurger
RuudBurger merged commit 62d41d2 into main Aug 26, 2026
30 of 31 checks passed
DouweBos pushed a commit that referenced this pull request Aug 26, 2026
DouweBos pushed a commit that referenced this pull request Oct 9, 2026
DouweBos pushed a commit that referenced this pull request Oct 9, 2026
DouweBos pushed a commit that referenced this pull request Oct 9, 2026
DouweBos pushed a commit that referenced this pull request Oct 9, 2026
DouweBos pushed a commit that referenced this pull request Oct 9, 2026
DouweBos pushed a commit that referenced this pull request Oct 9, 2026
DouweBos pushed a commit that referenced this pull request Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants