public void CheckToSeeIfLoanSectionHasValue() { DriverMethods.WaitForElementToBeVisible(_browserContext.WebDriver, _shortTermLoanAmountPage.LoanDisplaySection, (int)TimeOut.Duration); var loanAmount = _browserContext.WebDriver.FindElement(_shortTermLoanAmountPage.LoanDisplaySection).Text; Assert.NotEmpty(loanAmount); }
public void VerifyFirstRepaymentDate(int dateToCheck) { DriverMethods.WaitForElementToBeVisible(_browserContext.WebDriver, _shortTermLoanAmountPage.LoanDisplaySection, (int)TimeOut.Duration); var firstRepayment = _browserContext.WebDriver.FindElement(_shortTermLoanAmountPage.RepaymentDate1).Text; var result = firstRepayment.Contains(dateToCheck.ToString()); Assert.True(result); }
public void CompareSliderAmountAndLoanSectionAmount() { DriverMethods.WaitForElementToBeVisible(_browserContext.WebDriver, _shortTermLoanAmountPage.LoanDisplaySection, (int)TimeOut.Duration); var loanAmountSection = $"{_browserContext.WebDriver.FindElement(_shortTermLoanAmountPage.LoanDisplaySection).Text}00"; var sliderSelectionAmount = _browserContext.WebDriver .FindElement(_shortTermLoanAmountPage.SelectedSliderLoanAmount).Text; Assert.Equal(sliderSelectionAmount, loanAmountSection); }
public void VerifyIfTheSelectedAmountInSliderMatchesInSections(decimal amountToCheck) { DriverMethods.WaitForElementToBeVisible(_browserContext.WebDriver, _shortTermLoanAmountPage.LoanDisplaySection, (int)TimeOut.Duration); var loanAmountSection = Strings.Replace($"{_browserContext.WebDriver.FindElement(_shortTermLoanAmountPage.LoanDisplaySection).Text}00", "£", ""); var sliderSelectionAmount = _browserContext.WebDriver .FindElement(_shortTermLoanAmountPage.SelectedSliderLoanAmount).Text.Replace("£", ""); amountToCheck = decimal.Parse($"{amountToCheck}.00"); Assert.Equal(amountToCheck, decimal.Parse(loanAmountSection)); }
public void SelectLoanAmountInSlider(decimal loanAmount) { DriverMethods.WaitForElementToBeVisible(_browserContext.WebDriver, LoanSelectorSlider, (int)TimeOut.Duration); _loanSlider = _browserContext.WebDriver.FindElement(LoanSelectorSlider); var pixel = Slider.GetPixelsToMove(_loanSlider, loanAmount, 500, 200); Actions action = new Actions(_browserContext.WebDriver); action.ClickAndHold(_loanSlider) .MoveByOffset((-(int)_loanSlider.Size.Width / 2), 0) .MoveByOffset(pixel, 0).Release().Perform(); }
public void SelectRepaymentDate(int dateToSelect) { DriverMethods.WaitForElementToBeVisible(_browserContext.WebDriver, RepaymentDayGrid, (int)TimeOut.Duration); var repaymentGrid = _browserContext.WebDriver.FindElements(RepaymentDayGrid); foreach (var date in repaymentGrid) { if (dateToSelect == Int32.Parse(date.Text)) { date.Click(); break; } } }