-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'migrate-more-test-classes-to-POP'
- Loading branch information
Showing
10 changed files
with
164 additions
and
73 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
16 changes: 16 additions & 0 deletions
16
android/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/AccountPage.kt
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,16 @@ | ||
package net.mullvad.mullvadvpn.test.common.page | ||
|
||
import androidx.test.uiautomator.By | ||
import net.mullvad.mullvadvpn.test.common.extension.findObjectWithTimeout | ||
|
||
class AccountPage internal constructor() : Page() { | ||
private val logOutSelector = By.text("Log out") | ||
|
||
override fun assertIsDisplayed() { | ||
uiDevice.findObjectWithTimeout(By.text("Account")) | ||
} | ||
|
||
fun clickLogOut() { | ||
uiDevice.findObjectWithTimeout(logOutSelector).click() | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
...oid/test/common/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/MullvadWebsite.kt
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,14 @@ | ||
package net.mullvad.mullvadvpn.test.common.page | ||
|
||
import androidx.test.uiautomator.By | ||
import net.mullvad.mullvadvpn.test.common.constant.VERY_LONG_TIMEOUT | ||
import net.mullvad.mullvadvpn.test.common.extension.findObjectWithTimeout | ||
|
||
class MullvadWebsite internal constructor() : Page() { | ||
override fun assertIsDisplayed() { | ||
uiDevice.findObjectWithTimeout( | ||
selector = By.text("Mullvad help center"), | ||
timeout = VERY_LONG_TIMEOUT, | ||
) | ||
} | ||
} |
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
30 changes: 30 additions & 0 deletions
30
...mmon/src/main/kotlin/net/mullvad/mullvadvpn/test/common/page/WireGuardCustomPortDialog.kt
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,30 @@ | ||
package net.mullvad.mullvadvpn.test.common.page | ||
|
||
import androidx.test.uiautomator.By | ||
import net.mullvad.mullvadvpn.test.common.extension.findObjectWithTimeout | ||
|
||
class WireGuardCustomPortDialog internal constructor() : Page() { | ||
private val textFieldLabelSelector = By.text("Enter port") | ||
private val setPortSelector = By.text("Set port") | ||
private val cancelSelector = By.text("Cancel") | ||
|
||
override fun assertIsDisplayed() { | ||
uiDevice.findObjectWithTimeout(textFieldLabelSelector) | ||
} | ||
|
||
fun enterCustomPort(port: String) { | ||
uiDevice.findObjectWithTimeout(textFieldLabelSelector).parent.text = port | ||
} | ||
|
||
fun clickSetPort() { | ||
uiDevice.findObjectWithTimeout(setPortSelector).click() | ||
} | ||
|
||
fun clickCancel() { | ||
uiDevice.findObjectWithTimeout(cancelSelector).click() | ||
} | ||
|
||
companion object { | ||
const val TEXT_FIELD_TEST_TAG = "custom_port_dialog_input_test_tag" | ||
} | ||
} |
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
27 changes: 9 additions & 18 deletions
27
android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/WebLinkTest.kt
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 |
---|---|---|
@@ -1,31 +1,22 @@ | ||
package net.mullvad.mullvadvpn.test.e2e | ||
|
||
import androidx.test.uiautomator.By | ||
import net.mullvad.mullvadvpn.test.common.annotation.SkipForFlavors | ||
import net.mullvad.mullvadvpn.test.common.constant.VERY_LONG_TIMEOUT | ||
import net.mullvad.mullvadvpn.test.common.extension.clickAgreeOnPrivacyDisclaimer | ||
import net.mullvad.mullvadvpn.test.common.extension.clickAllowOnNotificationPermissionPromptIfApiLevel33AndAbove | ||
import net.mullvad.mullvadvpn.test.common.extension.findObjectWithTimeout | ||
import net.mullvad.mullvadvpn.test.common.page.MullvadWebsite | ||
import net.mullvad.mullvadvpn.test.common.page.SettingsPage | ||
import net.mullvad.mullvadvpn.test.common.page.TopBar | ||
import net.mullvad.mullvadvpn.test.common.page.on | ||
import org.junit.jupiter.api.Test | ||
|
||
class WebLinkTest : EndToEndTest(BuildConfig.FLAVOR_infrastructure) { | ||
@Test | ||
@SkipForFlavors(currentFlavor = BuildConfig.FLAVOR_billing, "play") | ||
fun testOpenFaqFromApp() { | ||
// Given | ||
app.launch() | ||
app.launchAndEnsureOnLoginPage() | ||
|
||
// When | ||
device.clickAgreeOnPrivacyDisclaimer() | ||
device.clickAllowOnNotificationPermissionPromptIfApiLevel33AndAbove() | ||
device.findObjectWithTimeout(By.text("Login")) | ||
app.clickSettingsCog() | ||
app.clickListItemByText("FAQs & Guides") | ||
on<TopBar> { clickSettings() } | ||
|
||
// Then | ||
device.findObjectWithTimeout( | ||
selector = By.text("Mullvad help center"), | ||
timeout = VERY_LONG_TIMEOUT, | ||
) | ||
on<SettingsPage> { clickFaqAndGuides() } | ||
|
||
on<MullvadWebsite>() | ||
} | ||
} |