I'm also new to node/nightwatch, so there may be a better way, but this is a working solution.
var xlsx = require('xlsx');
var fs = require('fs');
if(typeof require !== 'undefined') XLSX = require('xlsx');
var workbook = XLSX.readFile('MyExcelDoc.xlsx');
var sheetnamelist = workbook.SheetNames;
module.exports = {
'MyTest' : function (browser) {
//iterates through excel sheet testing each URL
sheetnamelist.forEach(function(y) {
var worksheet = workbook.Sheets[y];
var z;
for (z in worksheet) {
if(z[0] === '!') continue;
var url = worksheet[z].v;
browser
.url(url);
//do something at your url//
}
});
browser.end()
}
};
ps, I hope the bracketing and stuff is right. I copied my code and deleted all the irrelevant things, and hopefully I also deleted the right amount of brackets.