summaryrefslogtreecommitdiff
path: root/app/src/androidTest/java/se
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2017-10-28 20:41:05 +0200
committercyBerta <cyberta@riseup.net>2017-10-28 20:41:05 +0200
commit68bc106ee872b13830dfa5fa9794f7cecb306d8e (patch)
tree2136a5de03072b9b2e28fd6699cfbd7aecbe812a /app/src/androidTest/java/se
parentc37149dec7dbc2ff2bccfa643792080c3c86ce18 (diff)
#8757 refactores ProviderAPI for insecure flavor, fixes tests, renames confusing constants, updates robotium
Diffstat (limited to 'app/src/androidTest/java/se')
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java4
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnFragment.java2
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/UserStatusTestController.java3
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java2
4 files changed, 6 insertions, 5 deletions
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<EIP> {
}
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();