-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Current behavior
I am trying to use Chrome Dev Protocol (CDP) to connect to the spawned Chrome Instance via $(npm bin)/cypress open. The overall aim, is to run the built in chrome V8 profiler to get the code coverage for all the files.
To find the port, I've added the following to plugins/index:
on("before:browser:launch", (browser, launchOptions) => {
console.log(launchOptions.args);
});
Which returns the following:
...
'--disable-web-security',
'--allow-running-insecure-content',
'--proxy-bypass-list=<-loopback>',
'--remote-debugging-port=64739', <-- This changes each time
'--remote-debugging-address=127.0.0.1',
'--remote-debugging-pipe',
...
However, when I try and connect to the spawned CDP (either by opening http://127.0.0.1:64739) or even just running the Port Scan utility on Mac OSX Catalina, I'm unable to see CDP running, and unable to connect.
Interestingly, adding the following to my test script shows the console message, so I presume that Chrome Devtools Protocol is available, just not accessible outside of Cypress.
Cypress.automation("remote:debugger:protocol", {
command: "Runtime.evaluate",
params: {
expression: "console.log('hello world 2');",
},
});
Desired behavior
Able to connnect to Cypress's spawned Chrome instance via CDP.
Test code to reproduce
(Any basic cypress install, with the above changes in plugins/index
Versions
Cypress: 6.3.0
Node: (12.18.3)
Chrome: Version 88.0.4324.96 (Official Build) (x86_64)
Mac: MacOSX Catalina 10.15.1