mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 17:37:05 +05:30
feat: use Maestro to automatically generate Play Store screenshots
This commit is contained in:
parent
a7c81a77f2
commit
dd7a7d9977
3 changed files with 51 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -245,3 +245,4 @@ hs_err_pid*
|
||||||
|
|
||||||
keystore.properties
|
keystore.properties
|
||||||
distribution/
|
distribution/
|
||||||
|
screenshots/
|
||||||
|
|
18
maestro/play_store_flow.yml
Normal file
18
maestro/play_store_flow.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
appId: dev.msfjarvis.claw.android
|
||||||
|
---
|
||||||
|
- launchApp
|
||||||
|
- tapOn:
|
||||||
|
text: "Add to saved posts"
|
||||||
|
index: 0
|
||||||
|
- tapOn:
|
||||||
|
text: "Add to saved posts"
|
||||||
|
index: 2
|
||||||
|
- takeScreenshot: "HottestPosts"
|
||||||
|
- tapOn: "Saved"
|
||||||
|
- takeScreenshot: "SavedPosts"
|
||||||
|
- tapOn: "Hottest"
|
||||||
|
- tapOn:
|
||||||
|
text: "Open comments"
|
||||||
|
index: 0
|
||||||
|
- waitForAnimationToEnd
|
||||||
|
- takeScreenshot: "CommentsPage"
|
32
scripts/run-maestro-flows.sh
Executable file
32
scripts/run-maestro-flows.sh
Executable file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Get the absolute path to the script file
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)"
|
||||||
|
|
||||||
|
# Create a directory for generated screenshots since Maestro puts them iN $PWD
|
||||||
|
mkdir -p "${SCRIPT_DIR}"/../screenshots
|
||||||
|
pushd "${SCRIPT_DIR}"/../screenshots || exit 1
|
||||||
|
# Delete any existing screenshots
|
||||||
|
rm -rf ./*.png
|
||||||
|
|
||||||
|
# Enable Demo Mode on the device with the following settings
|
||||||
|
# - Hide notification icons
|
||||||
|
# - Set clock to 1200 hrs
|
||||||
|
adb shell am broadcast -a com.android.systemui.demo \
|
||||||
|
-e command enter \
|
||||||
|
-e command notifications -e visible false \
|
||||||
|
-e command clock -e hhmm 1200
|
||||||
|
|
||||||
|
# Clear data for the app to make re-runs consistent
|
||||||
|
adb shell pm clear dev.msfjarvis.claw.android
|
||||||
|
|
||||||
|
# Run the Maestro Flows from $PROJECT_DIR/maestro
|
||||||
|
maestro test "${SCRIPT_DIR}"/../maestro/*.yml
|
||||||
|
|
||||||
|
# Turn off Demo Mode on the device
|
||||||
|
adb shell am broadcast -a com.android.systemui.demo -e command exit
|
||||||
|
|
||||||
|
# Return to the original $PWD
|
||||||
|
popd || exit 1
|
Loading…
Add table
Add a link
Reference in a new issue