Create CI projects for Perfecto in Azure DevOps

Perfecto supplies a plugin that can be added to Azure DevOps (VSTS) Continuous Integration (CI) projects as a step in the build process. A typical CI build incorporating the plugin will perform the following steps:

  • Build your app.
  • Upload your application to the Perfecto repository.
  • Run your tests with any test execution mechanism:

    • Connect to Perfecto providing your account credentials.

    • Perform the test script.

  • Delete the app from the cloud.
  • Download the Perfecto test report at the end of test execution.

In addition, the Perfecto extension supports the following steps:

  1. Upload the app to the Perfecto repository and make it available for the test script.
  2. Delete the app from the cloud after running your tests. 

For information on installing the plugin, see Perfecto extension available in Azure DevOps Marketplace.

Create the build definition

  1. Log in to your Azure DevOps cloud and define your team project. You can create your test scripts in whatever language you are comfortable with and whatever tools you use. Save your program files either directly in Azure DevOps or externally, for example in a GitHub folder (as will be demonstrated in these pages).

  2. After connecting to your team project, select Pipelines > Builds. Then click New pipeline

  3. For the new pipeline, define the type of repository, where the project artifacts (program and configuration files) can be found. In this example, we use a GitHub repository, but other options are supported by Azure DevOps

    After connecting to GitHub, Azure DevOps displays a list of templates.

  4. Select a template that builds your kind of app. You will see the default steps for the build. You can customize the tasks by deleting the default steps and adding other steps in their place.

Add the Perfecto step to the build

The Perfecto plugin supports a build step to either upload your target application to (or delete an application from) the Perfecto Lab Repository. This allows your test script to install the application at the start of the script, guaranteeing a clean test platform.

  1. Add the plugin step just like any other step by clicking the Edit button. In the Tasks look for the Perfecto Mobile Configuration task.

  2. Configure the task in the configuration pane:

    • Perfecto Connection: Azure DevOps service that connects to your Perfecto credentials. See Perfecto service connection in Azure DevOps (VSTS) projects for information on how to define the Perfecto Connection.
    • Action: Select either to Upload the app or Delete the app at this step.
    • APK or IPA file name: name of the app, the app may be created by a build step.
    • Application Folder: application location on the build machine.
    • Folder in Perfecto Cloud: location in the Perfecto repository to upload the app into.

Below we show a sample Build Definition that:

  1. Builds the application to test.

  2. Uploads the application to the Perfecto Lab repository.

  3. Runs the test scripts.

  4. Saves the Perfecto test reports.