googleDemoTest.js 561 B

12345678910111213141516171819202122
  1. /**
  2. * Sample automated test scenario for Nightwatch.js
  3. *
  4. * > it navigates to google.com and searches for nightwatch,
  5. * verifying if the term 'The Night Watch' exists in the search results
  6. */
  7. module.exports = {
  8. 'demo test google' : function (client) {
  9. client
  10. .url('http://google.com')
  11. .waitForElementPresent('body', 1000);
  12. },
  13. 'part two' : function(client) {
  14. client
  15. .setValue('input[type=text]', ['nightwatch', client.Keys.ENTER])
  16. .pause(1000)
  17. .assert.containsText('#main', 'Night Watch')
  18. .end();
  19. }
  20. };