mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-23 03:21:21 -05:00
feat: Add new Maestro tests for album, playlist, artist, and favorites, and enhance existing tests with additional screenshots and refined playback flows. (#887)
* feat: Add new Maestro tests for album, playlist, artist, and favorites, and enhance existing tests with additional screenshots and refined playback flows. * feat: Enhance Maestro CI/CD with improved caching, updated Maestro version, and refined emulator configurations for better performance and artifact collection. * feat: Run Maestro Android tests using a single orchestrated flow file and collect project screenshots. * fix: Add extended wait conditions to login test to improve stability and prevent flakiness. * feat: Add test IDs to login, authentication, and library selection screens and update Maestro tests to use them. * test: make sign out confirmation assertion optional * feat: Improve login flow robustness by delegating app launch to the login test, increasing wait times, and adding more optional dialog dismissals. * feat: Add APK caching to Maestro test workflow and conditionally run build steps. * feat: make sign-out and cancellation steps in test more robust with optional taps and back key presses, and update login page assertion. * test: remove optional flag from `pressKey: back` action in settings test. --------- Co-authored-by: Violet Caulfield <42452695+anultravioletaurora@users.noreply.github.com> Co-authored-by: Ritesh Shukla <riteshshukla2381@gmail.com>
This commit is contained in:
@@ -14,64 +14,94 @@ jobs:
|
||||
if: github.repository == 'Jellify-Music/App'
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.setver.outputs.version }}
|
||||
cache-hit: ${{ steps.apk-cache.outputs.cache-hit }}
|
||||
steps:
|
||||
- name: 🛒 Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 📦 Check APK Cache
|
||||
id: apk-cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ./android/app/build/outputs/apk/release/app-universal-release.apk
|
||||
key: android-apk-${{ runner.os }}-${{ hashFiles('src/**', 'android/**', 'package.json', 'bun.lock') }}
|
||||
restore-keys: |
|
||||
android-apk-${{ runner.os }}-
|
||||
|
||||
- name: 🖥 Setup Bun
|
||||
if: steps.apk-cache.outputs.cache-hit != 'true'
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: 1.3.4
|
||||
|
||||
- uses: actions/cache@v5
|
||||
- name: 📦 Cache node_modules
|
||||
if: steps.apk-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
~/.cache/turbo
|
||||
key: ${{ runner.os }}-bun-turbo-${{ hashFiles('**/bun.lock') }}
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-bun-turbo-
|
||||
${{ runner.os }}-bun-
|
||||
|
||||
- name: ☕ Setup JDK 17
|
||||
if: steps.apk-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '17'
|
||||
|
||||
- name: 🐘 Setup Gradle
|
||||
- name: 🐘 Setup Gradle with caching
|
||||
if: steps.apk-cache.outputs.cache-hit != 'true'
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
with:
|
||||
cache-read-only: false
|
||||
|
||||
- name: 🍎 Run bun init-android
|
||||
- name: 📦 Cache Gradle
|
||||
if: steps.apk-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: 📥 Install dependencies
|
||||
if: steps.apk-cache.outputs.cache-hit != 'true'
|
||||
run: bun i
|
||||
|
||||
- name: 💬 Disable OTA Updates and Enable Maestro Build
|
||||
if: steps.apk-cache.outputs.cache-hit != 'true'
|
||||
run: bun scripts/updateEnv.js OTA_UPDATE_ENABLED=false IS_MAESTRO_BUILD=true
|
||||
|
||||
|
||||
- name: ✅ Validate Config Files
|
||||
if: steps.apk-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
bun -p "JSON.parse(require('fs').readFileSync('telemetrydeck.json'))"
|
||||
bun -p "JSON.parse(require('fs').readFileSync('glitchtip.json'))"
|
||||
|
||||
- name: 🚀 Run Android fastlane build
|
||||
- name: 🚀 Build Android APK
|
||||
if: steps.apk-cache.outputs.cache-hit != 'true'
|
||||
run: bun run android-build
|
||||
|
||||
- name: 📤 Upload Android Artifacts
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: android-artifacts
|
||||
path: ./android/app/build/outputs/apk/release/*.apk
|
||||
|
||||
path: ./android/app/build/outputs/apk/release/app-universal-release.apk
|
||||
retention-days: 7
|
||||
|
||||
run-maestro-tests:
|
||||
if: github.repository == 'Jellify-Music/App'
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-android
|
||||
|
||||
timeout-minutes: 45
|
||||
|
||||
steps:
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
- name: 🧹 Free Disk Space
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
with:
|
||||
tool-cache: true
|
||||
@@ -90,54 +120,82 @@ jobs:
|
||||
with:
|
||||
bun-version: 1.3.4
|
||||
|
||||
- uses: actions/cache@v5
|
||||
- name: 📦 Cache node_modules
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
~/.cache/turbo
|
||||
key: ${{ runner.os }}-bun-turbo-${{ hashFiles('**/bun.lock') }}
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-bun-turbo-
|
||||
${{ runner.os }}-bun-
|
||||
|
||||
- name: Installing Maestro
|
||||
- name: 📥 Install dependencies
|
||||
run: bun i
|
||||
|
||||
- name: 🎭 Install Maestro
|
||||
shell: bash
|
||||
run: export MAESTRO_VERSION=1.40.0; curl -Ls "https://get.maestro.mobile.dev" | bash
|
||||
run: |
|
||||
export MAESTRO_VERSION=2.0.3
|
||||
curl -Ls "https://get.maestro.mobile.dev" | bash
|
||||
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Set up JDK 17
|
||||
- name: ☕ Setup JDK 17
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
|
||||
- name: 📦 Cache AVD
|
||||
uses: actions/cache@v5
|
||||
id: avd-cache
|
||||
with:
|
||||
path: |
|
||||
~/.android/avd/*
|
||||
~/.android/adb*
|
||||
key: avd-api-34-x86_64-${{ runner.os }}
|
||||
|
||||
- name: ⬇️ Download Android Artifacts
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: android-artifacts
|
||||
path: artifacts/
|
||||
|
||||
- name: Enable KVM group perms
|
||||
- name: 🔧 Enable KVM
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
|
||||
- name: Run e2e tests
|
||||
- name: 🧪 Run Maestro Tests
|
||||
id: run-tests
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: '34'
|
||||
api-level: 34
|
||||
target: google_apis
|
||||
arch: x86_64
|
||||
profile: Nexus 6
|
||||
ram-size: '3072M'
|
||||
heap-size: '1024M'
|
||||
disk-size: '4G'
|
||||
cores: '3'
|
||||
profile: pixel_6
|
||||
ram-size: 4096M
|
||||
heap-size: 1024M
|
||||
disk-size: 6G
|
||||
cores: 4
|
||||
disable-animations: true
|
||||
avd-name: e2e_emulator
|
||||
disable-spellchecker: true
|
||||
disable-linux-hw-accel: false
|
||||
emulator-boot-timeout: 600
|
||||
avd-name: maestro_emulator
|
||||
force-avd-creation: false
|
||||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
|
||||
script: bash scripts/maestro-android-retry.sh "https://jellyfin.jellify.app" "jerry"
|
||||
|
||||
- name: 📸 Collect Screenshots
|
||||
if: always()
|
||||
run: |
|
||||
mkdir -p test-artifacts
|
||||
cp -r screenshots/* test-artifacts/ 2>/dev/null || true
|
||||
cp -r .maestro/screenshots/* test-artifacts/ 2>/dev/null || true
|
||||
cp *.mp4 test-artifacts/ 2>/dev/null || true
|
||||
|
||||
- name: 🗣️ Notify Success on Discord
|
||||
if: success() && github.repository == 'Jellify-Music/App'
|
||||
@@ -149,14 +207,15 @@ jobs:
|
||||
- name: 🗣️ Notify Failure on Discord
|
||||
if: failure() && github.repository == 'Jellify-Music/App'
|
||||
run: |
|
||||
bun scripts/sendDiscordMessage.js "__**## ❌ Maestro Test Failed**__Some tests did not pass."
|
||||
bun scripts/sendDiscordMessage.js "__**## ❌ Maestro Test Failed**__Some tests did not pass. Check artifacts for details."
|
||||
env:
|
||||
DISCORD_WEBHOOK_URL: ${{ secrets.MAESTRO_WEBHOOK_RESULTS }}
|
||||
|
||||
- name: Store tests result
|
||||
- name: 📤 Upload Test Artifacts
|
||||
uses: actions/upload-artifact@v6
|
||||
if: always()
|
||||
with:
|
||||
name: TestResult
|
||||
name: maestro-test-results
|
||||
path: |
|
||||
*.mp4
|
||||
test-artifacts/
|
||||
retention-days: 14
|
||||
|
||||
Reference in New Issue
Block a user