fix(selectivity): stabilize navigation coverage - #1311
Conversation
commit: |
✅ Testplane E2E run succeed
|
✅ Testplane browser-env run succeed
|
There was a problem hiding this comment.
Clicks need to be intercepted and queued, because chromedriver itself does not wait for navigation to complete, and we need to.
Order:
startClick()
WebDriver originalClick()
beforeunload / coverage snapshot
Debugger.resume
navigation commit
DOMContentLoaded или load
page-start coverage flush
click() returns the value
There was a problem hiding this comment.
Pulled out existing cdp hooks from index.ts to here
There was a problem hiding this comment.
State machine module, that stores navigation state of the browser
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
1f0b41a to
bf1f1bb
Compare
| export const enableClickCommandGuard = (browser: WebdriverIO.Browser, guard: ClickCommandGuard): (() => void) => { | ||
| activeGuards.set(browser, guard); | ||
|
|
||
| if (!guardedBrowsers.has(browser)) { |
There was a problem hiding this comment.
I would write like this:
const cb = () => {
if (activeGuards.get(browser) === guard) {
guard.cancelClick();
activeGuards.delete(browser);
}
};
if (guardedBrowsers.has(browser)) {
return cb;
}
// a lot of code
return cb;
will allow to reduce the nesting a little bit
| const guardedBrowsers = new WeakSet<WebdriverIO.Browser>(); | ||
|
|
||
| /** | ||
| * Install one persistent click wrapper because WebdriverIO commands cannot be restored after overwriteCommand. |
There was a problem hiding this comment.
Are you sure that install is correct word here? in fact, nothing is installed here.
There was a problem hiding this comment.
The click wrapper is installed
Given how hard to undo the "overwriteCommand" effect, it pretty much looks like installation.
e.g. hooks are installed too.
Load missing stale script sources by URL so sourceMappingURL dependencies survive navigation.
4c16f95 to
78b2377
Compare
No description provided.