Esempio n. 1
0
        public void TestRoutesAutoCompleteMenu() //start typing service testing
        {
            string   beginning = "М";
            PageHome pageHome  = new PageHome();

            PageFactory.InitElements(driver, pageHome);
            pageHome.RoutesPageButton.Click();
            PageRoutes pageRoutes = new PageRoutes();

            PageFactory.InitElements(driver, pageRoutes);
            pageRoutes.DepartureStationField.Clear();
            pageRoutes.DepartureDateField.Clear();
            pageRoutes.ArrivalStationField.Clear();
            pageRoutes.DepartureStationField.SendKeys(beginning);
            pageRoutes.DepartureStationField.Click();
            Thread.Sleep(1000);
            IWebElement autoDep   = pageRoutes.DepartAuto(5);
            string      expected  = autoDep.Text;
            int         usefulind = expected.IndexOf(',');

            expected = expected.Substring(0, usefulind);
            autoDep.Click();
            Assert.AreEqual(expected, pageRoutes.DepartureStationField.GetAttribute("value"));
        }