Forum Discussion

Irvingoliveira's avatar
Irvingoliveira
Occasional Contributor
3 years ago

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:

,

 

4 Replies

  • 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#examples

     

    Hope this helps,

    Mike.

    • Irvingoliveira's avatar
      Irvingoliveira
      Occasional Contributor

      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.

       

       

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

      • mikef's avatar
        mikef
        Staff

        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.