Example #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;
                }
            });
        }
Example #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;
                }
            });
        }
Example #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;
                }
            });
        }
Example #4
0
        public void CheckEmptyFromToForm()
        {
            TakeScreenshotOnTestFailure(() =>
            {
                var homePage = new HomePage(Driver).OpenPage();

                try
                {
                    homePage.submitFormButton.Click();

                    Assert.IsTrue(homePage.CheckForError(), "Message is not displayed");
                }
                catch (Exception e)
                {
                    Assert.Fail("Element not found.");
                    throw e;
                }
            });
        }
Example #5
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;
                }
            });
        }
Example #6
0
        public void CheckEmptyRegistrationForm()
        {
            TakeScreenshotOnTestFailure(() =>
            {
                var homePage = new HomePage(Driver).OpenPage();

                try
                {
                    homePage.registerLink.Click();
                    var regPage = new RegistrationPage(Driver);
                    regPage.SkipRegistration();

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