-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Connect to Chrome Remote Interface when launching Chrome and record video #4628
Conversation
The order of launching the browser and visiting the site should be (for example for recording video)
|
Trying locally against
or for just a run
|
problematic tests (driver integration)
example build https://circleci.com/gh/cypress-io/cypress/135766 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I would like to see us use a dynamic port for the
--remote-debugging-port
CLI flag and not a hard coded constant. This will conflict if any other automation tools are already using it. There are NPM packages out there already (or you can use the built in node http server) to figure out an open port. The easiest way is to spawn an HTTP server without passing port (it will pick an open one by default) - capture that and then close the HTTP server.
Question:
Is there a reason why we're using the abstractions around the Page.*
objects? I would prefer we use the lower level client.send('Domain.method', ...)
because that maps directly to the actual RDP documentation - and it's much clearer how the implementation is actually working.
If perhaps the abstraction provides a certain level of gain or backwards compatibility that would be compelling but I'd like to understand what it's doing under the hood first before adopting that pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- increase
_getDelayMsForRetry
to 5000ms - add a test in
run_spec.coffee
verifying that the right error is thrown when it cannot be connected to - create a nice error message for the user so they understand what happened and why we threw
Added all of this, but instead of adding a test in run_spec, I opted to add an e2e test instead that strips the |
about:blank
, grab the RDI object, then connect to the real url so we have connection (for future logging and video frames) from the very beginningpass the websocket url as a config value to the browser(see note below)ffmpeg
video encoding fails for any reason, for example if the browser has sent no frames and there is zero length file to encode, we silently ignore the error, and the user has no idea why there is no video. We should show a warning on non-exit ffmpeg exit code and show STDERRdecision: do not store the references for this PR, it will be decided later when using them
client.send("command name", ...)
format.More information
If you need to execute a command via this interface, see CRI API
DEBUG=cy-verbose:server:browsers:cri-client
namespace (starts withcy-verbose
to avoid floodingDEBUG=cypress*
namespace)