示例#1
0
 public void TC005_Menu_Button_Open_Menu_With_Correct_Content(string element, string expectedText)
 {
     if (stepMenuOptions.verify_menu_displayed() == true)
     {
         stepMenuOptions.click_back_android_button();
     }
     // driver.FindElementById("com.accuweather.android:id/tool_bar").FindElement(By.ClassName("android.widget.ImageButton")).Click();
     Assert.That(stepMenuOptions.click_menu_button_by_class(), Is.True, "Menu button is not found");
     Assert.That(stepMenuOptions.verify_element_displayed_menu_by_id(element), Is.True, element + " is not displayed in the menu");
     Assert.That(stepMenuOptions.get_element_text_menu_by_id(element), Is.EqualTo(expectedText), element + " is displayed with the incorrect text");
 }
示例#2
0
        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");
            }
        }
示例#3
0
        public void TC010_Add_Location_Suggestions_Location_Displayed_Matches_Text_Entered(string location)
        {
            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_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.verify_element_displayed_add_location_screen_by_id("searchlist"), Is.True, "Suggestion search list is not displayed");
            Assert.That(stepAddLocation.get_amount_location_suggestions(), Is.GreaterThan(0), "There is no suggestions displayed in Suggestion list");

            for (int i = 0; i < stepAddLocation.get_amount_location_suggestions(); i++)
            {
                Assert.That(stepAddLocation.get_string_location_selected_by_index(i).Substring(0, location.Length).ToLower(), Is.EqualTo(location.ToLower()), "Suggestion does not match with the string entered in the text field");
            }
        }
示例#4
0
        public void TC009_Add_Location_Back_button_Display_Previous_Screen()
        {
            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_add_location_button_by_id(), Is.True, "Add Location button is not found");
            Assert.That(stepAddLocation.click_back_button_by_id, Is.True, "Back button is not found");
            Assert.That(stepAddLocation.verify_add_location_screen_displayed, Is.False, "Add location screen is still displayed");

            Assert.That(stepMenuOptions.verify_menu_displayed(), Is.True, "Previous screen is not displayed after touching Back button from Add Location screen");
        }