public void TC008_Menu_Edit_Location_Screen_Open_with_CorrectContent_User_touch_Edit_Location_Menu_Option(string element, string expectedText, string by) { if (stepMenuOptions.verify_menu_displayed() == false) { Assert.That(stepMenuOptions.click_menu_button_by_class(), Is.True, "Menu Button is not found"); } Assert.That(stepMenuOptions.click_edit_location_button_by_id(), Is.True, "Edit Location button cannot be found"); if (by.ToLower().Equals("id")) { Assert.That(stepEditLocation.verify_element_displayed_edit_location_screen_by_id(element), Is.True, element + " is not displayed in the edit screen"); Assert.That(stepEditLocation.get_element_edit_location_screen_text_element_by_id(element), Is.EqualTo(expectedText), element + " is displayed with the incorrect text"); } else if (by.ToLower().Equals("xpath")) { Assert.That(stepEditLocation.verify_element_displayed_edit_location_screen_by_xpath(element), Is.True, element + " is not displayed in the edit screen"); Assert.That(stepEditLocation.get_element_edit_location_screen_text_element_by_xpath(element), Is.EqualTo(expectedText), element + " is displayed with the incorrect text"); } else if (by.ToLower().Equals("class")) { Assert.That(stepEditLocation.verify_element_displayed_tool_bar_edit_location_screen_by_class(element), Is.True, element + " is not displayed in the edit screen"); Assert.That(stepEditLocation.get_text_element_displayed_tool_bar_edit_location_screen_by_class(element), Is.EqualTo(expectedText), element + " is displayed with the incorrect text"); } else { Assert.False(false, "Type of search element provided is incorrect. Test was not completed"); } }
public void TC015_Edit_Location_Delete_Location_When_It_Is_Swipped_Left(string screen) { if (stepMenuOptions.verify_menu_displayed() == false) { Assert.That(stepMenuOptions.click_menu_button_by_class(), Is.True, "Menu Button is not found"); } int num_locations_added_in_menu = stepMenuOptions.get_amount_of_elements_location_list_by_id(); Assert.That(stepMenuOptions.click_edit_location_button_by_id(), Is.True, "Edit Location button is not found"); Assert.That(stepEditLocation.verify_element_displayed_edit_location_screen_by_id("editlist"), Is.True, "Location list is not displyaed"); int num_locations_added_in_edit = stepEditLocation.get_amount_of_elements_location_list_by_class(); Assert.That(num_locations_added_in_edit, Is.GreaterThan(1), "There is no enough locations to test a delete operation"); Assert.That(stepEditLocation.swipe_location_to_delete_by_class(num_locations_added_in_edit - 1), Is.True, "The element cannot be swipped"); if (screen.ToLower().Equals("Menu".ToLower())) { stepEditLocation.click_back_android_button(); Assert.That(num_locations_added_in_menu - 1, Is.EqualTo(stepMenuOptions.get_amount_of_elements_location_list_by_id()), "The element is not deleted in " + screen); } else if (screen.ToLower().Equals("Edit".ToLower())) { Assert.That(num_locations_added_in_edit - 1, Is.EqualTo(stepEditLocation.get_amount_of_elements_location_list_by_class()), "The element is not deleted in " + screen); } else { Assert.False(false, "The screen to verify that the element is deleted is not found"); } }