lundi 30 octobre 2017

Unable to run Cucumber Tests using Tags through Maven

when i run cucumber tests using "Run as Junit Tests", the tests runs properly with proper tags.

also when i run cucumber tests using "Maven", the tests runs properly with proper tags,provided i have mentioned the tags in runner class.

@Cucumber.Options(format={"pretty", html:target/cucumber","json:target/cucumber.json"},tags= {"@smokeTest"})

But i want to be able to provide tags as argument to mvn test command,to run the test cases and i am making use of following command.

mvn test -Dcucumber.options="--tags @tagTest"

But it runs all the test cases irrespective of my tags.

also when i use the command mvn test -Dcucumber.options="--tags @tagTest" i mention no tags in my runner class

@Cucumber.Options(format={"pretty",html:target/cucumber","json:target/cucumber.json"})

Please let me know where am i going wrong anywhere?

This is runnerTest code:

import org.junit.runner.RunWith;
import cucumber.junit.Cucumber; 

@RunWith(Cucumber.class)

@Cucumber.Options(format={"pretty", "html:target/cucumber","json:target/cucumber.json"})

public class runnerTest {

}

Attached

pom.xml

Aucun commentaire:

Enregistrer un commentaire