Repository navigation
Conversation
…p timing, role waits Found while running the testomat.io e2e suite on Obscura. CDPBrowser (Obscura, Lightpanda, Chrome over CDP): - visibility: an inline or display:contents element with no box of its own (e.g. <a> wrapping a block card) is visible when a child is. Obscura reports no client rects for such inline elements. - synthetic click fires pointerdown/mousedown/focus/pointerup/mouseup before click, so widgets that react to mousedown/mouseup (ember power-select, Radix) work. - synthetic click on a non-interactive wrapper lands on the control at its center (elementFromPoint), like a coordinate click would. - traffic is recorded once the response finished loading (matching Playwright's requestfinished), and redirect hops are recorded. Playwright: waitFor* with role locators used [role="..."] css, ignoring native roles and the accessible name; build an internal:role selector. Core: HelperStep end time is taken when the async helper call settles, so step durations are no longer ~0ms. aiTrace: when a Before hook fails, only the running test writes the trace, instead of every test in the suite overwriting it. globalTimeout: ignore hook.finished for a suite hook that never fired hook.started (TypeError on __prevSuiteTimeout.slice). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ages Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Motivation/Description of the PR
Found while running a real e2e suite (testomat.io, an Ember + Rails app, ~45 smoke tests) on the Obscura helper. Each fix has a test that fails before and passes after.
CDPBrowser (Obscura, Lightpanda, Chrome over CDP)
<a href><div class="card">…</div></a>. Chrome gives it the box of its content.seeElement/waitForVisiblenow treat aninlineordisplay: contentselement with an empty box as visible when one of its children is visible. Playwright handlesdisplay: contentsthe same way.clickwithinput: 'synthetic'called onlyel.click(). It now firespointerdown → mousedown → focus → pointerup → mouseup → click, with no pointer events for disabled controls. ember-power-select opens onmousedownand selects onmouseup, and Radix widgets react to pointer events. Before this change none of them could be driven.<li><button>New suite</button></li>dispatched on thelionly, and the button's handler never ran. When the target is a non-interactive element, the click now goes todocument.elementFromPoint(centre), raised to the nearest interactive ancestor inside the target, which is what a coordinate click lands on. Interactive targets (a,button,input,label, ARIA button/option/tab…) are unchanged, and the click never leaves the located element. This changes behaviour for every CDPBrowser user (event.targetcan now be a descendant), so it may be worth putting behind an option. I kept it always on because it matches what a real click does.this.requestsonrequestWillBeSent, soseeTrafficpassed before the server had answered, andgrabRecordedNetworkTrafficscould hang on a request that never completes. They are now added onNetwork.loadingFinished, like Playwright'srequestfinished. Redirect hops (redirectResponse) are recorded as well. Obscura follows redirects inside the engine and reports only the final request, so the redirect test lives in the Chrome CDP suite.Playwright
waitFor*ignored role locators.buildLocatorString()returned[role="button"]for{ role: 'button', text: 'Create' }, so native<button>elements and the accessible name were ignored bywaitForVisible/waitForElement/waitForInvisible. It now buildsinternal:role=button[name="Create"i](swhenexact: true). That's the selectorpage.getByRole()itself produces; I checked it againstgetByRole(...)._selectorin Playwright 1.63. It's a Playwright-internal engine. The alternative, routing role locators throughgetByRole()in every wait method, is a larger refactor.Core
HelperStep.run()setendTimeright after calling the helper method, before the returned promise settled. It now also setsendTimewhen the promise settles, without replacing the promise. aiTrace showedduration: 0.00son every step because of this.Plugins / listeners
Before. CodeceptJS reportstest.failedfor every test in the suite, so the last test that never ran overwrote the running test'strace.md. Only the running test (currentTest) writes the trace now.TypeError: Cannot read properties of undefined (reading 'slice')onhook.finished, for a suite hook that never firedhook.started. Fixed defensively: the listener ignores the unmatchedfinishedand clears the saved values after restoring them. Root cause not traced:fireHookclassifies the hook fromsuite.ctx.testwhen it is fired, andfinishedruns later from the recorder, by which point that can point at a different hook.Results
CDPBrowser_obscura_test.js: 264 passing, 0 failing.CDPBrowser_lightpanda_test.jsandCDPBrowser_chrome_test.js: 3 failing each, the#selectOption - radiogroups › baseuitests. They fail the same way onorigin/4.x, so there are no new failures.Applicable helpers:
Applicable plugins:
Type of change
Checklist:
npx eslinton changed files)🤖 Generated with Claude Code