Example #1
0
        public void CheckToSeeIfLoanSectionHasValue()
        {
            DriverMethods.WaitForElementToBeVisible(_browserContext.WebDriver, _shortTermLoanAmountPage.LoanDisplaySection, (int)TimeOut.Duration);
            var loanAmount = _browserContext.WebDriver.FindElement(_shortTermLoanAmountPage.LoanDisplaySection).Text;

            Assert.NotEmpty(loanAmount);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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));
        }
Example #5
0
        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();
        }
Example #6
0
        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;
                }
            }
        }
        public static void InitializeDriver()
        {
            _driver = DriverMethods.GetDriver();

            ScenarioContext.Current.Set(_driver);
        }
 public NavigationService(DriverMethods driverMethods, ILogger <NavigationService> logger, RestApiService api)
 {
     _logger        = logger;
     _driverMethods = driverMethods;
     _api           = api;
 }