Integrate the Perfecto Quantum Gradle framework with Bitrise.
This section requires:
- A basic understanding of the Quantum framework. To get started, see the Quantum Starter Kit.
An installation of Quantum with Gradle. You can use this Perfecto project on GitHub: https://github.com/PerfectoMobileSA/Quantum-Starter-Kit-Gradle
Set up the sample project and make sure you can compile it and run it locally.
- JDK 8 or later.
- Gradle. For installation information, see https://gradle.org/install.
To set up the sample project:
After cloning the project, import it at the root.
- In the Import Project wizard:
Select Gradle and click Next.
To make sure Gherkin scripts stick to their definitions, clear the Create separate module per source set checkbox and click and click Finish.
- When the project is created, in the left pane, double-click resources > application.properties.
On the tab that opens, update
remote.server(line 17) and
securityToken(line 26) with the relevant values for your Perfecto cloud and user.
To validate the setup, run the following command in the terminal:Copy
gradle clean build test -Pjobname=<job_name> -Pjobnumber=<job_number> -PsuiteFile=src/test/resources/config/testng_appium.xml
- Upload the project to your source control provider.
- Sign up for a valid Bitrise license at https://www.bitrise.io.
In the Bitrise dashboard, click the plus sign to create a new app.
In the wizard that opens, do the following:
Set the app privacy to Private.
Navigate to the Quantum Gradle project from the repository that you uploaded it to when you set up the sample project.
Under Setup repository access, when prompted if you need to use an additional private repository, click No, auto-add SSH key.
Under Choose branch, enter the name of the branch to which you uploaded, such as master.
This triggers Bitrise to perform validations that may take a couple of minutes. It should detect the project as an Android app.
Under Project build configuration, specify the module as app and click Next.
Leave the variant field blank and click Next.
Under Selected project build configuration, click Confirm.
For now, skip the steps to add an app icon and to register a webhook.
This completes the wizard and kicks off a build.
- At the top right, click Finish.
- Now that we have a template, go back and modify the workflow to strip off anything non-essential, as follows:
The window that opens shows the current workflow view, with a few steps already populated.
Click each step and delete all but the first two steps.
In the build configuration (config > Gradle task to run), enter the following:Copy
clean build test -Pjobname=$BITRISE_APP_TITLE -Pjobnumber=$BITRISE_BUILD_NUMBER -PsuiteFile=src/test/resources/config/testng_web_desktop.xml
- Update the Gradle path to:
- Press Ctrl+S to save and execute.
- Click Start/Schedule a build.
In the popup window that opens, click Start Build. This triggers a build and validates that the tests are executed.
On success, you should see the Perfecto CI Dashboard, including the Bitrise job name and job number.
Verify in the Bitrise log that all steps completed successfully.