[meta] Support Cypress
Categories
(Remote Protocol :: Agent, task)
Tracking
(Not tracked)
People
(Reporter: ato, Unassigned)
References
(Depends on 2 open bugs, )
Details
(Keywords: meta)
Tracking bug for Cypress related issues with Firefox.
Reporter | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Does Cypress really depend on Puppeteer or does it make direct use of the Chrome dev-tools protocol? I only see references to CDP when checking the repository, but nothing about Puppeteer.
Comment 2•5 years ago
|
||
As James seconded on IRC it is using CDP directly.
Comment 3•5 years ago
|
||
Current commands in use seem to be:
Methods:
- Browser.getVersion (supported)
- Page.bringToFront (supported)
- Page.captureScreenshot (supported - clip option soon via bug 1587845)
- Page.navigate (supported but there are issues with early returning - see bug 1603776)
- Page.startScreencast (not supported)
Events:
- Page.screencastFrame (not supported)
Reporter | ||
Comment 4•5 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #2)
As James seconded on IRC it is using CDP directly.
Not only that, Cypress uses CDP through chrome-remote-interface, which we are fortunate enough to use for our browser-chrome testing! 👏🏻
Comment 5•5 years ago
|
||
Cypress also uses some Network.* commands to manage cookies: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/browsers/cdp_automation.ts
- Network.setCookie bug 1588114
- Network.deleteCookies bug 1549453
- Network.getAllCookies - there does not seem to be an open bug for this
- Network.getCookies bug 1549458
Comment 6•5 years ago
|
||
It also uses Emulation.setDeviceMetricsOverride
to provide a consistent viewport size in some of the tests:
Comment 7•5 years ago
|
||
(In reply to Zach Bloomquist from comment #5)
- Network.getAllCookies - there does not seem to be an open bug for this
Is that a new feature? I wonder why it isn't listed under https://chromedevtools.github.io/devtools-protocol/tot/Network. Maybe they missed to add it?
Comment 8•5 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #7)
(In reply to Zach Bloomquist from comment #5)
- Network.getAllCookies - there does not seem to be an open bug for this
Is that a new feature? I wonder why it isn't listed under https://chromedevtools.github.io/devtools-protocol/tot/Network. Maybe they missed to add it?
What version of the API are you looking at? I see it in the docs for 1.3 and latest
: https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getAllCookies
Reporter | ||
Comment 9•5 years ago
|
||
Network.getAllCookies
is a new feature as of 13th December of this year, introduced by 9349e8fc
.
I made a similar comments with some more details on the review for bug 1590098 implementing Network.getCookies
yesterday.
Comment 10•5 years ago
|
||
(In reply to Andreas Tolfsen 「:ato」 from comment #9)
Network.getAllCookies
is a new feature as of 13th December of this year, introduced by9349e8fc
.
Hmm, that commit seems to say Tue Dec 13 17:12:37 2016, not Tue Dec 13 17:12:37 2019. I am not sure what exact release it was introduced in Chrome, but we've been using it in Cypress for at least a few months with no complaints from users (users use their Chrome version of choice)
Reporter | ||
Comment 11•5 years ago
|
||
Oops, years are apparently easy to misread (-:
Comment 12•5 years ago
|
||
Zach, which specific features of Emulation.setDeviceMetricsOverride
is in use by Cypress? Could you check if the current Firefox Nightly build contains everything with bug 1544417 fixed? Thanks
Comment 13•5 years ago
|
||
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #12)
Zach, which specific features of
Emulation.setDeviceMetricsOverride
is in use by Cypress? Could you check if the current Firefox Nightly build contains everything with bug 1544417 fixed? Thanks
It's used in 1 place, in Cypress's tests, here is how it's invoked:
Cypress uses width
, height
, deviceScaleFactor
, mobile
, screenWidth
, and screenHeight
. It looks like the first three of those are implemented, and the last two (screenHeight
and screenWidth
) actually seem to be redundant, so we don't need those for now.
mobile
isn't implemented in FF yet, but we set it to false
anyways, so that's fine too. Interestingly though, if I omit mobile
from the arguments, Chrome responds with an error:
received CDP message { error: { code: -32602, message: 'Invalid parameters', data: 'mobile: boolean value expected' }, id: 6 } +12ms
Comment 14•5 years ago
|
||
Yes, it's not raising an error because we don't have the mobile
support yet. It will be added with bug 1608468.
Updated•2 years ago
|
Description
•