protected async Task PopulateBookingFlowRadioAsync(By by) { await _session.InvokeOnElementAsync(by, x => x.Click()); await _session.WaitForElementToDisappearAsync(LoadingSpinner); await _session.WaitForInteractiveReadyStateAsync(); }
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); })); }
protected async Task GoToNextStepAsync() { await _session.InvokeOnElementAsync(NextButton, x => x.Click()); await _session.WaitForInteractiveReadyStateAsync(); await _session.InvokeAsync(x => Thread.Sleep(500)); }
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); })); }
protected async Task <(string BookingNumber, string BookingPassword, decimal TotalPrice)> ReadBookingDetailsAsync() { string bookingNumber = null; string bookingPassword = null; decimal totalPrice = 0; await _session.InvokeOnElementAsync(BookingNumberDiv, x => bookingNumber = x.Text); await _session.InvokeOnElementAsync(BookingPasswordDiv, x => bookingPassword = x.Text); await _session.InvokeAsync(driver => { var element = driver.FindElements(TotalPriceSpans).First(); totalPrice = decimal.Parse(element.Text.Replace(" DKK", string.Empty).Replace(".", string.Empty).Replace(',', '.'), CultureInfo.InvariantCulture); }); return(bookingNumber, bookingPassword, totalPrice); }
protected async Task PopulateInformationAsync(string firstName, string lastName, string phoneNumber, string email) { await _session.InvokeOnElementAsync(FirstNameText, x => { x.Clear(); x.SendKeys(firstName); }); await _session.InvokeOnElementAsync(LastNameText, x => { x.Clear(); x.SendKeys(lastName); }); await _session.InvokeOnElementAsync(MobileText, x => { x.Clear(); x.SendKeys(phoneNumber); }); await _session.InvokeOnElementAsync(EmailText, x => { x.Clear(); x.SendKeys(email); }); }