Example #1
0
        public void VerifyTabbingOrder(string topicToSelect1, string topicToSelect2, string topicToSelect3)
        {
            HeaderLogo.SendKeys(Keys.Tab);
            var feedbackLink = Driver.SwitchTo().ActiveElement();

            feedbackLink.SendKeys(Keys.Tab);
            var topic1 = Driver.SwitchTo().ActiveElement();

            Assert.IsTrue(topic1.Text.Contains(topicToSelect1));
            topic1.SendKeys(Keys.Enter);
            topic1 = Driver.SwitchTo().ActiveElement();
            topic1.SendKeys(Keys.Tab);
            var topic2 = Driver.SwitchTo().ActiveElement();

            Assert.IsTrue(topic2.Text.Contains(topicToSelect2));
            topic2.SendKeys(Keys.Enter);
            topic2 = Driver.SwitchTo().ActiveElement();
            topic2.SendKeys(Keys.Tab);
            var topic3 = Driver.SwitchTo().ActiveElement();

            Assert.IsTrue(topic3.Text.Contains(topicToSelect3));
            topic3.SendKeys(Keys.Enter);

            QuestionPage questionPage = new QuestionPage(Driver);

            questionPage.VerifyQuestionPageLoaded();
        }
Example #2
0
        public void VerifyTabbingOrder(int age)
        {
            HeaderLogo.SendKeys(Keys.Tab);
            var feedbackLink = Driver.SwitchTo().ActiveElement();

            feedbackLink.SendKeys(Keys.Tab);
            var maleButton = Driver.SwitchTo().ActiveElement();

            maleButton.SendKeys(Keys.Space);
            maleButton.SendKeys(Keys.Tab);
            var transgenderReveal = Driver.SwitchTo().ActiveElement();

            transgenderReveal.SendKeys(Keys.Tab);
            var ageInput = Driver.SwitchTo().ActiveElement();

            ageInput.SendKeys(age.ToString());
            ageInput.SendKeys(Keys.Tab);
            var nextButton = Driver.SwitchTo().ActiveElement();

            nextButton.SendKeys(Keys.Enter);

            var searchPage = new SearchPage(Driver);

            searchPage.VerifyHeader();
        }
Example #3
0
        public void VerifyTabbingOrder(string searchTerm)
        {
            HeaderLogo.SendKeys(Keys.Tab);
            var feedbackLink = Driver.SwitchTo().ActiveElement();

            feedbackLink.SendKeys(Keys.Tab);
            var searchTxtBox = Driver.SwitchTo().ActiveElement();

            searchTxtBox.SendKeys(searchTerm);
            searchTxtBox.SendKeys(Keys.Tab);
            var nextButtonElement = Driver.SwitchTo().ActiveElement();

            nextButtonElement.SendKeys(Keys.Enter);
            //Page Loads Results, so the elements have been recreated
            //on the new page, so we must get it again.
            HeaderLogo.SendKeys(Keys.Tab);
            var feedbackLink2 = Driver.SwitchTo().ActiveElement();

            feedbackLink2.SendKeys(Keys.Tab);
            var firstSearchResultLink = Driver.SwitchTo().ActiveElement();

            Assert.AreEqual(searchTerm.ToLower(), firstSearchResultLink.Text.ToLower());
        }