1+ name : E2E Tests with Maestro
2+
3+ on :
4+ pull_request :
5+ types :
6+ - opened
7+ - synchronize
8+ - edited
9+ workflow_dispatch :
10+
11+ jobs :
12+ build_internal_samples :
13+ strategy :
14+ matrix :
15+ conf : [
16+ { name: wallet, command: ":sample:wallet:assembleInternal" },
17+ { name: dapp, command: ":sample:dapp:assembleInternal" },
18+ ]
19+ name : Build Internal ${{ matrix.conf.name }}
20+ runs-on : ubuntu-latest
21+ steps :
22+ - uses : actions/checkout@v3
23+
24+ - name : Setup Java 17
25+ uses : actions/setup-java@v3
26+ with :
27+ distribution : ' zulu'
28+ java-version : ' 17'
29+ architecture : x86_64
30+ cache : ' gradle'
31+
32+ - name : Cache Gradle
33+ uses : actions/cache@v3
34+ with :
35+ path : |
36+ ~/.gradle/caches
37+ ~/.gradle/wrapper
38+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
39+ restore-keys : |
40+ ${{ runner.os }}-gradle-
41+
42+ - name : Setup Required files to build samples
43+ with :
44+ GOOGLE_SERVICES_JSON : ${{ secrets.GOOGLE_SERVICES_JSON }}
45+ FIREBASE_SERVICE_CREDENTIALS : ${{ secrets.FIREBASE_SERVICE_CREDENTIALS }}
46+ SECRETS_PROPERTIES : ${{ secrets.SECRETS_PROPERTIES }}
47+ ENCODED_STRING_DEBUG : ${{ secrets.WC_KOTLIN_DEBUG_KEYSTORE }}
48+ SIGNING_KEY_STORE_PATH_DEBUG : ${{ secrets.WC_KOTLIN_DEBUG_KEYSTORE_PATH }}
49+ ENCODED_STRING_INTERNAL : ${{ secrets.WC_KOTLIN_INTERNAL_KEYSTORE }}
50+ SIGNING_KEY_STORE_PATH_INTERNAL : ${{ secrets.WC_KOTLIN_INTERNAL_KEYSTORE_PATH }}
51+ ENCODED_STRING_UPLOAD : ${{ secrets.WC_KOTLIN_UPLOAD_KEYSTORE }}
52+ SIGNING_KEY_STORE_PATH_UPLOAD : ${{ secrets.WC_KOTLIN_UPLOAD_KEYSTORE_PATH }}
53+ uses : ./.github/actions/ci_setup
54+
55+ - name : Build sample - Internal
56+ env :
57+ WC_CLOUD_PROJECT_ID : ${{ secrets.WC_CLOUD_PROJECT_ID }}
58+ FIREBASE_TOKEN : ${{ secrets.FIREBASE_TOKEN }}
59+ NOTIFY_INTEGRATION_TESTS_PROJECT_ID : ${{ secrets.NOTIFY_INTEGRATION_TESTS_PROJECT_ID }}
60+ NOTIFY_INTEGRATION_TESTS_SECRET : ${{ secrets.NOTIFY_INTEGRATION_TESTS_SECRET }}
61+ MIX_PANEL : ${{ secrets.MIX_PANEL }}
62+ run : |
63+ ./gradlew ${{ matrix.conf.command }}
64+
65+ - name : Upload APKs
66+ uses : actions/upload-artifact@v4
67+ with :
68+ name : ${{ matrix.conf.name }}-apk
69+ path : sample/${{ matrix.conf.name }}/build/outputs/apk/internal/*.apk
70+ retention-days : 1
71+
72+ run_e2e_tests :
73+ name : Run E2E Tests
74+ timeout-minutes : 20
75+ runs-on : ubuntu-latest
76+ needs : build_internal_samples
77+ steps :
78+ - name : Checkout repository
79+ uses : actions/checkout@v3
80+
81+ - name : Enable KVM
82+ run : |
83+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
84+ sudo udevadm control --reload-rules
85+ sudo udevadm trigger --name-match=kvm
86+
87+ - name : Set up JDK
88+ uses : actions/setup-java@v3
89+ with :
90+ distribution : ' temurin'
91+ java-version : ' 17'
92+
93+ - name : Download all APKs
94+ uses : actions/download-artifact@v4
95+ with :
96+ pattern : " *-apk"
97+ path : apks
98+ merge-multiple : true
99+
100+ - name : List APKs
101+ run : |
102+ echo "Available APKs:"
103+ find apks -name "*.apk"
104+
105+ - name : Install Maestro
106+ run : |
107+ curl -Ls "https://get.maestro.mobile.dev" | bash
108+ export PATH="$PATH":"$HOME/.maestro/bin"
109+ echo "$HOME/.maestro/bin" >> $GITHUB_PATH
110+ maestro --version
111+
112+ - name : Setup Android SDK
113+ uses : android-actions/setup-android@v2
114+
115+ - name : Start Android Emulator and Run Tests
116+ uses : reactivecircus/android-emulator-runner@v2
117+ with :
118+ api-level : 33
119+ target : google_apis
120+ arch : x86_64
121+ ram-size : 2048M
122+ emulator-boot-timeout : 600 # 10min
123+ profile : pixel_7
124+ avd-name : test_device
125+ emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
126+ disable-animations : true
127+ pre-emulator-launch-script : |
128+ echo "Running pre emulator launch script. Printing the working directory now:"
129+ pwd
130+ script : |
131+ echo "Listing available devices:"
132+ avdmanager list device
133+
134+ echo "Listing available APKs:"
135+ find apks -name "*.apk"
136+
137+ # verify emulator is running
138+ adb devices
139+
140+ echo "Installing APKs:"
141+ find apks -name "*.apk" -exec adb install -r {} \;
142+
143+ echo "Installed apps:"
144+ adb shell pm list packages
145+
146+ echo "Running Maestro native to native tests:"
147+ maestro test .maestro/flows/native/connect_reject.yaml
148+ maestro test .maestro/flows/native/connect_confirm.yaml
149+ maestro test .maestro/flows/native/personal_sign_reject.yaml
150+ maestro test .maestro/flows/native/personal_sign_confirm.yaml
151+
152+ # echo "Running Maestro web to native tests:"
153+ # maestro test .maestro/flows/web/connect_reject.yaml || echo "Test web_connect_reject failed but continuing"
154+ # maestro test .maestro/flows/web/connect_confirm.yaml || echo "Test web_connect_confirm failed but continuing"
155+
156+ - name : Find video files in project root
157+ if : always()
158+ run : |
159+ echo "Looking for video files in project root:"
160+ find . -maxdepth 1 -type f -name "*.mp4" -o -name "*.mov"
161+
162+ # Create videos directory if it doesn't exist
163+ mkdir -p videos
164+
165+ # Move any video files from root to videos directory
166+ find . -maxdepth 1 -type f \( -name "*.mp4" -o -name "*.mov" \) -exec mv {} videos/ \;
167+
168+ - name : Upload test recordings from root
169+ if : always()
170+ uses : actions/upload-artifact@v4
171+ with :
172+ name : maestro-root-recordings
173+ path : |
174+ videos/
175+ *.mp4
176+ *.mov
177+ if-no-files-found : warn
178+
179+ - name : Upload test recordings from .maestro
180+ if : always()
181+ uses : actions/upload-artifact@v4
182+ with :
183+ name : maestro-videos
184+ path : |
185+ .maestro/videos/
186+ if-no-files-found: warn
0 commit comments