Beispiel #1
0
        public void TestPageTitle()
        {
            // Test Data
            string expectedPageTitle = "Wikipedia, the free encyclopedia";

            GenericMethods.LoadPage(webapplication);                // Load the Wikipedia page
            string actualPageTitle = GenericMethods.GetPageTitle(); // Get the title of the page

            CustomValidator.AreEquals(expectedPageTitle, actualPageTitle, "Page title Mismatched");
        }
Beispiel #2
0
        public void TestDidYouMeanSuggestion()
        {
            // Test Data
            string searchString   = "furry rabbits";
            string expectedString = "Did you mean: fury rabbit";

            GenericMethods.LoadPage(webapplication);     // Load the Wikipedia page
            WikipediaMainPage.InputSearch(searchString); // Search string to the input box and click search
            string actualSuggestionString = SearchResultsPage.GetSuggestionString();

            CustomValidator.AreEquals(expectedString, actualSuggestionString, "Suggestion String mismatched");
        }
Beispiel #3
0
        public void TestFirstResultTitleAndContentTable()
        {
            // Test Data
            string suggestionString      = "furry rabbits";
            string selectResultIndex     = "1"; // Select First Link from the result info
            string expectedAarticleTitle = "Furry fandom - Wikipedia";

            GenericMethods.LoadPage(webapplication);                       // Load the Wikipedia page
            WikipediaMainPage.InputSearch(suggestionString);               // Input search string to the input box and click search
            SearchResultsPage.selectGivenResultLink(selectResultIndex);    // Select the first article
            string actualArticlePageTitle = GenericMethods.GetPageTitle(); // Title of the page

            CustomValidator.AreEquals(expectedAarticleTitle, actualArticlePageTitle, "Title mismatched");
            ArticlePage.CheckTableOfContents(); // Verify the Table of Content on article page.
        }
Beispiel #4
0
        public void TestSearchResultsCount()
        {
            // Test Data
            string suggestionString    = "furry rabbits";
            string expectedResultInfo  = "1 – 21";
            int    expectedResultCount = 20;

            GenericMethods.LoadPage(webapplication);         // Load the Wikipedia page
            WikipediaMainPage.InputSearch(suggestionString); // Input search string to the input box and click search
            string resultInfo = SearchResultsPage.GetResultInfo();

            CustomValidator.AreEquals(expectedResultInfo, resultInfo, "Result info mismatched");
            int actualResultCount = SearchResultsPage.GetCountOfSearchResult(); // ResultInfo count

            CustomValidator.AreEquals(expectedResultCount, actualResultCount,
                                      "Expected search result count is mismatched to actual");
        }
Beispiel #5
0
        public void TestArticlesSlider()
        {
            // Test Data
            int width  = 550;   // size in pixels
            int height = 800;   // size in pixels
            // Slider data
            List <string> sliderHeading = new List <string>(new string[] { "Travelex Money Card",
                                                                           "International money transfer", "Buy foreign currency", "Track rates" });

            GenericMethods.LoadPage(webapplication); // Load the Wikipedia page
            GenericMethods.resizePage(width, height);
            string headingArticle = HomePage.DefaultArticleOnDisplay();

            CustomValidator.AreEquals(sliderHeading[0], headingArticle, "Default Article Mismatched");
            // Verify heading of each article after sliding left
            for (int i = 1; i < sliderHeading.Count; i++)
            {
                headingArticle = HomePage.SlideLeftAndGetTheLandingSlide();
                CustomValidator.AreEquals(sliderHeading[i], headingArticle, "After Slide Arrticle Mismatched");
            }
        }