Skip to content

Commit

Permalink
PIA-638: Add new tests for protocols with small packets enable and di…
Browse files Browse the repository at this point in the history
…sable (#45)

The initial test for this was to test the connectivity of OpenVPN while small packet settings is disabled and
WireGuard small packet settings is enabled. We want to extend the coverage of our tests to make sure that for
the two available protocols have no issue connecting with the vpn whether small packet is enabled or disabled.
  • Loading branch information
kp-ruth-o authored Oct 27, 2023
1 parent 035b3f1 commit efaf5d0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ class ProtocolPageObjects {
val protocolSummarySetting = LocatorHelper.findByResourceId("com.privateinternetaccess.android:id/protocolSummarySetting")
val openVPN = LocatorHelper.findByText("OpenVPN")
val wireGuard = LocatorHelper.findByText("WireGuard")
val smallPacketsSwitchSetting = LocatorHelper.findByResourceId("com.privateinternetaccess.android:id/smallPacketsSwitchSetting")
val save = LocatorHelper.findByResourceId("android:id/button1")
}
34 changes: 32 additions & 2 deletions app/src/androidTest/java/tests/ProtocolConnectivityTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ class ProtocolConnectivityTests : BaseUiAutomatorClass() {
val protocolStepObjects = ProtocolStepObjects()
val mainScreenStepObjects = MainScreenStepObjects()

/* OpenVPN protocol by default has small packets option disabled.
(i) First test scenario is to validate that OpenVPN can connect while small packet is disabled
(ii) Second test is to validate that OpenVPN can connect while small packet is enabled.
*/
@Test
fun openVPNConnectivity() {
fun openVPNConnectivityWhenSmallPacketDisabled() {
successfulLogin()
goToSettings(protocolPageObjects.protocolSettings, protocolPageObjects.protocolSelection)
protocolStepObjects.selectOpenVPN()
Expand All @@ -27,7 +31,33 @@ class ProtocolConnectivityTests : BaseUiAutomatorClass() {
}

@Test
fun wireGuardConnectivity() {
fun openVPNConnectivityWhenSmallPacketEnabled() {
successfulLogin()
goToSettings(protocolPageObjects.protocolSettings, protocolPageObjects.protocolSelection)
protocolStepObjects.selectOpenVPN()
protocolPageObjects.smallPacketsSwitchSetting.click()
returnOnMainScreen()
mainScreenStepObjects.clickConnect()
assert(MainScreenPageObjects().connectButton.contentDescription.equals("VPN Connected"))
}

/* WireGuard protocol by default has small packets enabled.
(i) First test scenario is to validate that WireGuard can connect while small packet is disabled.
(ii) Second test is to validate that WireGuard can connect while small packet is enabled.
*/
@Test
fun wireGuardConnectivityWhenSmallPacketDisabled() {
successfulLogin()
goToSettings(protocolPageObjects.protocolSettings, protocolPageObjects.protocolSelection)
protocolStepObjects.selectWireGuard()
protocolPageObjects.smallPacketsSwitchSetting.click()
returnOnMainScreen()
mainScreenStepObjects.clickConnect()
assert(MainScreenPageObjects().connectButton.contentDescription.equals("VPN Connected"))
}

@Test
fun wireGuardConnectivityWhenSmallPacketEnabled() {
successfulLogin()
goToSettings(protocolPageObjects.protocolSettings, protocolPageObjects.protocolSelection)
protocolStepObjects.selectWireGuard()
Expand Down

0 comments on commit efaf5d0

Please sign in to comment.