cucumber-js
cucumber-js copied to clipboard
Test browser apps in-process with Electron
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?
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).
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.
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.
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 could you still use --interactive
to watch regular node scenarios run even if they weren't creating DOM elements?
@mattwynne I think you mentioned there was an initiative around this internally - do you still think it should be a part of Cucumber itself?
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.