Skip to content

fix: older browsers support in time travel and assertView#1281

Merged
shadowusr merged 9 commits into
masterfrom
users/shadowusr/INFRADUTY-30361
Jun 22, 2026
Merged

fix: older browsers support in time travel and assertView#1281
shadowusr merged 9 commits into
masterfrom
users/shadowusr/INFRADUTY-30361

Conversation

@shadowusr

@shadowusr shadowusr commented Jun 21, 2026

Copy link
Copy Markdown
Member

What's done?

All these changes tested on Chrome 53

  • assertView now works.
  • rrweb can't be run on chrome 53 (rrweb bundle has newer syntax), so this lack of support is handled gracefully
  • fixed duplicate session close by unsubscribing from signalHandler events
  • fixed incorrect rollback logic when safeArea size changes mid-capture after first chunk
  • made selectors settle waiting compatible with older browsers (tested on chrome 67)

Not tested on internet explorer, because it turns out it was broken a long time ago:

return assign({}, capabilities, { "wdio:enforceWebDriverClassic": true });
. In this chunk of code, we assign custom capability, which makes the IE throw on session creation. So I've kept this as-is.

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

✅ Testplane browser-env run succeed

Report

@pkg-pr-new

pkg-pr-new Bot commented Jun 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/gemini-testing/testplane@1281

commit: 0c95c4b

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

✅ Testplane E2E run succeed

Report

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f540130eef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread src/browser/history/rrweb.ts

let debugBrowserId = "";
if (debug.enabled) {
debugBrowserId = `${(browser as WdioBrowser)?.capabilities?.browserName} ${

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

этого точно хватит для id? у нас же может быть 2 браузера одинаковой версии, но с разными капабилити (desktp/touch)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added sessionId

// @ts-expect-error
return Boolean(window.rrweb);
} catch {
} catch (e) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The catch {} syntax became available from chrome 66, while we are targeting chrome 53: https://caniuse.com/wf-optional-catch-binding

}

if (bundlesCache[scriptFilePath]) {
debug(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would we need to know it?
This debug log does not seem to be usefull

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually is very useful, for example it highlights which version of the script — native or compat was chosen, which instantly makes it clear if calibration works as expected, etc.

Comment thread src/browser/client-bridge/index.ts
Comment thread src/browser/history/rrweb.ts Outdated
let result = await collectRrwebEvents(session, shouldSendRrwebCode ? rrwebCode : undefined);

if (result.isRrwebSupported === false) {
debug("rrweb is not supported in this browser, error: %s", result.evalError);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this browser

Maybe we should specify, what browser are we talking about? Like name and version

Comment on lines +89 to +90
const colorSchemeMedia = rrwebData && rrwebData.colorSchemeMedia;
const colorSchemeListener = rrwebData && rrwebData.colorSchemeListener;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the difference?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional chaining is supported from chrome 80: https://caniuse.com/mdn-javascript_operators_optional_chaining

While we are targeting much earlier versions.

function collectRrwebEvents(
session: WebdriverIO.Browser,
rrwebRecordFnCode: string | null,
rrwebRecordFnCode: string | undefined,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: -> rrwebRecordFnCode?: string

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it's actually important here.

The story is that in older versions, argument is expected to be string or undefined precisely (with null it throws an error). However, we don't mean that "argument can be omitted". We mean precisely that it must be passed, but can be either string or undefined.

@shadowusr shadowusr merged commit c74e2ff into master Jun 22, 2026
9 checks passed
@shadowusr shadowusr deleted the users/shadowusr/INFRADUTY-30361 branch June 22, 2026 00:45
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.

3 participants