- Install NodeJS LTS Version.
- Any IDE for example VSCode.
- Install/Update Chrome Browser to latest stable version.
- Go to the Root folder
- Install JS dependencies -
npm install
- From the command line -
npm run test
├───output
├───helpers
├───src
├───elements
├───pages
├───specs
├───.spec.js
helpers - directory with additional helpers that extends base API.
specs - folder with tests.
src - folder contains our Page Object/Page Fragments and elements wrappers.
- Name of the file with PageObjects should be talkable, so it is clear what's inside. Pattern of the file name [componentName].[page/fragment].js.
- All the selectors/locators are stored in the PageObjects. Locator should have comment where it is situated on the page, and what it is.
- Locator priority: Id, CSS, XPath.
- Repeatable steps in the tests write in the PageObjects as a method.
Name of the test should be talkable, so one can define what test about. Follow next pattern [acceptance | E2E | integration].[name].spec.js
Name Scenario - use case or story with acceptance criteria in the name. Follow the rule - When->Then.
Example: Unauthorised user goes to the welcome page. The user should be redirected to login page and see the login form to authorize
- All the selectors should be located inside the pageObjects
- All the timeouts should be located inside the pageObjects
- All tests you implement should be easy to customize.
WaitUntil should be used most of the time, cause sometimes chromium can move forward without loading whole page.
- WebDriverIO - Useful to learn how it works
- MochaJS - Useful to learn additional commands for our test runner
- Chai - assertion library. Extends the NodeJS's assert.