public void TestDuckDuckGoWebSearch() { Actor.AttemptsTo(Navigate.ToUrl(SearchPage.Url)); Actor.AskingFor(ValueAttribute.Of(SearchPage.SearchInput)).Should().BeEmpty(); Actor.AttemptsTo(SearchDuckDuckGo.For("panda")); Actor.WaitsUntil(Appearance.Of(ResultPage.ResultLinks), IsEqualTo.True()); }
public void TestFlightBooking() { DateTime depdateValue = DateTime.Now.AddDays(2); string depatureDate = depdateValue.ToString("ddd") + " " + depdateValue.ToString("MMM dd yyyy"); DateTime returndateValue = DateTime.Now.AddDays(3); string returnDate = returndateValue.ToString("ddd") + " " + returndateValue.ToString("MMM dd yyyy"); actor.AttemptsTo(FlightBooking.For("Goa", "Mumbai", depatureDate, returnDate, 1, 1, "Economy")); actor.AttemptsTo(Click.On(FlightBookingPage.SearchButton)); actor.AttemptsTo(Click.On(FlightBookingPage.DepFlight)); actor.AttemptsTo(Click.On(FlightBookingPage.ReturnFlight)); Thread.Sleep(3000); actor.AttemptsTo(Click.On(FlightBookingPage.BookNowButton)); actor.AttemptsTo(Click.On(FlightBookingPage.ContinueButton)); actor.AttemptsTo(SwitchWindow.To(actor.AskingFor(WindowHandle.Last()))); actor.WaitsUntil(Appearance.Of(FlightConfirmationPage.DepartureFlightDetails), IsEqualTo.True()); actor.WaitsUntil(Appearance.Of(FlightConfirmationPage.ReturnFlightDetails), IsEqualTo.True()); }
public void TestWithInValidCredentials() { actor.AttemptsTo(Login.For("*****@*****.**", "test@456")); actor.WaitsUntil(Appearance.Of(LoginPage.ErrorMessageText), IsEqualTo.True()); actor.AskingFor(Text.Of(LoginPage.ErrorMessageText)).Should().Be("Either Username or Password is incorrect."); }