Description
Cypress has spent a few weeks on prepping our firefox automation to cut over from CDP to BiDi. There was some precursor work to do this, such as moving to geckodriver and webdriver in order to have access to a BiDi client on modern automation infrastructure.
Since doing this, we have spiked into cutting over to BiDi, which more details can be seen in the spike issue comment #30351 (comment).
From what I can see, there are a few blockers for us right now from moving over to BiDi from CDP. This is also being tracked on Firefox's side in https://bugzilla.mozilla.org/show_bug.cgi?id=1604723.
Priority issues for Cypress in the Bidi Context is cuirrently captured in Webdriver Bidi Roadmap Planning (Cypress Copy). The Cypress team is currently going through issues to prioritize support that we want/need. Original document is here and will hopefully merge our priorities upstream soon.
Our mapping of CDP/web extension methods to BiDi methods is currently captured in the
Cypress State of Automation document.
The below checklist is representative from the above link to roadmap planning, reflect P2 issues and under (p1 is more severe than p2)
- P1: Add Support for
resourceType
tonetwork
events. Issue tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1904892 and mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=1604723. This is critical to Cypress to support cookie management, proxy logging, proxy correlation, and thecy.intercept()
API. UPDATE: December 13th, 2024 This can now be mapped via theinitiatorType
added in Expose initiatorType and destination on network.Request w3c/webdriver-bidi#809 which removes the major blocker for us to move to BiDi. This should be available in Firefox 135. - P3: File download behavior. The W3C API has
browsingContext.downloadWillBegin
, but this doesn't look to be currently supported as a "no event exist" error is thrown. Cypress also would need something likePage.downloadComplete
in CDP to fully move this out of our web extension. It looks like this might be fulfilled in webdriver-bidi should let users know when a download is completed w3c/webdriver-bidi#427. We currently work around this in our web extension so it isn't a blocker to base adoption. - P3: Cookies onChange behavior, which is tracked to be added to BiDi in Add a "storage.cookieChanged" event w3c/webdriver-bidi#830. We currently work around this in our web extension so it isn't a blocker to base adoption.
- P3: clearing specific browser data. We accomplish this in CDP via Storage.clearDataForOrigin and Network.clearBrowserCache. This work for BiDi looks to be tracked in Add method to clear specific browsing data w3c/webdriver-bidi#798. We currently work around this in our web extension so it isn't a blocker to base adoption. storage.deleteCookies gets us partially there but not entirely.
- P2: Be able to load web extensions and access background page. This is currently supported through classic webdriver through firefox specific capabilities. We just want to make sure this is supported in the future if classic webdriver is removed, but isn't a blocker to base adoption.