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"); } }
public void TC014_Add_Location_Add_New_Location(string location) { if (stepMenuOptions.verify_menu_displayed() == false) { Assert.That(stepMenuOptions.click_menu_button_by_class(), Is.True, "Menu Button is not found"); } int cant_locations_before = stepMenuOptions.get_amount_of_elements_location_list_by_id(); Assert.That(stepMenuOptions.click_add_location_button_by_id(), Is.True, "Add Location button is not found"); Assert.That(stepAddLocation.fill_up_serch_text_field(location), Is.True, "The text field cannot be found"); Assert.That(stepAddLocation.click_search_result_by_index(0), Is.True, "Results are not found"); Assert.That(stepMenuOptions.get_amount_of_elements_location_list_by_id(), Is.EqualTo(cant_locations_before + 1), "The location is not created"); }