Ask a Question

How can I run two or more testitems by jenkinsfile?

Irvingoliveira
Occasional Contributor

How can I run two or more testitems by jenkinsfile?

Hello!

 

What I'm trying to do is to test the new tests that my team is creating before integrating them to the production test branch. So I'm thinkink in, when a tester do a pull request, jenkins will run the new test in the pull request branch to see if it's working. So, in short, instead of running the full test project in those cases, I want to run only the test step that opens the system, the new test which the tester is resquesting to pull and the test step that closes the system. Is there a way for me to, when I call the testcomplete by jenkinsfile, set as parameters more than one test item of a project? Something like this:

,

Irvingoliveira_0-1625746507780.png

 

4 REPLIES 4
mikef
Staff

Re: How can I run two or more testitems by jenkinsfile?

Hi @Irvingoliveira 

 

Yes, you can specify this in your Execution Plan. Create a test item and drag/drop your tests you want to run, then call them as in the snippet below. 

The following runs the ProjectTestItem3 test item that is a child item of the ProjectTestItem1 test item of the MyProj project:

testcompletetest launchType: 'lcItem', project: 'MyProj', suite: 'Projects\\JenkinsTests.pjs', test: 'ProjectTestItem1|ProjectTestItem3'

  •  

More examples here : 

https://support.smartbear.com/testcomplete/docs/working-with/integration/jenkins/pipeline.html#examp...

 

Hope this helps,

Mike.

Irvingoliveira
Occasional Contributor

Re: How can I run two or more testitems by jenkinsfile?

@mikef, thanks for your answer, but this doesn't solve my problem.

 

Look for the screenshot that I put bellow. What I need is, by the jenkins file, run only the TestItems marked on the figure, supposing that the TestItem 'Grupos Empresariais' is the new test which a tester is requesting to integrate to the test branch.

 

Irvingoliveira_0-1625749344181.png

 

It's a continuos integration process, so, I can't keep editing the test execution plan for each new test that we push.

mikef
Staff

Re: How can I run two or more testitems by jenkinsfile?

Hi @Irvingoliveira 

 

I don't believe it is possible to run only new tests from each PR, the interface is not dynamic in that way. You can specify tests items and the order (or group) to run in, but there is no dynamic operator to run only a new test like this.

 

If there is a way for Jenkins to derive new test names from the PR, you could possibly pass them as variables in your pipeline script.

Irvingoliveira
Occasional Contributor

Re: How can I run two or more testitems by jenkinsfile?

Yes, the part of discovering what tests are new I already resolved. What I need is to run only this test together with these others that I showed in the last sreenshot. My doubt is if it's possible to set as parameter in the jenkinsfile for the testcomplete more than one testitem to run.

cancel
Showing results for 
Search instead for 
Did you mean: