From 68bc106ee872b13830dfa5fa9794f7cecb306d8e Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sat, 28 Oct 2017 20:41:05 +0200 Subject: #8757 refactores ProviderAPI for insecure flavor, fixes tests, renames confusing constants, updates robotium --- app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java | 4 ++-- .../androidTest/java/se/leap/bitmaskclient/test/TestVpnFragment.java | 2 +- .../java/se/leap/bitmaskclient/test/UserStatusTestController.java | 3 ++- .../java/se/leap/bitmaskclient/test/VpnTestController.java | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'app/src/androidTest/java') diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java index 1a32e1c9..15bb53e1 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java @@ -59,13 +59,13 @@ public class TestEIP extends ServiceTestCase { } private void testEmptyCertificate() { - preferences.edit().putString(Constants.CERTIFICATE, "").apply(); + preferences.edit().putString(Constants.VPN_CERTIFICATE, "").apply(); startService(Constants.ACTION_CHECK_CERT_VALIDITY); } private void testExpiredCertificate() { String expired_certificate = "expired certificate"; - preferences.edit().putString(Constants.CERTIFICATE, expired_certificate).apply(); + preferences.edit().putString(Constants.VPN_CERTIFICATE, expired_certificate).apply(); startService(Constants.ACTION_CHECK_CERT_VALIDITY); } diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnFragment.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnFragment.java index b16bcf4f..564e251c 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnFragment.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnFragment.java @@ -60,7 +60,7 @@ public class TestVpnFragment extends BaseTestDashboardFragment { private void checkProvider(String provider) { changeProviderAndLogIn(provider); vpn_controller.sleepSeconds(1); - vpn_controller.turnVpnOndAndOff(); + vpn_controller.turnVpnOnAndOff(); vpn_controller.sleepSeconds(1); } diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/UserStatusTestController.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/UserStatusTestController.java index 76d14911..f5cb2260 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/UserStatusTestController.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/UserStatusTestController.java @@ -30,7 +30,8 @@ public class UserStatusTestController { void logIn(String username, String password, boolean expectSuccess) { solo.enterText(0, username); solo.enterText(1, password); - solo.clickOnButton(solo.getString(R.string.login_button)); + // https://stackoverflow.com/questions/33560746/how-to-test-alertdialog-item-click-in-robotium-for-android-studio + solo.clickOnView(solo.getView(android.R.id.button1)); assertTrue(solo.waitForDialogToClose()); if (expectSuccess) { diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java index 93b1da47..f76ba93b 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java @@ -22,7 +22,7 @@ public class VpnTestController { this.solo = solo; } - protected void turnVpnOndAndOff() { + protected void turnVpnOnAndOff() { clickVpnButton(); turningEipOn(); clickVpnButton(); -- cgit v1.2.3