Basically what I need to do is to get a config file from a csv file and load it as an array into a global variable each time I am running tests in before function.
Lets say mynightwatch.conf.js contains following, example global variable myGlobalArr
"globals": {
myGlobalArr : []
}
And in globals.js I am using readFileSync to read a file and get it's text as an array to a variable
before: function(done) {
var file = fs.readFileSync('path').toString().split('\n')
}
How can I pass an array which is stored in file to myGlobalArr and then call it from inside a Page Object to use it?
Thanks