Repository navigation
fix(e2e): the monkey offers only controls the harness can act on - #532
Merged
Merged
Conversation
The `monkey` job failed on main (run 45998601602, commit b2fa929, job 140504200689): `click locator([data-monkey-id="2"]): element is not enabled (still failing after 2000 ms)` at step 327 of `MONKEY_SEED=248447929`, on /settings/ai. The same commit passed the day before: the seed is random, the failure is not. `AISettingsPage` wraps the whole form in `aria-disabled="true"` (and `pointer-events-none`) while AI is off, which is the default. The harness refuses to click inside it (`enabled()` in `lib/inpage.ts` walks the ancestors), but the monkey's `collect()` only looked at the control's own state, so it picked the `Custom / OpenAI-compatible` provider button and the catch rethrew because the element still existed. Any walk that reaches that page can hit it. `collect()` now applies the same ancestor rule (`aria-disabled`, disabled `fieldset`) to links, buttons and inputs, and an action that finds its control disabled or gone is logged and skipped. The new test `offers only controls the harness can act on` fails on the old code and passes now; `MONKEY_SEED=248447929 MONKEY_STEPS=400 bun run monkey` passes against a local server and Lightpanda 1.0.2 (4 pass, 0 fail).
Coverage
Go by area
Web by area (lines)
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
monkeyjob failed on main: workflowe2erun 45998601602 (2026-11-27, commit b2fa929), job 140504200689. The same commit passed on 2026-11-26.Root cause
click locator("[data-monkey-id=\"2\"]"): element is not enabled (still failing after 2000 ms)atmonkey.e2e.ts:297, step 327 ofMONKEY_SEED=248447929, on/settings/ai. The control is theCustom / OpenAI-compatibleprovider button.AISettingsPagewraps the form inaria-disabled="true"(andopacity-40 pointer-events-none) while AI is off, the default. The harness refuses to click inside it:enabled()inweb/e2e/lib/inpage.tswalks the ancestors foraria-disabledand a disabled<fieldset>. The monkey'scollect()checked only the control's own state, so it offered the button, and the catch rethrew whenever the element still existed.It is not a flaky page and not a product bug. A walk that reaches the AI settings page without turning AI on hits it every time; it only looks random because the seed is random.
Fix
collect()uses an ancestor-awareenabled()that mirrors the harness, for links, buttons and inputs.offers only controls the harness can act on. It fails on the old code and passes now.Checks
MONKEY_SEED=248447929 MONKEY_STEPS=400 MONKEY_MAX_SECONDS=600 bun run monkey: 4 pass, 0 fail. The local walk reached theOpen AI settingslink at step 327 and choseOpen navigationnext, so the disabled buttons were no longer candidates (the local walk is one step off from CI's).tsc -p web/e2e/tsconfig.json: clean.