From the course: Cucumber Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Cucumber tags: Multiple tags
From the course: Cucumber Essential Training
Cucumber tags: Multiple tags
- [Instructor] So how about we apply an and condition? I want to run a scenario that matches both these tags. How about we do that? So we're going to make a change to our test runner here. And we will just apply these two tags and put an and in between. And this should run just one feature, the feature that matches both the tags. So let's go ahead and run this test. And it runs just one scenario here, which is the third scenario. And you can see that these two match. Now, a slightly different flavor of the syntax is this. Just put those tags in different double quotes and run this. And this should give me the same output. And it does. And it runs the third scenario. So, we have seen so many scenarios of testing Cucumber scenarios based on tags. Now, let's do one more here. I'm going to make another change, and this time, test not condition. So, let's remove this. And I want to run all tags that do not match NightlyBuildTest. And this should run two scenarios for me. So, if I go back…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Cucumber tags: Add a tag4m 50s
-
(Locked)
Cucumber tags: Multiple tags2m 24s
-
(Locked)
Cucumber tags: Maven test with tags1m 39s
-
(Locked)
Background: Add background2m 26s
-
(Locked)
Background: Duplicate item2m 49s
-
(Locked)
Background: Execution flow2m 53s
-
(Locked)
Cucumber hooks: Adding hooks4m 30s
-
(Locked)
Cucumber hooks: Tagged hooks1m 49s
-
(Locked)
Cucumber reports: Generate reports3m 8s
-
(Locked)
Use monochrome and dryRun parameters3m 37s
-
(Locked)
-
-
-
-