Skip to content

chore: port websocket in ext to bidi #31209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: release/15.0.0
Choose a base branch
from

Conversation

AtofStryker
Copy link
Contributor

@AtofStryker AtofStryker commented Mar 3, 2025

Additional details

Cuts over the remaining methods in the web extension that are possible (currently only used by firefox) to WebDriver BiDi. This gets us about 90% off of the websocket in the webextension via this BiDi port, which also helps us when debugging the app code in the server.

This should close the epic #29714, but does not entirely get us off the web extension for socket commands as documented in #30447 (see #30221 (comment) for more details on what is still needed and why).

Steps to test

How has the user experience changed?

PR Tasks

Copy link

cypress bot commented Mar 3, 2025

cypress    Run #61610

Run Properties:  status check failed Failed #61610  •  git commit 45259dd796: Merge branch 'release/15.0.0' into chore/port_websocket_in_ext_to_bidi
Project cypress
Branch Review chore/port_websocket_in_ext_to_bidi
Run status status check failed Failed #61610
Run duration 18m 50s
Commit git commit 45259dd796: Merge branch 'release/15.0.0' into chore/port_websocket_in_ext_to_bidi
Committer Bill Glesias
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 7
Tests that did not run due to a developer annotating a test with .skip  Pending 1099
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 26580
View all changes introduced in this branch ↗︎
UI Coverage  30.2%
  Untested elements 515  
  Tested elements 219  
Accessibility  79.57%
  Failed rules  9 critical   14 serious   5 moderate   2 minor
  Failed elements 1747  

Tests for review

Failed  cypress/e2e/specs.cy.ts • 1 failed test • app-e2e

View Output

Test Artifacts
... > create template spec > displays alert with docs link on new spec Test Replay Screenshots
Flakiness  commands/waiting.cy.js • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
... > errors > throws when waiting for 2nd response to route Test Replay
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  issues/28527.cy.ts • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
issue 28527 > fails and then retries and verifies about:blank is not displayed Test Replay Screenshots
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
... > stops waiting when an xhr request is canceled
    </td>
  </tr></table>
Flakiness  commands/files.cy.js • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
src/cy/commands/files > #readFile > retries to read when ENOENT
    </td>
  </tr></table>

The first 5 flaky specs are shown, see all 7 specs in Cypress Cloud.

@AtofStryker AtofStryker force-pushed the breaking/remove_cdp_firefox branch 2 times, most recently from c7f8493 to e3bac5f Compare April 3, 2025 15:32
Base automatically changed from breaking/remove_cdp_firefox to release/15.0.0 April 3, 2025 17:42
@AtofStryker AtofStryker force-pushed the chore/port_websocket_in_ext_to_bidi branch 2 times, most recently from caa42e1 to e970a54 Compare April 8, 2025 20:19
@AtofStryker AtofStryker force-pushed the chore/port_websocket_in_ext_to_bidi branch from e970a54 to f76f89d Compare April 9, 2025 18:48
@AtofStryker AtofStryker changed the title DRAFT TO CLOSE: port websocket in ext to bidi chore: port websocket in ext to bidi Apr 9, 2025
@@ -122,287 +121,6 @@ describe('lib/socket', () => {
})
})

context('on(automation:request)', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some of these tests I wanted to keep but I can't even get them to run locally ☹️

@AtofStryker AtofStryker self-assigned this Apr 10, 2025

// CLOSE ALL BUT THE NEW CONTEXT, which makes it active
// also do not need to navigate to about:blank as this happens by default
for (const context of contexts) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: add #31480 to comments

return false
}

if (filter.path && filter.path !== cookie.path) {
if (filter?.path && !pathMatch(filter.path, cookie.path)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this a part of the migration? Or a separate improvement? Mostly just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its an improvement which we need since bidi cookie filter criteria is a bit different. What we really want is to check path hierarchy and not an exact match.

For instance, cookies going to request /foo should send cookies that have / or /foo as the path, but not /bar. If we are checking for strict equality on just path, only 1 of those 3 would be sent, which is incorrect. We don't notice this with CDP because it does this implicitly when we look up cookies

@ryanthemanuel
Copy link
Collaborator

Looks good to me. Ran some e2e/ct tests and Run all specs in firefox.

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.

misc: Replace @packages/extension methods that are now implemented by WebDriver BiDi when BiDi is enabled
4 participants