This session was taken at vodQA Shots held in Pune.
Details include :
- quick understanding of Nightwatch.js
- writing tests with PageObject model using nightwatch
- how to run tests against specific browsers/environments in parallel
3. Why Nightwatch?
â—Ź Quick setup and easy to write
â—Ź Uses css or xpath as selectors
â—Ź Built-in support for POM
â—Ź Built-in test runner
â—Ź Saucelabs + browserstack support
â—Ź Custom commands + custom assertions possible
â—Ź Can also be used to write Node.js Unit tests
3
15. CSS Selectors - tips and tricks
â—Ź Class name ends with:
â—‹ a[href$="/wordpress.com/"]
â—Ź Class name starts with:
â—‹ a[href^="/wordpress.com/"]
â—Ź Class name contains:
â—‹ a[href*="/wordpress.com/"]
â—Ź Child:
â—‹ Direct child: div > a
â—‹ child/subchild: div a
â—Ź Next adjacent element of same parent:
â—‹ input.username + input (choses input field after username)
â—Ź Third li element in list:
â—‹ ul#list li:nth-of-type(3)