Search code examples
javascriptnode.jsacceptance-testingzombie.js

Check if certain string is on page


How can I check if a page contains a certain piece of text with zombie.js? Do I just check the response and see if it has the string?


Solution

  • If you don't use should you can do the following:

     assert browser.text('a:contains("Logout")')
    

    If you use should.js you can do the following:

     browser.response.toString().should.include 'Logout'