Bo Wang
Bo Wang

Reputation: 509

How to use steps from multiple plugins but with same name?

My Jenkins has two plugins to generate cucumber report, but with same name: 'cucumber'

My Jenkins has the following two plugins to generate cucumber report:

1: https://github.com/jenkinsci/cucumber-testresult-plugin/

2: https://github.com/jenkinsci/cucumber-reports-plugin

But both of them use same step name 'cucumber' in pipeline. For example for #2:

                    cucumber buildStatus: 'UNSTABLE',
                            fileIncludePattern: '**/*cucumber-report.json',
                            trendsLimit: 10

For example for #1:

                    cucumber '**/*cucumber-report.json'

My question is how can I specify which one I want to use? is there anything like class name can be leveraged? if yes, how to find out the class name?

Upvotes: 2

Views: 413

Answers (1)

Michael Kemmerzell
Michael Kemmerzell

Reputation: 5256

Basically you have to do the same as you did in your example #2.

cucumber buildStatus: ...

In your example you call the Cucumber reports plugin.

If you want to use the plugin for cucumber json test reporting you can simply follow your pattern from your example #2 and call the plugin by specifing the function testResults.

cucumber testResults: ...

Quote:

To use this feature, first set up your build to run tests, then specify the path to Cucumber JSON files in the Ant glob syntax, such as **/build/test-reports/*.json.

Upvotes: 1

Related Questions