Last updated: Jan 28, 2020 14:28
2 | Use the plugin
For information on using the fastlane plugin, see this example Fastfile. Following is a sample action that you can add to your Fastfile to utilize the plugin.
PERFECTO_CLOUDURLis the URL of your Perfecto cloud, such as demo.perfectomobile.com
PERFECTO_TOKENis your Perfecto security token
PERFECTO_MEDIA_LOCATIONis the location of the Perfecto media repository to upload the file specified by the
file_pathkey, such as
file_pathis the location of your preferred
.apkfile to be uploaded to the Perfecto media repository
You pass the values for these keys either by means of an
.env file inside the
fastlane folder or through environment variables.
The following image shows a sample
Combinations with other tools and integrations
You can use fastlane in combination with other tools and integrations that Perfecto offers. The following sample project demonstrates the usage of the fastlane plugin in an end-to-end integration of an Android build life cycle: https://github.com/PerfectoMobileSA/FastlaneEspressoCircleCISlackSample.
The life cycle includes:
- Generating the .apk builds
- Testing the builds on Perfecto
- Running the builds in CircleCI
- Getting instant, suite-level reporting to Slack
- Verifying the test results with Perfecto Smart Reporting
For steps, expand the following scenarios.
- Clone the sample project.
- In a terminal window, navigate to the project folder.
- Create a file called
local.propertiesto contain an
sdk.dirkey pointing to your Android SDK location.
- Set up the
.envfile (see example above).
Run the following commands:
- Set up CircleCI. Use this sample CircleCI fastlane file as a reference.
config.ymlfile takes care of deploying the required installations, builds the
.apkfiles, uploads to Perfecto, executes Espresso tests in the Perfecto cloud, and then sends the suite-level Smart Reporting link to Slack.
- Set up the following environment variables in CircleCI. For more information, see the CircleCI documentation on environment variables.
PERFECTO_CLOUDURL: The URL of your Perfecto cloud, such as demo.perfectomobile.com
PERFECTO_TOKEN: Your Perfecto security token
PERFECTO_MEDIA_LOCATION: The location of the Perfecto media repository to upload the file specified by the
file_pathkey, such as
slack_webhook: The incoming webhook for the Slack integration
For more information, see the fastlane documentation on Slack.