diff --git a/app/src/androidTest/java/helpers/ActionHelpers.kt b/app/src/androidTest/java/helpers/ActionHelpers.kt index ce17746..97fd4db 100644 --- a/app/src/androidTest/java/helpers/ActionHelpers.kt +++ b/app/src/androidTest/java/helpers/ActionHelpers.kt @@ -2,6 +2,8 @@ package com.privateinternetaccess.android.helpers import androidx.test.uiautomator.UiObject import com.privateinternetaccess.android.core.BaseUiAutomatorClass.Companion.defaultTimeOut +import com.privateinternetaccess.android.screens.objects.MainScreenPageObjects +import com.privateinternetaccess.android.screens.steps.GeneralStepObjects import com.privateinternetaccess.android.screens.steps.SideMenuStepObjects import com.privateinternetaccess.android.screens.steps.SignInStepObjects import com.privateinternetaccess.android.screens.steps.MainScreenStepObjects @@ -15,7 +17,6 @@ object ActionHelpers { } fun inputTextInField(field: UiObject, data: T? = null) { - field.clearTextField() field.click() field.text = data?.toString() ?: "" } @@ -40,4 +41,10 @@ object ActionHelpers { MainScreenStepObjects().clickOnHamburgerMenu() SideMenuStepObjects().clickOnLogout() } + + fun returnOnMainScreen() { + while (!MainScreenPageObjects().connectButton.exists()) { + GeneralStepObjects().clickOnBackArrow() + } + } } \ No newline at end of file diff --git a/app/src/androidTest/java/tests/SignOutTests.kt b/app/src/androidTest/java/tests/SignOutTests.kt index 1cc65b3..dbcf096 100644 --- a/app/src/androidTest/java/tests/SignOutTests.kt +++ b/app/src/androidTest/java/tests/SignOutTests.kt @@ -4,23 +4,23 @@ import com.privateinternetaccess.android.core.BaseUiAutomatorClass import com.privateinternetaccess.android.helpers.ActionHelpers.successfulLogin import com.privateinternetaccess.android.helpers.ActionHelpers.goToSettings import com.privateinternetaccess.android.helpers.ActionHelpers.successfulLgout +import com.privateinternetaccess.android.helpers.ActionHelpers.returnOnMainScreen import com.privateinternetaccess.android.screens.objects.SettingsPageObjects import com.privateinternetaccess.android.screens.steps.GeneralStepObjects import com.privateinternetaccess.android.screens.objects.GeneralPageObjects - import org.junit.Test class SignOutTests : BaseUiAutomatorClass() { private val settingsPageObjects = SettingsPageObjects() private val generalStepObjects = GeneralStepObjects() + @Test fun validatingDefaultSettingsAfterLogout() { successfulLogin() goToSettings(settingsPageObjects.general) generalStepObjects.launchOnSystemStartUp() - generalStepObjects.clickOnBackArrow() - generalStepObjects.clickOnBackArrow() + returnOnMainScreen() successfulLgout() successfulLogin() goToSettings(settingsPageObjects.general)