cypress-har-generator icon indicating copy to clipboard operation
cypress-har-generator copied to clipboard

Support for Electron

Open Romiko opened this issue 3 years ago • 1 comments

Hi, Please add support for Electron browser.

Thx

Romiko avatar Dec 29 '20 06:12 Romiko

Please let me know if there is anything I can do to help get this implemented!

I just found out about this plugin, and we desperately need this during our CI runs (which are on Electron).

Even though Cypress has videos and screenshots, some of our setup code fails during before hooks, and the Cypress logs don't say why. Since we are doing API calls during this phase, there's nothing shown in the video or screenshots.

It would be absolutely IDEAL for us to be able to download a HAR and debug that way, but it would have to work in Electron.

Also, it would be ideal if the record/save commands were able to work from within on('before:spec') and on('after:spec') Cypress event hooks. When I try it, it says cy is not defined. Is there a workaround way to call this without using cy?

kpittman-securus avatar Apr 13 '21 17:04 kpittman-securus

To make the plugin work with Electron, you just need to set the --remote-debugging-port switch while running Cypress tests as follows:

$ ELECTRON_EXTRA_LAUNCH_ARGS=--remote-debugging-port=9222 cypress run --browser electron

For details please refer to #151. Support for this switch has been implemented since version 5.11.0, which can be found in the release notes on our Github repository at https://github.com/NeuraLegion/cypress-har-generator/releases/tag/v5.11.0

derevnjuk avatar Jan 15 '23 15:01 derevnjuk