Пример #1
0
        public void PayForTicketWithoutInformationAboutCard()
        {
            PayPage payPage = new MainPage(Driver)
                              .InputRouteDateAndClickSearch(RouteCreator.WithAllProperties())
                              .ClickBuyFirstTicket()
                              .ChoseSeatAndClickUserInformation()
                              .WriteUserInformationAndClickSubmit(UserCreator.WithAllProperties())
                              .ClickButtonNext();

            Assert.IsTrue(payPage.IsVisibleErrorField());
        }
Пример #2
0
        public void IsUserExists()
        {
            var user = UserCreator.WithAllProperties();

            BookingTrainTicketsPage register = new BookingTrainTicketsPage(Driver)
                                               .GoToPage(StartPage)
                                               .Login()
                                               .Register()
                                               .InputUserData(user)
                                               .SubmitReg();

            Assert.IsTrue(register.IsUserExists());
        }
Пример #3
0
        public void DiscountSubscriptionTest()
        {
            MakeScreenshotWhenFail(() =>
            {
                Driver.Navigate().GoToUrl("https://21vek.by/");
                string ErrorEmail = "Спасибо";
                MainPage mainPage = new MainPage(Driver);

                IJavaScriptExecutor js = (IJavaScriptExecutor)Driver;
                js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight);");

                var subscribeForm = mainPage.InputSubscribeEmail(UserCreator.WithAllProperties());
                subscribeForm.ClickSubscribeButton();
                Trace.WriteLine(subscribeForm.SubscribeMessage.Text);
                Assert.IsTrue(subscribeForm.SubscribeMessage.Text.Contains(ErrorEmail));
            });
        }
Пример #4
0
        public void BuyChildrenTicketIfAdult()
        {
            #region TestData
            string error = "Please specify a valid date in the format DD/MM/YYYY";
            Route  route = RouteCreator.WithAllProperties();
            User   user  = UserCreator.WithAllProperties();
            #endregion

            GdTicketsHomePage gdTicketsHomePage = new GdTicketsHomePage();

            SearchResultsPage searchResultsPage = gdTicketsHomePage
                                                  .FillFieldDeparture(route)
                                                  .FillFieldArrive(route)
                                                  .OpenDepartCalendar()
                                                  .ChoiceDepartureDate(route)
                                                  .GoToSearchResult()
                                                  .ChoiceFirstTrain()
                                                  .ChoiceChildTo14YearsAndWriteData(user);

            Assert.AreEqual(error, searchResultsPage.GetDateError());
        }
Пример #5
0
        public void AddReview()
        {
            MakeScreenshotWhenFail(() =>
            {
                Driver.Navigate().GoToUrl("https://21vek.by/");

                string goodAddedReviewMessage = "Спасибо за ваш отзыв! Он будет опубликован в ближайшее время после проверки модератором.";

                MainPage mainPage = new MainPage(Driver);
                var authForm      = mainPage.ClickOnAccountField();
                authForm.InputAuthorizatePassAndEmail(UserCreator.AuthProperties())
                .ClickAuthorizationButton();

                SpecialPage specialPage = mainPage.ClickOnSpecialPageButton();
                ProductPage productPage = specialPage.ClickOnFirstProduct();
                productPage.ClickProductReviewTab()
                .ClickProductReviewShowFormButton()
                .InputReviewToForm(UserCreator.WithAllProperties(), "Тест системы автоматизации тестирования")
                .ClickAddReviewButton();
                string value = productPage.AddedReviewMessage.Text;

                Assert.AreEqual(goodAddedReviewMessage, value);
            });
        }