Tuesday, 24 December 2019

Problem with running individual Nightwatchjs tests

I've an issue where I can only seem to run individual nightwatchjs tests if I use the absolute path of the test script.

So, as an example, if I run my test from the following folder;

/Users/darrenharley/Documents/Git/uk-content-parkers/Tests/Functional/tests

with the following;

npm run test:live /Users/darrenharley/Documents/Git/uk-content-parkers/Tests/Functional/tests/current_functionality/gamAds/PAR-5139.js

It works correctly.

However, I need to run this test without using my local file structure (as will eventually be run via a Jenkins build so can't use this).

But if I run the test with the following;

npm run test:live ./current_functionality/gamAds/PAR-5139.js

it fails, with the following error;

Error: ENOENT: no such file or directory, stat './current_functionality/gamAds/PAR-5139.js'

Am I doing something obviously wrong here?

If it helps, in my nightwatch.conf.js file I have this;

 src_folders: [
    'tests/',
  ],

and in my package.json file I have this;

"test:live": "nightwatch --config config/nightwatch.conf.js --env live --suiteRetries 3",

Any help would be appreciated, as this is driving mad as it seems such a basic thing to do.

Many thanks.



from Problem with running individual Nightwatchjs tests

No comments:

Post a Comment