From 853090cabc32f8899e550ca2b85f8155967b4d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 20 Mar 2014 18:42:01 +0100 Subject: 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). --- .../se/leap/bitmaskclient/test/testDashboard.java | 29 +++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'tests/src/se/leap/bitmaskclient/test') 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 { @@ -40,24 +39,25 @@ public class testDashboard extends ActivityInstrumentationTestCase2 { */ 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 { 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 { 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(); } - } } -- cgit v1.2.3