diff options
Diffstat (limited to 'android/test')
2 files changed, 6 insertions, 3 deletions
diff --git a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/misc/CaptureScreenRecordingsExtension.kt b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/misc/CaptureScreenRecordingsExtension.kt index de804ccb8e..9f9cf46091 100644 --- a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/misc/CaptureScreenRecordingsExtension.kt +++ b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/misc/CaptureScreenRecordingsExtension.kt @@ -2,6 +2,7 @@ package net.mullvad.mullvadvpn.test.common.misc import android.os.Environment import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation import androidx.test.uiautomator.UiDevice import co.touchlab.kermit.Logger import java.io.File @@ -40,13 +41,15 @@ class CaptureScreenRecordingsExtension : BeforeEachCallback, AfterEachCallback { job = coroutineScope.launch { - device.executeShellCommand("screenrecord $OUTPUT_DIRECTORY/$fileName") + getInstrumentation() + .uiAutomation + .executeShellCommand("screenrecord $OUTPUT_DIRECTORY/$fileName") } } private fun stopScreenRecord() { try { - device.executeShellCommand("pkill -2 screenrecord") + getInstrumentation().uiAutomation.executeShellCommand("pkill -2 screenrecord") runBlocking { job.join() } } catch (e: Exception) { Logger.e("Failed to stop recording", e) diff --git a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/WireGuardCustomPortDialog.kt b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/WireGuardCustomPortDialog.kt index 2966cdeccf..55ea6c18c2 100644 --- a/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/WireGuardCustomPortDialog.kt +++ b/android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/WireGuardCustomPortDialog.kt @@ -13,7 +13,7 @@ class WireGuardCustomPortDialog internal constructor() : Page() { } fun enterCustomPort(port: String) { - uiDevice.findObjectWithTimeout(textFieldLabelSelector).parent.text = port + uiDevice.findObjectWithTimeout(textFieldLabelSelector).parent.parent.text = port } fun clickSetPort() { |
