New answers tagged

1

I'll also answer my own question because after another day or two, I've read more of the documentation and found that since nightwatch version 1.3, it supports BDD syntax similar to e.g. Cypress. It's still marked as beta. An example could be: const testData = require('../Resources/userData.json'); const credentials = require('../Resources/credentials.json');...


2

Nightwatch represents each spec file as an exported object mapping the test names to the test functions. To generate tests from data, therefore, you can use any means of adding properties to an object provided by JavaScript. For example, given: [ { "title": "First test", "url": "https://google.com" }, { ...


0

I haven't use a nightwatch.js but the error Cannot use import statement outside a module, I've encountered it though recently with nodejs. I found this really nice article, there's quite a few solution mention in there but for me adding this on my package.json help me out though. Hope this help you out too. { "type": "module" } For the ...


Top 50 recent answers are included