Thursday, 15 April 2010

testing - Data driven test in Nightwatch.js -


How to test data-driven using Nightwatch.js? The content I am using is the data.js file globally:

  module.exports = {username: 'xyz@gmail.com', password: '12345', URL: {Login: 'http://www.asdf.com'}};  

By giving your file path values ​​to the key in your night path "globals_path". File as below, you do not need to rename your JS file, you can use the data.js file as a global file:

  "globals_path": "path / To / data.js ",  

and in your test file, you can call variables like this:

browser.globals.username etc

>

No comments:

Post a Comment