- wait callTimeCheck before end call

- launch emulator w/o gui
- update readme to include screport
This commit is contained in:
Quentin Monnier 2023-01-19 16:16:03 -06:00 committed by Sylvain Berfini
parent f6668f3521
commit 992bf4b1b5
3 changed files with 22 additions and 4 deletions

View file

@ -19,6 +19,7 @@ job-android-uitests:
stage: uitests
tags: [ "macos-xcode13" ]
allow_failure: true
dependencies:
- job-android
@ -38,7 +39,7 @@ job-android-uitests:
#launch emulator
- ${ANDROID_HOME}/platform-tools/adb start-server
- ${ANDROID_HOME}/emulator/emulator -avd $emulator_name -port $emulator_adb_port >> logs/emulator.log 2>&1 &
- ${ANDROID_HOME}/emulator/emulator -avd $emulator_name -port $emulator_adb_port -no-window -no-audio >> logs/emulator.log 2>&1 &
- .gitlab-ci-files/wait-for-android-emulator -d emulator-$emulator_adb_port -m start
- ${ANDROID_HOME}/platform-tools/adb -s emulator-$emulator_adb_port logcat -d > logs/logcats.log

View file

@ -140,7 +140,7 @@ adb logcat -d | ndk-stack -sym ./libs-debug/arm64-v8a/
```
If you don't know the CPU architecture, use the following instead:
```
adb logcat -d | ndk-stack -sym ./libs-debug/`adb shell getprop ro.product.cpu.abi | tr -d '\r'`
adb logcat -d | ndk-stack -sym ./libs-debug/`adb shell getprop ro.product.cpu.abi | tr -d '\r'`
```
Warning: This command won't print anything until you reproduce the crash!
@ -173,6 +173,20 @@ Due to the full app rewrite we can't re-use previous translations, so we'll be v
<img src="https://weblate.linphone.org/widgets/linphone/-/linphone-android/multi-auto.svg" alt="Translation status" />
</a>
# Instrumented UI tests
Linphone-Android UI Tests include screenshot comparison with the git submodule [`screport`](https://gitlab.linphone.org/BC/public/screport/-/tree/main). The project must be cloned with the `--recursive` option. After updating or switching branches, never forget to checkout and update the submodules with:
git submodule update --init
If you have Android Studio, simply open the project and run Instrumented UI tests.
If you don't have Android Studio, you can run :
./gradlew connectedAndroidTest
Android Instrumented UI tests wiki : https://wiki.linphone.org/xwiki/wiki/public/view/Linphone/
# CONTRIBUTIONS
In order to submit a patch for inclusion in linphone's source code:

View file

@ -30,6 +30,8 @@ object CallViewUITestsMethods {
var appAccountAuthInfo: AuthInfo = UITestsCoreManager.instance.appAccountAuthInfo
var ghostAccount: UITestsRegisteredLinphoneCore = UITestsCoreManager.instance.ghostAccounts[0]
var callTimeChecker: Job? = null
fun refreshAccountInfo() {
appAccountAuthInfo = UITestsCoreManager.instance.appAccountAuthInfo
ghostAccount = UITestsCoreManager.instance.ghostAccounts[0]
@ -51,10 +53,11 @@ object CallViewUITestsMethods {
onView(withContentDescription(R.string.content_description_start_call)).perform(click())
onView(withId(R.id.outgoing_call_layout)).checkWithTimeout(matches(isDisplayed()), 5.0)
checkCallTime(onView(withId(R.id.outgoing_call_timer)))
callTimeChecker = checkCallTime(onView(withId(R.id.outgoing_call_timer)))
}
fun endCall(currentView: ViewInteraction? = null) {
runBlocking { callTimeChecker?.join() }
if (ghostAccount.callState == Call.State.Released) { return }
ghostAccount.terminateCall()
@ -75,7 +78,7 @@ object CallViewUITestsMethods {
}
delay(1000)
}
assert(timerArray.distinct().size >= 2) { "[UITests] Call Time is not correctly incremented, less than 2 differents values are displayed in 3 seconds" }
assert(timerArray.distinct().size >= 2) { "[UITests] Call Time is not correctly incremented, less than 2 different values are displayed in 3 seconds" }
assert(timerArray == timerArray.sorted()) { "[UITests] Call Time is not correctly incremented, it is not increasing" }
assert(timerArray.first() <= firstValue + 3) { "[UITests] Call Time is not correctly initialized, it is at ${timerArray.first()}, $firstValue seconds after the start)" }
}