use of com.cmput301w18t05.taskzilla.activity.MainActivity in project Taskzilla by CMPUT301W18T05.
the class SearchActivityTest method testSearch.
public void testSearch() {
// Set up for Test
MainActivity activity = (MainActivity) solo.getCurrentActivity();
solo.assertCurrentActivity("Wrong Activity", MainActivity.class);
solo.clickOnText("Sign Up");
solo.assertCurrentActivity("Wrong Activity", SignUpActivity.class);
solo.enterText((EditText) solo.getView(R.id.usernameField), "TestUser");
solo.enterText((EditText) solo.getView(R.id.nameField), "TestName");
solo.enterText((EditText) solo.getView(R.id.emailField), "Test@Email.com");
solo.enterText((EditText) solo.getView(R.id.phoneField), "1234567890");
solo.clickOnButton("Sign Up");
// Correct Log in Info
solo.clearEditText((EditText) solo.getView(R.id.usernameText));
solo.enterText((EditText) solo.getView(R.id.usernameText), "TestUser");
solo.clickOnButton("Log In");
solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
solo.waitForText("Search");
solo.clickOnText("Search");
solo.clickOnView((SearchView) solo.getView(R.id.searchView));
solo.sleep(9000);
// solo.enterText((EditText) solo.getView(R.id.searchView),"Task");
// solo.text
}
use of com.cmput301w18t05.taskzilla.activity.MainActivity in project Taskzilla by CMPUT301W18T05.
the class UserProfileActivityTest method testLogIn.
public void testLogIn() {
// Set up for Test
MainActivity activity = (MainActivity) solo.getCurrentActivity();
solo.assertCurrentActivity("Wrong Activity", MainActivity.class);
solo.clickOnText("Sign Up");
solo.assertCurrentActivity("Wrong Activity", SignUpActivity.class);
solo.enterText((EditText) solo.getView(R.id.usernameField), "TestUser");
solo.enterText((EditText) solo.getView(R.id.nameField), "TestName");
solo.enterText((EditText) solo.getView(R.id.emailField), "Test@Email.com");
solo.enterText((EditText) solo.getView(R.id.phoneField), "1234567890");
solo.clickOnButton("Sign Up");
// No Log in Info
solo.clickOnButton("Log In");
solo.assertCurrentActivity("Wrong Activity", MainActivity.class);
// Incorrect Log in Info
solo.enterText((EditText) solo.getView(R.id.usernameText), "123456789101112131415161718192021222324252627282930");
solo.clickOnButton("Log In");
solo.assertCurrentActivity("Wrong Activity", MainActivity.class);
// Correct Log in Info
solo.clearEditText((EditText) solo.getView(R.id.usernameText));
solo.enterText((EditText) solo.getView(R.id.usernameText), "TestUser");
solo.clickOnButton("Log In");
solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
}
use of com.cmput301w18t05.taskzilla.activity.MainActivity in project Taskzilla by CMPUT301W18T05.
the class MainActivityIntentTest method testLogIn.
public void testLogIn() {
// Set up for Test
MainActivity activity = (MainActivity) solo.getCurrentActivity();
solo.assertCurrentActivity("Wrong Activity", MainActivity.class);
solo.clickOnText("Sign Up");
solo.assertCurrentActivity("Wrong Activity", SignUpActivity.class);
solo.enterText((EditText) solo.getView(R.id.usernameField), "TestUser");
solo.enterText((EditText) solo.getView(R.id.nameField), "TestName");
solo.enterText((EditText) solo.getView(R.id.emailField), "Test@Email.com");
solo.enterText((EditText) solo.getView(R.id.phoneField), "1234567890");
solo.enterText((EditText) solo.getView(R.id.passwordField), "a");
solo.clickOnButton("Sign Up");
// No Log in Info
solo.clickOnButton("Log In");
solo.assertCurrentActivity("Wrong Activity", MainActivity.class);
// Incorrect Log in Info
solo.enterText((EditText) solo.getView(R.id.usernameText), "123456789101112131415161718192021222324252627282930");
solo.clickOnButton("Log In");
solo.assertCurrentActivity("Wrong Activity", MainActivity.class);
// Correct Log in Info
solo.clearEditText((EditText) solo.getView(R.id.usernameText));
solo.enterText((EditText) solo.getView(R.id.usernameText), "TestUser");
solo.enterText((EditText) solo.getView(R.id.passwordText), "a");
solo.clickOnButton("Log In");
solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
assertTrue(solo.waitForActivity(WelcomeActivity.class));
}
use of com.cmput301w18t05.taskzilla.activity.MainActivity in project Taskzilla by CMPUT301W18T05.
the class SearchActivityIntentTest method testSearch.
public void testSearch() {
// Set up for Test
MainActivity activity = (MainActivity) solo.getCurrentActivity();
solo.assertCurrentActivity("Wrong Activity", MainActivity.class);
solo.clickOnText("Sign Up");
solo.assertCurrentActivity("Wrong Activity", SignUpActivity.class);
solo.enterText((EditText) solo.getView(R.id.usernameField), "TestUser");
solo.enterText((EditText) solo.getView(R.id.nameField), "TestName");
solo.enterText((EditText) solo.getView(R.id.emailField), "Test@Email.com");
solo.enterText((EditText) solo.getView(R.id.phoneField), "1234567890");
solo.enterText((EditText) solo.getView(R.id.passwordField), "a");
solo.clickOnButton("Sign Up");
// Correct Log in Info
solo.clearEditText((EditText) solo.getView(R.id.usernameText));
solo.enterText((EditText) solo.getView(R.id.usernameText), "TestUser");
solo.enterText((EditText) solo.getView(R.id.passwordText), "a");
solo.clickOnButton("Log In");
solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
assertTrue(solo.waitForActivity(WelcomeActivity.class));
View fab = solo.getView(R.id.fab);
solo.waitForView(fab);
solo.clickOnView(fab);
solo.waitForActivity(NewTaskActivity.class);
View taskField = solo.getView(R.id.TaskName);
solo.waitForView(taskField);
solo.typeText((EditText) taskField, "taskname");
EditText descriptionField = (EditText) solo.getView(R.id.Description);
solo.typeText(descriptionField, "testing search");
View addButton = solo.getView(R.id.addTaskButton);
solo.clickOnView(addButton);
solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
solo.waitForText("Search");
solo.clickOnText("Search");
}
use of com.cmput301w18t05.taskzilla.activity.MainActivity in project Taskzilla by CMPUT301W18T05.
the class UserTaskActivityIntentTest method testDeleteTask.
public void testDeleteTask() {
MainActivity activity = (MainActivity) solo.getCurrentActivity();
solo.assertCurrentActivity("Wrong Activity", MainActivity.class);
solo.clickOnText("Sign Up");
solo.assertCurrentActivity("Wrong Activity", SignUpActivity.class);
solo.enterText((EditText) solo.getView(R.id.usernameField), "TestUser");
solo.enterText((EditText) solo.getView(R.id.nameField), "TestName");
solo.enterText((EditText) solo.getView(R.id.emailField), "Test@Email.com");
solo.enterText((EditText) solo.getView(R.id.phoneField), "1234567890");
solo.clickOnButton("Sign Up");
solo.enterText((EditText) solo.getView(R.id.usernameText), "TestUser");
solo.clickOnButton("Log In");
solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
// taken from https://stackoverflow.com/questions/33125017/how-to-access-floatingactionmenu-and-floating-action-button-in-robotium
// 2018-3-17
// View v = inflater.inflate(R.layout.fragment_tasks_requester, container, false);
solo.waitForText("Tasks");
View fab = solo.getCurrentActivity().findViewById(R.id.fab);
solo.clickOnView(fab);
solo.assertCurrentActivity("Wrong Activity", NewTaskActivity.class);
solo.enterText((EditText) solo.getView(R.id.TaskName), "Test Task To Be Deleted");
solo.enterText((EditText) solo.getView(R.id.Description), "Test Description");
solo.clickOnButton("Add Task");
solo.waitForActivity(WelcomeActivity.class);
solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
View fab2 = solo.getCurrentActivity().findViewById(R.id.fab);
solo.clickOnView(fab2);
assertTrue(solo.waitForText("Test Task To Be Deleted"));
solo.clickOnText("Test Task To Be Deleted");
solo.assertCurrentActivity("Wrong Activity", ViewTaskActivity.class);
solo.waitForText("Test Task to Be Deleted");
View DeleteButton = solo.getCurrentActivity().findViewById(R.id.DeleteButton);
solo.clickOnView(DeleteButton);
solo.clickOnText(("Yes"));
solo.waitForActivity(WelcomeActivity.class);
solo.assertCurrentActivity("Wrong Activity", WelcomeActivity.class);
}
Aggregations