public void CheckForNoDataInBookingForm() { 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; } }); }
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; } }); }