SpecFlowOSS / SpecFlow.Actions

BSD 3-Clause "New" or "Revised" License
57 stars 53 forks source link

Don't run tests on specific Targets Specflow.Actions.Browserstack #95

Open rightmax1234 opened 2 years ago

rightmax1234 commented 2 years ago

Hi Guys,

I've got around 50 tests at the moment and we've just had to add another which can only be ran on a mobile device but we will want to run it on the same test run as all the other tests, as one whole run. But if we did that now, it would automatically run against the desktop browsers as we have multiple json config files, is there any way to maybe add a tag to the scenario like @ONLY_MOBILE or another way of specifying which targets a test can be run against.

Thanks in advance.

SabotageAndi commented 2 years ago

You can use the CurrentTargetIdentifier.Name property to know which target is executed at the moment: https://github.com/SpecFlowOSS/SpecFlow.Actions/blob/main/Plugins/SpecFlow.Actions.Configuration/SpecFlow.Actions.Configuration/CurrentTargetIdentifier.cs#L33

msz13 commented 2 years ago

I can't find in documentation how to set target for given test run. I have found thet target are avaible only specflow test runner. Are there also avaible on xunit or nutnit runners?