private void CheckIsEditPageOpened()
        {
            string elementText = Driver.Url.ToString();

            Assertions.AssertIt(() => Assert.AreEqual(elementText, "https://en.wikipedia.org/w/index.php?title=Dropdown&action=edit&editintro=Template:Disambig_editintro"));
            Console.WriteLine("Opened Edit page URL is correct.");
        }
        private void CheckHomePageIsCorrect()
        {
            string elementText = _linkRusId.Text;

            Assertions.AssertIt(() => Assert.AreEqual(elementText, "Русский"));

            Console.WriteLine("PrePage is fully checked.");
        }
        private void CheckPrePageTitleIsCorrect()
        {
            string elementText = Driver.Title;

            Assertions.AssertIt(() => Assert.AreEqual(elementText, "Wikipedia"));

            Console.WriteLine("Page Title '" + elementText + "' is correct.");
        }
        public void CheckingArticlePageHeader(string validText)
        {
            string headerText = _headerID.Text;

            IsSpecialPageOpened(validText);
            Assertions.AssertIt(() => Assert.AreEqual(headerText, validText));
            Console.WriteLine("Article page header (" + headerText + ") is correct.");
        }
Example #5
0
        private static void CheckMainPageIsCorrect(string text)
        {
            string elementText = BasePage.FindElementByID(headerID).Text;

            Console.WriteLine("Element text is: " + elementText);
            Assertions.AssertIt(() => Assert.AreEqual(elementText, text));
            Console.WriteLine("MainPage is fully checked.");
        }
        private static void CheckPrePageIsCorrect()
        {
            string elementText = FindElementByXpath(linkRusId).Text;

            Assertions.AssertIt(() => Assert.AreEqual(elementText, "Русский"));

            Console.WriteLine("PrePage is fully checked.");
        }
        private void Check10LangLinkElements()
        {
            const int number = 10;

            IList <IWebElement> allElements = _langLinksTextXPath;
            IList <String>      value       = new List <String>();

            foreach (IWebElement element in allElements)
            {
                value.Add(element.Text);
                Console.WriteLine("AA" + element.Text + " - OK!");
            }

            Assertions.AssertIt(() => Assert.AreEqual(value.Count, number));
            Console.WriteLine(number + " language link elements are presented.");
        }
        public void CheckingSpecialPageHeader(string validText)
        {
            string headerText = _headerID.Text;

            if (headerText == validText)
            {
                Assertions.AssertIt(() => Assert.AreEqual(headerText, validText));
                Console.WriteLine("Article page header (" + headerText + ") is correct.");
            }
            else if (headerText == "Search results")
            {
                Assertions.AssertIt(() => Assert.AreEqual(headerText, validText));
                Console.WriteLine("Article for text '" + headerText + "' is not opened.");
            }
            else
            {
                Console.WriteLine("Unexpected behavior: Search for '" + validText + "'. Displayed text '" + headerText + "'.");
            }
        }
        private static void Check10LangLinkElements()
        {
            const int number = 10;
            int       i      = 0;

            IList <IWebElement> all = BaseWebDriver.Driver
                                      .FindElements(By.XPath(LangLinksTextXPath));

            String[] allText = new String[all.Count];
            foreach (IWebElement element in all)
            {
                allText[i++] = element.Text;
            }

            for (i = 0; i < allText.Length; i++)
            {
                Console.WriteLine(allText[i] + " - OK!");
            }
            Assertions.AssertIt(() => Assert.AreEqual(allText.Length, number));

            Console.WriteLine(number + " language link elements are presented.");
        }