Creating and configuring the testing stage - Cloud

Talend Cloud API Tester Examples

Version
Cloud
Language
English
Product
Talend Cloud
Module
Talend API Tester
Content
Design and Development > Testing APIs
Last publication date
2024-03-15

Create and configure a second stage in your pipeline to launch your API tests.

Procedure

  1. In your release pipeline, go to the Pipeline tab and click the + icon below Deploy to Staging.
  2. Click Empty job and name the stage, Launch API Tests, for example.
  3. Click Tasks > Launch API Tests to configure the stage.
  4. Click the + icon to add a task, select Download secure file and click Add.
  5. Name the task, Download pom.xml for example.
  6. Select the pom.xml file and enter pom in Output Variables > Reference name.
  7. Add a Bash task to fetch your API test project using the Talend Cloud API Tester Management API.
  8. In the task configuration panel, select Inline as the type and enter the following script:
    curl -X GET 'https://apit.eu.cloud.talend.com/api/v1/api-tests/<api_project_id>' \
              -H 'Authorization: Bearer $(talend_personal_access_token)' \
              --output ./api-test.json
    Replace <api_project_id> with your test project's ID. You can find it in the Test Automation box when opening your project in Talend Cloud API Tester.
    Inline is selected with the script.
  9. Create a Maven Authenticate task and select the feed and credentials that you added in a previous step.
  10. Create a Maven task and configure it as follows:
    Field Value
    Display name Enter a name for your task, Launch API Tests for example.
    Maven POM file $(pom.secureFilePath)
    Goal(s) surefire-report:report
    Options -Dapi.test.filepath=./api-test.json -Dtalend.account.id=$(talend_account_id) -Dtalend.instance=<your_talend_instance> in which you should replace <your_talend_instance> with either us, eu or ap depending on your data center.

    Example

    The Maven task is configured with the parameters listed above.
  11. Click Save.

Results

Your release pipeline is now configured. You can create a release and deploy it.
The release pipeline is configured.