Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section walks you through integrating the Perfecto Quantum Gradle framework with Bitrise.

Prerequisites

This section requires:


Panel

On this page:

Table of Contents
maxLevel2
stylesquare

Anchor
sampleProject
sampleProject
1 | Set up the sample project

This section describes how to set up Quantum in IntelliJ IDEA. Before you can integrate with Bitrise, you need to make sure that the project compiles and you can run it locally.

To set up the sample project:

  1. After cloning the project, import it at the root.

    Expand
    titleClick to view image
    Image Modified
  2. In the Import Project wizard:
    1. Select Gradle and click Next.

      Expand
      titleClick to view image
      Image Modified
    2. To make sure Gherkin scripts stick to their definitions, clear the Create separate module per source set checkbox and click and click Finish.

      Expand
      titleClick to view image
      Image Modified
  3. When the project is created, in the left pane, double-click resources > application.properties.
  4. On the tab that opens, update remote.server (line 17) and securityToken (line 26) with the relevant values for your Perfecto cloud and user.

    Expand
    titleClick to view image
    Image Modified
  5. To validate the setup, run the following command in the terminal:

    Code Block
    gradle clean build test -Pjobname=<job_name> -Pjobnumber=<job_number> -PsuiteFile=src/test/resources/config/testng_appium.xml
    Expand
    titleClick to view image
    Image Modified
  6. Upload the project to your source control provider.
  7. Sign up for a valid Bitrise license at https://www.bitrise.io.

2 | Integrate the Quantum Gradle framework with the Bitrise Gradle Task plugin

  1. In the Bitrise dashboard, click the plus sign to create a new app.

    Expand
    titleClick to view image
    Image Modified
  2. In the wizard that opens, do the following:
    1. Set the app privacy to Private.

      Expand
      titleClick to view image
      Image Modified
    2. Navigate to the Quantum Gradle project from the repository that you uploaded it to when you set up the sample project.

      Expand
      titleClick to view image
      Image Modified
    3. Under Setup repository access, when prompted if you need to use an additional private repository, click No, auto-add SSH key.

      Expand
      titleClick to view image
      Image Modified
    4. Under Choose branch, enter the name of the branch to which you uploaded, such as master

      Expand
      titleClick to view image
      Image Modified

      This triggers Bitrise to perform validations that may take a couple of minutes. It should detect the project as an Android app. 

    5. Under Project build configuration, specify the module as app and click Next.

      Expand
      titleClick to view image
      Image Modified
    6. Leave the variant field blank and click Next.

      Expand
      titleClick to view image
      Image Modified
    7. Under Selected project build configuration, click Confirm.

      Expand
      titleClick to view image
      Image Modified
    8. For now, skip the steps to add an app icon and to register a webhook.

      Expand
      titleClick to view images
      Panel
      borderStylenone
      Section
      Column
      width370px

      Image Modified

      Column

      Image Modified

      This completes the wizard and kicks off a build.

  3. At the top right, click Finish.
  4. Now that we have a template, go back and modify the workflow to strip off anything non-essential, as follows:
    1. Click Workflow

      Expand
      titleClick to view image
      Image Modified

      The window that opens shows the current workflow view, with a few steps already populated.

      Expand
      titleClick to view image
      Image Modified
    2. Click each step and delete all but the first two steps.

      Expand
      titleClick to view image
      Image Modified
    3. To add a new step, click the plus sign, enter gradle in the search field, and select Gradle Runner.

      Expand
      titleClick to view image
      Image Modified
    4. In the build configuration (config > Gradle task to run), enter the following:

      Code Block
      clean build test -Pjobname=$BITRISE_APP_TITLE -Pjobnumber=$BITRISE_BUILD_NUMBER -PsuiteFile=src/test/resources/config/testng_web_desktop.xml
      Expand
      titleClick to view image
      Image Modified
    5. Update the Gradle path to: ./gradlew
    6. Press Ctrl+S to save and execute.
  5. Click Start/Schedule a build.
  6. In the popup window that opens, click Start Build. This triggers a build and validates that the tests are executed.

    Expand
    titleClick to view image
    Image Modified

    On success, you should see the Perfecto CI Dashboard, including the Bitrise job name and job number.

    Expand
    titleClick to view image
    Image Modified
  7. Verify in the Bitrise log that all steps completed successfully.

    Expand
    titleClick to view image
    Image Modified