TestProject Forum

General => General Questions => Topic started by: Karen on May 01, 2016, 18:22:29 pm

Title: Run Nightwatch tests in a particular order?
Post by: Karen on May 01, 2016, 18:22:29 pm
I wrote a few tests with nightwatchjs.

Some of the tests should run only after the register/login tests have run.

Is it possible to run a few tests in any order I can dictate pre-run ?
Title: Re: Run Nightwatch tests in a particular order?
Post by: Oren on May 02, 2016, 19:49:58 pm
Nightwatch runs each test within a particular file in order, so what you could do is put every test in the same file, in the order you wish them to run.

Nightwatch runs each test file in alphabetical order.

You could use this to your advantage by giving each test file with a number specifying the order you want them to be run in.
e.g. if you have 2 test files, Init.js and Demo.js, and you obiously want Init.js to run first, you could change the names of the files to 01Init.js and 02Demo.js. This will make Nightwatch run the files in the order you want.
Title: Re: Run Nightwatch tests in a particular order?
Post by: Karen on May 03, 2016, 19:16:20 pm
Thanks for the help Oren