Exemplo n.º 1
0
        public void CheckForNoCheckBoxBookingForm()
        {
            TakeScreenshotOnTestFailure(() =>
            {
                var homePage = new HomePage(Driver).OpenPage();
                homePage.FillTicketsBookingForm("Sydney", "Fairfield");

                var tripsPage = new TripsPage(Driver);

                tripsPage.ticket.Click();
                tripsPage.GetTicketButton().Click();

                var tripPage = new TripPage(Driver);

                //tripPage.getCheckBox().Click();
                tripPage.getSubmitButton().Click();

                try
                {
                    Assert.IsTrue(tripPage.CheckForError());
                }
                catch (Exception e)
                {
                    Assert.Fail("Element not found.");
                    throw e;
                }
            });
        }
Exemplo n.º 2
0
        public void CheckForIncorrectDataInBookingForm()
        {
            TakeScreenshotOnTestFailure(() =>
            {
                var homePage = new HomePage(Driver).OpenPage();
                homePage.FillTicketsBookingForm("Sydney", "Sandgate");

                var tripsPage = new TripsPage(Driver);

                tripsPage.ticket.Click();
                tripsPage.GetTicketButton().Click();

                var tripPage = new TripPage(Driver);

                tripPage.getCheckBox().Click();
                tripPage.getSubmitButton().Click();

                try
                {
                    Assert.IsTrue(tripPage.CheckForError());
                }
                catch (Exception e)
                {
                    throw e;
                }
            });
        }
Exemplo n.º 3
0
        public void CheckForMaxDatePick()
        {
            TakeScreenshotOnTestFailure(() =>
            {
                var homePage = new HomePage(Driver).OpenPage();

                try
                {
                    homePage.FillTicketsBookingForm("Sydney", "Fairfield", true, 1, 90);
                    Assert.IsTrue(homePage.CheckForError());
                }
                catch (Exception e)
                {
                    Assert.Fail("Element not found.");
                    throw e;
                }
            });
        }
Exemplo n.º 4
0
        //[Category("PastDate")]
        public void CheckEqualFromToFields()
        {
            TakeScreenshotOnTestFailure(() =>
            {
                var homePage = new HomePage(Driver).OpenPage();

                try
                {
                    homePage.FillTicketsBookingForm("Sydney", "Sydney");

                    Assert.IsTrue(homePage.CheckForError(), "Message is not displayed");
                }
                catch (Exception e)
                {
                    Assert.Fail("Element not found.");
                    throw e;
                }
            });
        }