Set the clearPackageData=true for UI tests

This commit is contained in:
msurmacz 2022-01-05 14:58:07 +01:00 committed by Maciej Surmacz
parent 7cd704679e
commit 3137180de9
4 changed files with 6 additions and 3 deletions

View File

@ -130,6 +130,7 @@ firebase ui tests:
--device model=Pixel2,version=29
--test-targets "class ch.protonmail.android.uitests.tests.suites.SmokeSuite"
--use-orchestrator
--environment-variables clearPackageData=true
--num-flaky-test-attempts=1
--timeout 45m
@ -164,6 +165,7 @@ firebase feature tests:
--device model=$MODEL,version=$API_LEVEL
--test-targets "class ch.protonmail.android.uitests.tests.$TEST_CLASS"
--use-orchestrator
--environment-variables clearPackageData=true
--num-flaky-test-attempts=1
--timeout 45m
--client-details testType=$TEST_TYPE,testSuite=$TEST_CLASS,commitBranch=$CI_COMMIT_BRANCH,gitlabJobUrl=$CI_JOB_URL

View File

@ -36,6 +36,7 @@ import ch.protonmail.android.uitests.robots.mailbox.search.SearchRobot
import ch.protonmail.android.uitests.robots.menu.MenuRobot
import ch.protonmail.android.uitests.testsHelper.StringUtils
import ch.protonmail.android.uitests.testsHelper.UICustomViewActions.TIMEOUT_30S
import ch.protonmail.android.uitests.testsHelper.UICustomViewActions.TIMEOUT_60S
import ch.protonmail.android.uitests.testsHelper.UICustomViewActions.saveMessageSubject
import me.proton.core.test.android.instrumented.Robot
@ -74,13 +75,13 @@ interface MailboxRobotInterface : Robot {
}
fun compose(): ComposerRobot {
view.withId(R.id.composeImageButton).waitForCondition({ view.isDisabled().viewMatcher() }, TIMEOUT_30S)
view.withId(R.id.composeImageButton).waitForCondition({ view.isCompletelyDisplayed().viewMatcher() }, watchTimeout = TIMEOUT_60S)
view.withId(R.id.composeImageButton).click()
return ComposerRobot()
}
fun menuDrawer(): MenuRobot {
view.waitForCondition({ view.withId(drawerLayoutId).isDisabled().viewMatcher() }, TIMEOUT_30S)
view.waitForCondition({ view.withId(drawerLayoutId).isCompletelyDisplayed().viewMatcher() }, TIMEOUT_60S)
view.withId(drawerLayoutId).openDrawer()
return MenuRobot()
}

View File

@ -103,7 +103,6 @@ open class BaseTest {
val isFirstRun = sharedPrefs.getBoolean(oneTimeRunFlag, true)
if (isFirstRun) {
setupDeviceLocally(false)
Shell.setupDevice(true)
prepareArtifactsDir(artifactsPath)
prepareArtifactsDir(downloadArtifactsPath)
deleteDownloadArtifactsFolder()

View File

@ -38,6 +38,7 @@ import kotlin.test.assertFalse
object UICustomViewActions {
const val TIMEOUT_60S = 60_000L
const val TIMEOUT_30S = 30_000L
const val TIMEOUT_15S = 15_000L
const val TIMEOUT_10S = 10_000L