summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-03-20 18:42:01 +0100
committerParménides GV <parmegv@sdf.org>2014-03-20 18:42:01 +0100
commit853090cabc32f8899e550ca2b85f8155967b4d6c (patch)
tree4f4222306daf1e53290bb738994fe8016dfeb62f /tests
parent47ee09203766694fbdb91fd0c0d56268ecd39448 (diff)
Tests for Dashboard pass.
Setting the mobile data connection off cuts the connection from the computer to the emulator, so ant nor adb will see everything's well unless you comment that part of the tests (testDashboard:52-60).
Diffstat (limited to 'tests')
-rw-r--r--tests/src/se/leap/bitmaskclient/test/testDashboard.java29
1 files changed, 12 insertions, 17 deletions
diff --git a/tests/src/se/leap/bitmaskclient/test/testDashboard.java b/tests/src/se/leap/bitmaskclient/test/testDashboard.java
index a1d1ffac..269f1d18 100644
--- a/tests/src/se/leap/bitmaskclient/test/testDashboard.java
+++ b/tests/src/se/leap/bitmaskclient/test/testDashboard.java
@@ -12,7 +12,6 @@ import se.leap.bitmaskclient.ConfigurationWizard;
import se.leap.bitmaskclient.Dashboard;
import se.leap.bitmaskclient.R;
import se.leap.bitmaskclient.test.ConnectionManager;
-import se.leap.openvpn.MainActivity;
public class testDashboard extends ActivityInstrumentationTestCase2<Dashboard> {
@@ -40,24 +39,25 @@ public class testDashboard extends ActivityInstrumentationTestCase2<Dashboard> {
*/
public void testOnOffOpenVpn() {
solo.clickOnView(solo.getView(R.id.eipSwitch));
- if(!solo.waitForText("Initiating connection"))
+ if(!solo.waitForText(getActivity().getString(R.string.eip_status_start_pending)))
fail();
- if(!solo.waitForText("Authenticating"))
+ if(!solo.waitForText(getActivity().getString(R.string.state_auth)))
fail();
- if(!solo.waitForText("Connection Secure", 1, 30*1000))
+ if(!solo.waitForText(getActivity().getString(R.string.eip_state_connected), 1, 30*1000))
fail();
solo.clickOnView(solo.getView(R.id.eipSwitch));
- if(!solo.waitForText("Not running! Connection not secure"))
+ if(!solo.waitForText(getActivity().getString(R.string.eip_state_not_connected)))
fail();
-
+
ConnectionManager.setMobileDataEnabled(false, solo.getCurrentActivity().getApplicationContext());
solo.clickOnView(solo.getView(R.id.eipSwitch));
- if(!solo.waitForText("Initiating connection"))
+ if(!solo.waitForText(getActivity().getString(R.string.eip_status_start_pending)))
fail();
- if(!solo.waitForText("Waiting for usable network"))
+ if(!solo.waitForText(getActivity().getString(R.string.state_nonetwork)))
fail();
+
}
public void testLogInAndOut() {
@@ -68,7 +68,7 @@ public class testDashboard extends ActivityInstrumentationTestCase2<Dashboard> {
solo.clickOnText("Log In");
solo.waitForDialogToClose();
solo.waitForDialogToClose(miliseconds_to_log_in);
- if(!solo.waitForText("Your own cert has been correctly downloaded."))
+ if(!solo.waitForText(getActivity().getString(R.string.succesful_authentication_message)))
fail();
solo.clickOnActionBarItem(R.string.logout_button);
@@ -76,24 +76,19 @@ public class testDashboard extends ActivityInstrumentationTestCase2<Dashboard> {
fail();
}
- public void testShowSettings() {
- solo.clickOnActionBarItem(R.id.menu_settings);
- }
-
public void testShowAbout() {
- solo.clickOnMenuItem("About");
+ solo.clickOnMenuItem(getActivity().getString(R.string.about));
solo.waitForText(getActivity().getString(R.string.repository_url_text));
solo.goBack();
- solo.clickOnMenuItem("About");
+ solo.clickOnMenuItem(getActivity().getString(R.string.about));
solo.waitForText(getActivity().getString(R.string.repository_url_text));
solo.goBack();
}
public void testSwitchProvider() {
- solo.clickOnMenuItem("Switch provider");
+ solo.clickOnMenuItem(getActivity().getString(R.string.switch_provider_menu_option));
solo.waitForActivity(ConfigurationWizard.class);
solo.goBack();
}
- }
}