serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
180 stars 285 forks source link

Running by multiple tags #22

Closed edricklacbayo closed 4 years ago

edricklacbayo commented 4 years ago

I don't know if this is an issue or I am just using the wrong format. but supplying multiple tags to the command -Dcucumber.filter.tags doesn't work

For example: -Dcucumber.filter.tags="@TCA-335 and @TCA-333"

wakaleo commented 4 years ago

The cucumber.filter.tags option will only work fully with version 2.2.2 of serenity-core.

edricklacbayo commented 4 years ago

@wakaleo upon checking, the latest version of serenity-core is 2.2.1. Does that mean that running by multiple tags is not yet supported? Do you have any idea on when version 2.2.2 will be released?

edricklacbayo commented 4 years ago

I have upgraded to version 2.2.2 of serenity-core and I tried running using these 2 formats but still no luck in running by multiple tags.

clean verify -Dcucumber.filter.tags="@TCA-335,@TCA-333'

clean verify -Dcucumber.filter.tags="@TCA-335 and @TCA-333"

Is my format wrong or Cucumber.filter.tags cannot run multiple tags yet?

wakaleo commented 4 years ago

Does it work with cucumber.options?

edricklacbayo commented 4 years ago

It says cucumber.options is deprecated. It suggests I use cucumber.filter.tags

wakaleo commented 4 years ago

Yes, but you can still use cucumber.options to check your tag syntax. Do you mean "@TCA-335 and @TCA-333" or "@TCA-335 or @TCA-333"

wakaleo commented 4 years ago

(See https://cucumber.io/docs/cucumber/api/#tags)

edricklacbayo commented 4 years ago

image

IT returns this @wakaleo

edricklacbayo commented 4 years ago

image

This is my command

wakaleo commented 4 years ago

Here is how you would run two tags in Cucumber 5:

mvn clean verify -Dcucumber.filter.tags="@green or @blue"

But the output above suggests a problem with your test runner, not with the tag filtering.

edricklacbayo commented 4 years ago

Thanks, I got it to run. But why is it "or" though shouldn't it it be "and"?

wakaleo commented 4 years ago

“And” means run all the scenarios with both those tags

edricklacbayo commented 4 years ago

Now I get it.

Another question, Does the "or" have a limit on the number of tags I provide?

I mean can I do this command?

-Dcucumber.filter.tags="@test1 or @test2 or @test3 or @test4"

wakaleo commented 4 years ago

There is no limit

edricklacbayo commented 4 years ago

Thanks a lot @wakaleo