Run Nightwatch tests in a particular order?

  • 2 Replies
  • 1258 Views
*

Karen

  • *
  • 17
Run Nightwatch tests in a particular order?
« 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 ?

*

Oren

  • **
  • 59
Re: Run Nightwatch tests in a particular order?
« Reply #1 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.

*

Karen

  • *
  • 17
Re: Run Nightwatch tests in a particular order?
« Reply #2 on: May 03, 2016, 19:16:20 pm »
Thanks for the help Oren

 

Sitemap 1 2 3 4 5 6 7 8