vendredi 4 septembre 2015

JavaScript/Nightwatch.js - Undefined is not a function

I am trying to write at test case in java script.

Code:

'should verify login dropdown is not visible after clicking away': function (browser) { var welcome = browser.page.welcome(); welcome.navigate() .waitForElementVisible('@loginButton', 5000) welcome.click('@loginButton') welcome.expect.element('@logoutButton').text.to.equal('Logout').after(500) welcome.click('@usersButton') welcome.element('@logoutButton').to.not.be.present },

For the last line I am getting an error like below. No idea why to.not.be.present is not recognized while it's described in NightWatch documentation. Any advice from anyone ?

TypeError: undefined is not a function at Object.module.exports.should verify login dropdown is not visible after clicking away (/Users/http://ift.tt/1NQBZFY) at Module.call (/Users/http://ift.tt/1VBa4LO) at /Users/http://ift.tt/1NQBZG4 at _fulfilled (/Users/http://ift.tt/1VBa524) at self.promiseDispatch.done (/Users/http://ift.tt/1NQBWKq) at Promise.promise.promiseDispatch (/Users/http://ift.tt/1VBa526) at /Users/http://ift.tt/1NQBZG8 at runSingle (/Users/http://ift.tt/1VBa2n8) at flush (/Users/http://ift.tt/1NQBZGa) at process._tickCallback (node.js:355:11)

Aucun commentaire:

Enregistrer un commentaire