How to pass multiple parameter to Cucumber Runner

2020-08-03 09:50发布

问题:

I am executing my test cases from Jenkins and passing multiple cucumber tags from Jenkins to execute my scenario -

Runner File -

plugin = { "pretty", "html:target/test-report" },
features    = { "src/main/resources/abc/features" },
tags        = {"@Demo","@Alpha"}
)

Jenkins Parameter-

test -Dcucumber.options="src/main/resources/myuhc2/features/ --tags @Demo, --tags @Alpha"

but this is not working and I am getting error -

Tests in error:

Not a file or directory - /home/jenkins/workspace/XYZ2.0/consumer_proj/Alpha

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

回答1:

Delete the comma following @Demo. If you want to AND the tags use:

--tags @Demo --tags @Alpha

To OR the tags use (no space after comma):

--tags @Demo,@Alpha