Beispiel #1
0
        public void FindTicketWithEmptyFieldDepartureDate()
        {
            #region TestData
            const string expectedErrorMessage = "This field is mandatory";
            #endregion

            Route             route = RouteCreator.WithAllProperties();
            GdTicketsHomePage page  = new GdTicketsHomePage(webDriver);
            page
            .FillFieldDeparture(route)
            .FillFieldArrive(route)
            .SearchClick();

            Assert.AreEqual(expectedErrorMessage, page.getErrorMessage());
        }
Beispiel #2
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());
        }
Beispiel #3
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());
        }