Meta data rules can be defiened to enforce meta-data and it's possible value for the project

@since 2.1.15

Meta-data rule provides a way to enforce meta-data and it’s possible value for the project. You can define required and optional meta-data for scenario along with its possible values. You can specify meta data rules by using metadata.rules property.

During dryrun metadata get validated by applying metadata rules.

Metadata rule

metadata.rules accepts json list of Metadata rule in following structre:

MetadataRule =
	String key;
	MetaDataRule depends;
	List<Object> values;
	Boolean required;

### Basic Example

Below is basic example with one rule.


In above example, there is only one rule that enforece user to specify groups in testcase/scenario with possible vaules ["P1","P2","P3","sanity","regression","module1"]. "required":true means you must provide groups. If any other group specified meta-data rule will fail.

### Complex Example

Here is another example, which difines mulitple rules.

  	 "depends":{"key":"module", "vaules":["M1"]}\

In above example testCaseID and storyId specified with pattern. M1Type is dependent on module value M1 that means you can define M1Type only when module is M1.

Tags: bdd scenario