New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give sections a link back to the nightwatch-cucumber api #333
Conversation
Hi @clayreimann! Thank you so much for contribution! Wow this is your first contribution! 🎉 Can you explain where the |
Thanks for the prompt response @mucsi96!
My motivation is that I have many similar components/widgets and I'd like to keep my code reasonably DRY so I'm templating what a widget looks like and then I can call this function to find that particular widget. |
Any thoughts @mucsi96? |
Sorry for log reply. I am thinking about patching the Nightwatch Section constructor as it would be more obvious for the user. I need some time to investigate that. |
@mucsi96 is there anything I can do to help keep this PR alive? I'm more than willing to prototype other ways of achieving this, the project that I'm working will be using this soon. |
@mucsi96 more ping. I think I've hit on a cleaner solution (by wrapping the native |
d454e9e
to
24f3c39
Compare
24f3c39
to
5d4878e
Compare
Hi! This looks much better. I also created a PR with similar solution. Test is included. Please check it. Can I ask you to add some documentation to it? You can find it under To run the test One problem I noticed which is not related to this session constructor. That after running the test I cannot run it again. For some reason the phantomJS process does not exit. I have checked that Nightwatch closes the WebDriver session properly. The same behaviour is with Chrome as well. Will try to investigate that. If you have time would be very helpful if you can also take a look on it. As of cucumber 4 has parallel execution out of the box I am planning to rewrite this package. And remove a lot of hacks from it. From now I want to use the Nightwatch only for browser controlling. Cucumber will be the only runner. This will simplify the code a lot. |
Fixed by #340 |
This PR allows for the dynamic creation of nightwatch
Section
s (either from commands or otherwise). Without this reference any Sections created by the user are not tied into nightwatch-cucumber's promises and runtime.Now possible: