-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[B2CQA-2056] Various E2E Mobile tests improvements (#5390)
* test: upgrade android emulator to Pixel 6 Pro SDK 32 and cache it * test: fix market test * ci: use s3 caching for avd * test: update detox to latest version * fix: sending mock message only after ws client is connected * chore: update pnpm-lock file
- Loading branch information
1 parent
9cce54e
commit 1bac929
Showing
9 changed files
with
115 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
# Wait until the device is considered idle | ||
|
||
start_time=$(date +%s) | ||
load_threshold=0.9 | ||
echo "Start waiting until the device is idle ($(date))" | ||
end_time=$((start_time + 1800)) | ||
|
||
while true; do | ||
load=$(adb shell uptime | cut -d , -f 3 | cut -f 2 -d :) | ||
|
||
if (( $(echo "$load > $load_threshold" | bc -l) )); then | ||
if (( $(echo "$load < 4" | bc -l) )); then | ||
anr_package=$(adb shell dumpsys window | grep -E "mCurrentFocus.*Application Not Responding" | cut -f 2 -d : | sed -e "s/}//" -e "s/^ *//" | tr -d '\r\n') | ||
|
||
if [ -n "$anr_package" ]; then | ||
echo "ANR on screen for: $anr_package. Restarting it." | ||
|
||
# Some suggest that restarting the service with 'am startservice' should restart it, | ||
# but it doesn't seem to work. So using killall. | ||
# We additionally restart it, but with killall, the system UI is restarted automatically | ||
adb shell su 0 killall $anr_package | ||
|
||
if [ "$anr_package" == "com.android.systemui" ]; then | ||
adb shell am start-service -n com.android.systemui/.SystemUIService || true | ||
fi | ||
fi | ||
fi | ||
|
||
sleep 15 | ||
else | ||
break | ||
fi | ||
|
||
if [ $(date +%s) -ge $end_time ]; then | ||
echo "Reached the timeout before the device is idle." | ||
break | ||
fi | ||
done | ||
|
||
echo "Waited until the device is idle for $(( $(date +%s) - start_time )) seconds." | ||
|