-
Notifications
You must be signed in to change notification settings - Fork 214
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
Page objects #25
Comments
Yeah, |
Finally got the page objects to work! I came across this project on my learning journey. Thought i would share my findings :) The Idea is to have the elements of the page in different file so you can re-use it and if the element changes then we only have to fix at one spot and it'll fix for rest of your tests. Test case - Go to the site, Assert Main Logo is working, Add a test user and Log out. There will be Two files - tests.js (tests) & utils.js(elements) Notice the correlation In utils the function - In test the function to call - Hopefully this helps.. Thanks @nelsonic and team for a great project and helping others. |
@rchovatiya88 this is a great addition! would you mind sending us a Pull Request adding this to the tutorial? you've been invited to be a Collaborator on the repository we'd ❤️ to include your learnings! thanks! 🎉 |
how to run the pageobjects tests from Pom folder?. Thanks. |
@purnimashanti Try adding the path of where the file is form first line - like 'require(../pom/utils' |
Page objects allow the user to create custom selectors and sequences of selenium commands for a particular page on the site. This allows us to keep the tests dry while keeping the namespacing the commands/selectors to a particular page.
This feature is quickly becomes useful as the size of the tests grows.
http://nightwatchjs.org/guide#page-objects
happy to write this up with examples and make a pull
The text was updated successfully, but these errors were encountered: