browserstack / nightwatch-browserstack

Selenium examples for Nightwatch and BrowserStack Automate
https://www.browserstack.com
77 stars 62 forks source link

feature request - behavior of multiple --tag options #74

Open elade89 opened 1 year ago

elade89 commented 1 year ago

Hello,

‘tags’ option allows to specify tags in the command line, which cause all tests which include the specified tags in the test module’s ‘@tags’ attribute to be executed in the same launch.

We wish to have an option to change the behavior of this feature, so when specifying more than one tag, Nightwatch will collect only tests which include all specified tags instead of collecting any test which include one of the tags.

Thanks for the support :)

sharutkarsh commented 1 year ago

Hi There,

Thank you for raising this issue with us.

To elaborate on your use case, could you please share a sample code and 'how to run' steps with us?

Also, please raise an issue with BrowserStack support team by filling this form: https://www.browserstack.com/contact#technical-support.

elade89 commented 1 year ago

hi, so for example if I have three test modules, which have a list of these tags under their '@tags' attribute:

test_1.js : ['tag1', 'tag2'] test_2.js : ['tag2'] test_3.js : ['tag2', 'tag3']

when running: npx nightwatch --tag tag1 --tag tag2

the collected tests for this execution will be test_1.js, test_2.js and test_3.js, because they all contain one of the specified tags (tag2).

I would rather having an option to collect only the tests which include all of the specified tags, like in this example - only test_1.js.

hope that's clear, lmkn if any questions pop up.