diff options
Diffstat (limited to 'app/src/androidTest')
5 files changed, 20 insertions, 26 deletions
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/BaseTestDashboardFragment.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/BaseTestDashboardFragment.java index d0b8cf6f..956049dc 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/BaseTestDashboardFragment.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/BaseTestDashboardFragment.java @@ -84,7 +84,7 @@ public abstract class BaseTestDashboardFragment extends ActivityInstrumentationT } private void waitForProviderDetails() { - String text = solo.getString(R.string.provider_details_fragment_title); + String text = solo.getString(R.string.provider_details_title); assertTrue("Provider details dialog did not appear", solo.waitForText(text, 1, 60*1000)); Screenshot.take("Provider details"); } diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestConfigurationWizard.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestConfigurationWizard.java index 12e88af8..c0d3aab1 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestConfigurationWizard.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestConfigurationWizard.java @@ -7,7 +7,6 @@ import com.robotium.solo.Solo; import java.io.IOException; -import se.leap.bitmaskclient.AboutActivity; import se.leap.bitmaskclient.ConfigurationWizard; import se.leap.bitmaskclient.R; @@ -71,7 +70,7 @@ public class TestConfigurationWizard extends ActivityInstrumentationTestCase2<Co } private void waitForProviderDetails() { - String text = solo.getString(R.string.provider_details_fragment_title); + String text = solo.getString(R.string.provider_details_title); assertTrue("Provider details dialog did not appear", solo.waitForText(text, 1, 60*1000)); Screenshot.take("Provider details"); } @@ -112,14 +111,4 @@ public class TestConfigurationWizard extends ActivityInstrumentationTestCase2<Co assertTrue("Provider details dialog did not appear", solo.waitForText(text, 1, 60*1000)); } - public void testShowAbout() { - showAbout(); - } - - private void showAbout() { - String text = solo.getString(R.string.about); - solo.clickOnMenuItem(text); - assertTrue("Provider details dialog did not appear", solo.waitForActivity(AboutActivity.class)); - } - } 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 fc763c7d..4c215360 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java @@ -17,12 +17,17 @@ package se.leap.bitmaskclient.test; -import android.content.*; -import android.test.*; -import android.test.suitebuilder.annotation.*; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.test.ServiceTestCase; +import android.test.suitebuilder.annotation.MediumTest; -import se.leap.bitmaskclient.*; -import se.leap.bitmaskclient.eip.*; +import se.leap.bitmaskclient.eip.EIP; + +import static se.leap.bitmaskclient.Constants.EIP_ACTION_CHECK_CERT_VALIDITY; +import static se.leap.bitmaskclient.Constants.PROVIDER_VPN_CERTIFICATE; +import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES; /** * @author parmegv @@ -37,7 +42,7 @@ public class TestEIP extends ServiceTestCase<EIP> { super(activityClass); context = getSystemContext(); intent = new Intent(context, EIP.class); - preferences = context.getSharedPreferences(Constants.SHARED_PREFERENCES, Context.MODE_PRIVATE); + preferences = context.getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE); } @Override @@ -59,14 +64,14 @@ public class TestEIP extends ServiceTestCase<EIP> { } private void testEmptyCertificate() { - preferences.edit().putString(Constants.PROVIDER_VPN_CERTIFICATE, "").apply(); - startService(Constants.EIP_ACTION_CHECK_CERT_VALIDITY); + preferences.edit().putString(PROVIDER_VPN_CERTIFICATE, "").apply(); + startService(EIP_ACTION_CHECK_CERT_VALIDITY); } private void testExpiredCertificate() { String expired_certificate = "expired certificate"; - preferences.edit().putString(Constants.PROVIDER_VPN_CERTIFICATE, expired_certificate).apply(); - startService(Constants.EIP_ACTION_CHECK_CERT_VALIDITY); + preferences.edit().putString(PROVIDER_VPN_CERTIFICATE, expired_certificate).apply(); + startService(EIP_ACTION_CHECK_CERT_VALIDITY); } private void startService(String action) { diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestGatewaysManager.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestGatewaysManager.java index b8cc9715..02c521be 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestGatewaysManager.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestGatewaysManager.java @@ -25,9 +25,10 @@ import org.json.*; import java.io.IOException; import java.util.Arrays; -import se.leap.bitmaskclient.Constants; import se.leap.bitmaskclient.eip.*; +import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES; + /** * @author parmegv */ @@ -109,7 +110,7 @@ public class TestGatewaysManager extends InstrumentationTestCase { private void mockGatewaysManager() { context = getInstrumentation().getContext(); - preferences = context.getSharedPreferences(Constants.SHARED_PREFERENCES, Activity.MODE_PRIVATE); + preferences = context.getSharedPreferences(SHARED_PREFERENCES, Activity.MODE_PRIVATE); gateways_manager = new GatewaysManager(context, preferences); } 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 4c6a6370..f6760161 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java @@ -6,7 +6,6 @@ import android.widget.Button; import com.robotium.solo.Condition; import com.robotium.solo.Solo; -import de.blinkt.openvpn.activities.DisconnectVPN; import mbanje.kurt.fabbutton.ProgressRingView; import se.leap.bitmaskclient.Dashboard; import se.leap.bitmaskclient.R; |