- Getting Started
- Code Review
- Platforms
- CI integrations
- Web Projects
- Get Notified
- API
Your CircleCI job will call into Screenshotbot at the end of a test run. In order to make this call you first need to configure your API Keys.
In CircleCI, click go to your Project settings, and click Environment Variables on the left, and add these two environment variables with the appropriate values.
At this point you can call into Screenshotbot from your job.
We assume you already set up running instrumentation tests on Firebase. (If you need help, feel free to contact us).
At this point you need to make sure your call into Firebase Test Lab also pulls all the screenshots that were generated during the run. In your .circleci/config.yml, you can use something like the following:
cd ~/project && sudo gcloud firebase test android run \ --app ./build/outputs/apk/debug/project-debug.apk \ --test ./build/outputs/apk/androidTest/debug/project-debug-androidTest.apk \ --results-bucket cloud-test-${GOOGLE_PROJECT_ID} \ --directories-to-pull /sdcard/screenshots/<package-name-of-instrumentation-apk> \ --device-ids Pixel2 \ --os-version-ids 27
Screenshotbot provides a script to process these screenshots:
curl https://screenshotbot.io/recorder.sh | sh
You can now use the recorder.jar to upload the screenshots to Screenshotbot:
~/screenshotbot/recorder.sh --dir ${CIRCLE_ARTIFACTS}/*/*/artifacts/screenshot_bundle.zip \ --channel <channel-name> \ --metadata ${CIRCLE_ARTIFACTS}/*/*/artifacts/metadata.xml \ --is-production \ --branch ${CIRCLE_BRANCH} \ --api-key ${SCREENSHOTBOT_API_KEY} \ --repo ${CIRCLE_REPOSITORY_URL} \ --api-secret ${SCREENSHOTBOT_API_SECRET}
Choose the channel name appropriately, if you’re using buck it could the Buck target to the instrumentation test. If you’re using multiple gradle repositories, it could be the Github URL to the gradle repository, etc. Each channel is monitored independently.
Sign up or contact us.