How to run a single test in nightwatch

Mohamed El Mahallawy picture Mohamed El Mahallawy · Feb 3, 2015 · Viewed 30.6k times · Source

How do I run only Test 3 from the following tests?

module.exports = {
  'Test 1':function(){},
  'Test 2':function(){}
  'Test 3':function(){}
}

Answer

Nicolas Pennec picture Nicolas Pennec · Apr 17, 2015

A new parameter --testcase has been added to run a specified testcase.

nightwatch.js --test tests\demo.js --testcase "Test 1"

It's a new feature since the v0.6.0

https://github.com/beatfactor/nightwatch/releases/tag/v0.6.0