Ejemplo n.º 1
0
        public void FindTicketWithEmptyFieldDepartureDate()
        {
            var homepage = new GdTicketsHomePage(webDriver);

            #region TestData
            const string departureCityText    = "Киев";
            const string arriveCityText       = "Харьков-Пасс";
            const string expectedErrorMessage = "Это поле необходимо заполнить";
            #endregion

            homepage.ChoiceDepartureCity(departureCityText);
            homepage.ChoiceArriveCity(arriveCityText);
            homepage.searchButton.Click();

            Assert.AreEqual(expectedErrorMessage, homepage.getErrorMessage());
        }
Ejemplo n.º 2
0
        public void FindTicketWithYeasterdayDate()
        {
            var homepage = new GdTicketsHomePage(webDriver);

            #region TestData
            const string departureCityText    = "Киев";
            const string arriveCityText       = "Харьков-Пасс";
            const string expectedErrorMessage = "Это поле необходимо заполнить";
            int          yesterday            = DateTime.Now.Day - 1;
            #endregion

            homepage.ChoiceDepartureCity(departureCityText);
            homepage.ChoiceArriveCity(arriveCityText);
            homepage.OpenCalendar();
            var dates = homepage.GetCalendarDates();
            var day   = dates.FirstOrDefault(d => d.Text.Equals(yesterday.ToString()));
            day.Click();
            homepage.searchButton.Click();

            Assert.AreEqual(expectedErrorMessage, homepage.getErrorMessage());
        }