Boolean Operations of Tags

After tagging scenarios, features for a while in your project, you might want to execute the scenarios based on your need at different points during the delivery cycle. Please read the previous section “Tag Scenarios” to get a context on this page. Let’s talk about some scenarios:

1) You are nearing beta and you have limited time. So you have to prioritize execution of test cases. You might want to execute only “@beta3″ and “@fast” tests

2) You want to execute all scenarios in your project except “@parallel” because you realized that application is not handling race conditions well.

3) You want to execute all scenarios that are @fast or @parallel (In this case, lets say you already tagged some scenarios as @fast and some other scenarios as @parallel and you just want all of them to run)

Pre-requisites:

  1. You have completed the section “Set up Env” and have your environment ready with JDK, maven and IntelliJ
  2. You have read and understood HTML DOM
  3. You were able to comprehend “Find Element Strategies” post
  4. You downloaded the project code base for class7 under – https://github.com/machzqcq/CucumberJVMExamples and imported into IntelliJ and the structure should look as below

class7_project_structure

If you imported into eclipse, it should look as below

class7_eclipse_project_structure

Negation

Execute all scenarios except “@parallel”

 

OR’ng

Execute fast or parallel scenarios

AND’ng

Execute @beta3 and @fast scenarios

class7_or_and

Running all features:

Let’s say we are executing all feature files on a project. It is as simple as right-click on the feature folder and Run.

class7_run_all_features

Running from eclipse is pretty much the same with cucumber-eclipse plugin as follows

class7_eclipse_run_feature

Run not parallel across project

class7_not_parallel

The following will run for the above

class7_not_parallel_scenarios