Debug existing chrome window

I'm using `testcafe` to run tests, which opens a new Chrome instance when starting.  

I'm using IntelliJ JavaScript debugging to debug my client app, which opens a new Chrome tab when starting.

So the question is, how can I debug the client app started by testcafe?

Is there a way to connect the IntelliJ debugger to an existing chrome window instead of opening a new one?

Or some other trick....

0
1 comment

If the Chrome instance is started with --remote-debugging-port option, you can use Attach to Node.js/Chrome run configuration to attach a debugger to it. But I'm not sure if this can be used with testcafe...

You can run/debug your tests using the run configuration provided by testcafe plugin - just right-click the test in editor and choose Debug:

Note that you can use VS Code recipes to debug TestCafe in WebStorm. Namely, you need Node.js Run configuration like the following:

 

where JavaScript file: is set to a path to your locally installed testcafe module, e.g. node_modules\testcafe\bin\testcafe.js, and Application parameters: are testcafe cli args, like chrome myTestFile.js

0

Please sign in to leave a comment.