protected async Task PopulateDepartureAsync(DateTime departure) { await _session.WaitForElementToAppearAsync(DepartureTable, minCount : 1); if (!await _session.TryInvokeOnElementAsync(OutboundDepartureRadio(departure), x => x.Click())) { throw new ApiException(ApiStatus.DepartureNotFound); } }
public Task LoginAsync(string bookingNumber, string bookingPassword) { return(ExecuteWithRetry(async() => { if (await _session.InvokeAsync(x => x.FindElements(CancelBookingButton).Count > 0)) { // Already logged in return; } await _session.InvokeOnElementAsync(BookingNumberText, x => x.SendKeys(bookingNumber)); await _session.InvokeOnElementAsync(BookingPasswordText, x => x.SendKeys(bookingPassword)); await _session.InvokeOnElementAsync(SubmitButton, x => x.Click()); await _session.WaitForElementToAppearAsync(CancelBookingButton); })); }
public Task LoginAsync(string username, string password) { return(ExecuteWithRetry(async() => { if (await _session.InvokeAsync(x => x.FindElements(BookingDetailsContainerDiv).Count > 0)) { // Already logged in return; } await _session.InvokeOnElementAsync(UsernameText, x => x.SendKeys(username)); await _session.InvokeOnElementAsync(PasswordText, x => x.SendKeys(password)); await _session.InvokeOnElementAsync(SubmitButton, x => x.Click()); await _session.WaitForElementToAppearAsync(BookingDetailsContainerDiv); })); }