コード例 #1
0
 public MainPageData()
 {
     DeparturePlace = MainPageDataReader.GetData("DeparturePlace");
     ArrivalPlace   = MainPageDataReader.GetData("ArrivalPlace");
     LeaveDate      = MainPageDataReader.GetData("LeaveDate");
     ReturnDate     = MainPageDataReader.GetData("ReturnDate");
 }
コード例 #2
0
        public void BookingDayEarlierThanCurrentTest()
        {
            Logger.InitLogger();
            MainPageData mainPageData = new MainPageData(MainPageDataReader.GetData("DeparturePlace"),
                                                         MainPageDataReader.GetData("ArrivalPlace"), TestDate,
                                                         MainPageDataReader.GetData("ReturnDate"));

            Driver.Navigate().GoToUrl(URL);
            Logger.Log.Info("Go to " + URL);
            MainPage page = new MainPage(Driver)
                            .InputRouteData(mainPageData);

            Assert.AreNotEqual(page.leaveDateField.Text, TestDate);
            Logger.Log.Info("Test complete successfully");
        }
コード例 #3
0
        public void EmptyArrivalFieldTest()
        {
            Logger.InitLogger();
            MainPageData mainPageData = new MainPageData(MainPageDataReader.GetData("DeparturePlace"),
                                                         string.Empty, MainPageDataReader.GetData("LeaveDate"),
                                                         MainPageDataReader.GetData("ReturnDate"));

            Driver.Navigate().GoToUrl(URL);
            Logger.Log.Info("Go to " + URL);
            FlightSelectPage page = new MainPage(Driver)
                                    .InputRouteData(mainPageData)
                                    .ClickSearchButton();

            Assert.IsTrue(Driver.FindElement(By.TagName("em")).Displayed);
            Logger.Log.Info("Test complete successfully");
        }
コード例 #4
0
        public void TooManyPassengersTest()
        {
            Logger.InitLogger();
            MainPageData mainPageData = new MainPageData(MainPageDataReader.GetData("DeparturePlace"),
                                                         MainPageDataReader.GetData("ArrivalPlace"), MainPageDataReader.GetData("LeaveDate"),
                                                         MainPageDataReader.GetData("ReturnDate"));

            Driver.Navigate().GoToUrl(URL);
            Logger.Log.Info("Go to " + URL);
            MainPage page = new MainPage(Driver)
                            .InputRouteData(mainPageData)
                            .ClickPassengerNumberListButton()
                            .AddAdultPassenger(TestAdultPassengerNumber);

            Assert.IsTrue(page.addAdultPassengerButtonDisabled.Displayed);
            Logger.Log.Info("Test complete successfully");
        }
コード例 #5
0
        public void FlightBookingTest()
        {
            Logger.InitLogger();
            MainPageData mainPageData = new MainPageData(MainPageDataReader.GetData("DeparturePlace"),
                                                         MainPageDataReader.GetData("ArrivalPlace"), MainPageDataReader.GetData("LeaveDate"),
                                                         MainPageDataReader.GetData("ReturnDate"));

            Driver.Navigate().GoToUrl(URL);
            Logger.Log.Info("Go to " + URL);
            GuestDetailsPage page = new MainPage(Driver)
                                    .InputRouteData(mainPageData)
                                    .ClickSearchButton()
                                    .ClickContinueButton()
                                    .ClickContinueButton();

            Assert.AreEqual(ExpectedHeaderText, page.header.Text);
            Logger.Log.Info("Test complete successfully");
        }
コード例 #6
0
        public void IncorrectFormatOfGuestNameTest()
        {
            Logger.InitLogger();
            MainPageData mainPageData = new MainPageData(MainPageDataReader.GetData("DeparturePlace"),
                                                         MainPageDataReader.GetData("ArrivalPlace"), MainPageDataReader.GetData("LeaveDate"),
                                                         MainPageDataReader.GetData("ReturnDate"));

            GuestDetailsPageData guestDetailsPageData = new GuestDetailsPageData(GuestDetailsPageDataReader.GetData("GivenName"),
                                                                                 GuestDetailsPageDataReader.GetData("Surname"), GuestDetailsPageDataReader.GetData("Email"));

            Driver.Navigate().GoToUrl(URL);
            Logger.Log.Info("Go to " + URL);
            GuestDetailsPage page = new MainPage(Driver)
                                    .InputRouteData(mainPageData)
                                    .ClickSearchButton()
                                    .ClickContinueButton()
                                    .ClickContinueButton()
                                    .InputGuestData(guestDetailsPageData);

            Assert.AreEqual(IncorrectGuestNameError, page.incorrectNameError.Text);
            Logger.Log.Info("Test complete successfully");
        }