cucumber / cucumber-electron

Run cucumber.js in electron
MIT License
118 stars 22 forks source link

Selenium Webdriver URL navigation example #7

Closed schoettler closed 6 years ago

schoettler commented 7 years ago

Perhaps the first question that comes to mind to anyone, is it possible to add an example on how to run and navigate through an Electron app using cucumber-electron?

EDIT: Basically I expected to manually run chromedriver adding the Electron binary as options with Selenium Webdriver, but it seems like that World logic is running on the renderer process, because none of these methods are available

joshski commented 7 years ago

As it stands, cucumber-electron runs cucumber-js in an electron renderer process. It's designed for testing web apps with client-side JavaScript (single page and client-server web apps), not for driving electron apps. That's probably not very clear! Although you could use it to drive electron apps at the moment, there would be no advantage over using cucumber-js.

schoettler commented 7 years ago

Thanks for the clarification @joshski. Would be nice to have an example on how the lib should be used, with in-app navigation examples. I'm working to get this done on an app using react-router-redux.

schoettler commented 7 years ago

Hey @joshski any news? At least how is it possible to access UI components and navigate through clicks/gestures with cucumber-electron?

joshski commented 7 years ago

I see, sorry, you want an example of driving a web app like you might with selenium-webdriver. That makes a lot of sense :)

There is nothing here yet but I will add some examples soon.

In the meantime I made this example of using browser-monkey (which does selenium style navigation) against a hyperdom app (which is roughly equivalent to react) here: https://github.com/joshski/cucumbers-on-vine-hill - hopefully this is enough to give you an idea of how to get started.

schoettler commented 7 years ago

Thanks!

I'll give Browser Monkey a shot in Electron

joshski commented 6 years ago

Closing this because cucumber-electron is not really designed for testing electron apps, and it’s unlikely to include any support for it.