This guide describes certain conventions we follow for testing mobile apps and using our tools to upload the build artifact and triggering test runs. Consider an in-depth version of Triggering test runs on deployment focused specifically on mobile apps.
Consider this your “Production” or “Staging” environment that is always present.Format: <prefix>-<environment-name>.<extension>Example: app-staging.apk
This is only relevant if you have completed Setting up PR Testing.Format: <prefix>-<org>-<repo>-pr<number>.<extension>Example: app-myorg-myrepo-pr123.apk
To use these features, you will need to contact a QA Wolf representative to configure the trigger on the QA Wolf platform. On your end, you’ll need to decide what tool to use to upload the build artifact and trigger test runs. We support:
import { makeQaWolfSdk } from "@qawolf/ci-sdk";import fs from "fs/promises";import path from "path";const { generateSignedUrlForRunInputsExecutablesStorage, attemptNotifyDeploy } = makeQaWolfSdk({ apiKey: "qawolf_xxxxx", });// Upload a build artifact (APK, AAB, or IPA)const executablePath = await uploadFile({ localPath: "./path/to/file.apk", basename: "app-staging.apk",});// Trigger a test run with the uploaded artifact (optional)await triggerRun({ // Must match the configured value, provided by the QA Wolf team deploymentType: "android_app", // This key will be referenced in QA Wolf tests, also provided by the QA Wolf team environmentKey: "ANDROID_APP", executablePath,});/** Helper to trigger a run on QA Wolf */async function triggerRun({ deploymentType, environmentKey, executablePath }) { const config = { deploymentType, variables: { [environmentKey]: executablePath }, }; await attemptNotifyDeploy(config);}/** Helper to upload an executable file to QA Wolf */async function uploadFile({ localPath, basename }) { const signedUrlResponse = await generateSignedUrlForRunInputsExecutablesStorage({ destinationFilePath: basename, }); const fileBuffer = await fs.readFile(filePath); const url = signedUrlResponse.uploadUrl; await fetch(url, { method: "PUT", body: fileBuffer, headers: { "Content-Type": "application/octet-stream", }, }); return `/home/wolf/run-inputs-executables/${signedUrlResponse.playgroundFileLocation}`;}
Add or update a lane to call upload_to_qawolf and notify_deploy_qawolf. The latter is optional. If you only see a successful message, the file was uploaded and a test run was triggered. Please check the plugin’s readme for more options and details.
Ruby
Copy
Ask AI
lane :qawolf do ensure_git_status_clean name = "app-staging" # Build your app gradle( task: "assemble", build_type: "Release", ) # Upload the artifact to QA Wolf upload_to_qawolf( executable_file_basename: name ) # Trigger a test run on QA Wolf (optional) notify_deploy_qawolf( executable_environment_key: "ANDROID_APP" )end
This assumes you have steps that will build the artifact before the QA Wolf actions.
YAML
Copy
Ask AI
name: Deploy and Notify QA Wolfon: pull_requestjobs: ... notify: needs: deploy-preview-environmnent name: Trigger QA Wolf PR testing runs-on: ubuntu-latest steps: ... # Upload the run input file - name: Upload Run Input id: upload-run-inputs-executable uses: qawolf/upload-run-inputs-executable-action@v1 with: qawolf-api-key: "${{ secrets.QAWOLF_API_KEY }}" # You will need to rename the file to match the following before running this action input-file-path: "./artifact-path/sales-${{ github.repository_owner }}-${{ github.event.repository.name }}-pr${{ github.event.number }}.apk" # Trigger a test run - name: Notify QA Wolf of deployment uses: qawolf/notify-qawolf-on-deploy-action@v1 with: ... # Manually construct the ANDROID_APP variable variables: > { "ANDROID_APP": "/home/wolf/run-inputs-executables/${{ steps.upload-run-inputs-executable.outputs.destination-file-path }}" }