cucumber-js icon indicating copy to clipboard operation
cucumber-js copied to clipboard

Test browser apps in-process with Electron

Open mattwynne opened this issue 2 years ago • 7 comments

Is your feature request related to a problem? Please describe.

The https://cucumber/cucumber-electron project has prototyped and proven the concept of integration cucumber-js with electron to run lightning-fast acceptance tests against browser apps. It's very cool.

A discussion about finding a better name for that project to help it find a bigger audience ended in the conclusion that it would be better to fold that behaviour into the main cucumber-js project as an additional capability.

Describe the solution you'd like This is to be decided. Perhaps an --electron switch that spins up the Electron wrapper?

mattwynne avatar Sep 24 '21 01:09 mattwynne

Two thoughts:

  • I'd say "electron" is an implementation detail and thus not a great name. What about --interactive or --ui or something?
  • We might consider making this an optional plugin so we don't add more dependencies by default (esp. Electron which must be chunky).

davidjgoss avatar Sep 24 '21 08:09 davidjgoss

Two thoughts:

  • I'd say "electron" is an implementation detail and thus not a great name. What about --interactive or --ui or something?

:+1:

  • We might consider making this an optional plugin so we don't add more dependencies by default (esp. Electron which must be chunky).

I think that was the idea, yes. Having dependencies related to that feature as peer dependencies.

aurelien-reeves avatar Sep 24 '21 08:09 aurelien-reeves

Peer dependencies I’m not sure about - since npm 7 by default it throws if peer dependencies are missing. There’s no way of specifying “optional peers” unfortunately. But we could do some good messaging to the user at runtime if the plugin is missing.

davidjgoss avatar Sep 24 '21 09:09 davidjgoss

Keep in mind that Cucumber-Electron currently uses --interactive to decide whether or not to run in headless mode.

I suggest:

  • --interactive run inside Electron and show the UI (unless the --headless option is used)
  • --headless Don't show the Electron UI. Throw an error if --interactive isn't also specified.

aslakhellesoy avatar Sep 24 '21 15:09 aslakhellesoy

@aslakhellesoy could you still use --interactive to watch regular node scenarios run even if they weren't creating DOM elements?

mattwynne avatar Sep 27 '21 16:09 mattwynne

@mattwynne I think you mentioned there was an initiative around this internally - do you still think it should be a part of Cucumber itself?

davidjgoss avatar Nov 24 '22 17:11 davidjgoss

Yeah, I do. I'm not sure what will happen internally but for me this functionality would be a great addition to cucumber-js, provided we can architect it in a way that doesn't bloat / complicate the codebase.

mattwynne avatar Nov 24 '22 21:11 mattwynne