Running single test

807 views
Skip to first unread message

nb

unread,
Aug 5, 2014, 4:33:47 PM8/5/14
to nightw...@googlegroups.com, nbhat...@godaddy.com
Hi All,
Is there a way to run only one test? I'm looking for something like .only from mocha.  

Apologies if it's duplicate; I tried searching but couldn't find a way to just run 1 test.

Thanks,
nb

Michael Valentine

unread,
Aug 5, 2014, 6:38:47 PM8/5/14
to nightw...@googlegroups.com, nbhat...@godaddy.com
./nightwatch -c /path/to/json, -t /path/to/test.js

Is that not working for you? If you arent defining the json and test it might be the case that it's defaulting to a test folder that houses multiple tests.

nb

unread,
Aug 5, 2014, 6:42:31 PM8/5/14
to nightw...@googlegroups.com, nbhat...@godaddy.com
Hi Michael,
Thanks for quick response.

./nightwatch -c /path/to/json, -t /path/to/test.js

I have more than 1 test cases inside test.js and if I need to run only 1 I either need to comment out others  or move it to other file and do it.

Thanks,
nb

Andrei Rusu

unread,
Aug 6, 2014, 2:07:00 AM8/6/14
to nightw...@googlegroups.com
Use --test, or -t option.
--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/e7e1695e-3df9-44b4-8d15-a5e9dfa0c11d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrei Rusu

unread,
Aug 6, 2014, 3:53:07 AM8/6/14
to nightw...@googlegroups.com, nbhat...@godaddy.com
I see what you mean. The only way that would be possible is to implement some kind of comment interpreter (like jshint) and then in your test you would do something like: 
/* nightwatch:skipTest=true */.

James Eisenhauer

unread,
Jan 28, 2015, 1:57:57 PM1/28/15
to nightw...@googlegroups.com, nbhat...@godaddy.com
anybody have any other ideas on how to run a single test case within a suite?

thanks!

jim

N B

unread,
Jan 28, 2015, 2:06:25 PM1/28/15
to nightw...@googlegroups.com, nbhat...@godaddy.com
This has been frustrating specially when I ask my developer to run tests. I wish there's something like 'only = true'.

For now when I develop these test cases I comment out other LOL.

James Eisenhauer

unread,
Jan 28, 2015, 2:30:27 PM1/28/15
to nightw...@googlegroups.com, nbhat...@godaddy.com
yeah i was really wanting the tags to work on specific test case within the suite.  maybe i will dig into the code and see how tags work.

jim

Kavita Sharda

unread,
Jan 28, 2015, 3:10:56 PM1/28/15
to nightw...@googlegroups.com, nbhat...@godaddy.com
Tags work on test suite and not test case. Right now I didnt find anything that can run single test

hope that helps
Reply all
Reply to author
Forward
0 new messages