예제 #1
0
        public void WhenIHaveCurrentModelledApprenticeships()
        {
            if (WebSite.CurrentUrl.Contains("forecasting/estimations/start"))
            {
                EstimateFundsStartPage fundsStartPage1 = new EstimateFundsStartPage(WebSite.getDriver());
                fundsStartPage1.ClickStartForAccountWithApprenticeships();
            }
            if (!WebSite.CurrentUrl.Contains("apprenticeship/add"))
            {
                EstimateCostsPage estimateCostsPage = new EstimateCostsPage(WebSite.getDriver());
                var isAnyapprenticeshipExist        = estimateCostsPage.IsApprenticeshipsTableVisible();
                while (isAnyapprenticeshipExist)
                {
                    estimateCostsPage.RemoveFirstApprenticeship();
                    isAnyapprenticeshipExist = estimateCostsPage.IsApprenticeshipsTableVisible();
                }
            }
            if (!WebSite.CurrentUrl.Contains("apprenticeship/add"))
            {
                EstimateFundsStartPage fundsStartPage = new EstimateFundsStartPage(WebSite.getDriver());
                fundsStartPage.ClickStartForAccountWithApprenticeships();
            }
            AddApprenticeshipsToEstimateCostPage addApprenticeshipPage =
                new AddApprenticeshipsToEstimateCostPage(WebSite.getDriver());

            addApprenticeshipPage.UseTransferAllowance.Click();
            addApprenticeshipPage.SelectApprenticeshipDropdown.SelectDropDown(WebSite.getDriver(), "Actuary, Level: 7 (Standard)");
            addApprenticeshipPage.PageHeader.ClickThisElement();
            addApprenticeshipPage.NumberOfApprenticesInput.EnterTextInThisElement("1");
            addApprenticeshipPage.StartDateMonthInput.EnterTextInThisElement("10");
            addApprenticeshipPage.StartDateYearInput.EnterTextInThisElement("2019");
            addApprenticeshipPage.ContinueButton.ClickThisElement();
        }
예제 #2
0
        public void GivenThatIMOnTheEditApprenticeshipsPage()
        {
            EmployeeLogin    = "******";
            EmployeePassword = "******";

            var loginPage = WebSite.NavigateToLoginPage();

            loginPage.LoginAsUser(EmployeeLogin, EmployeePassword);

            var accountHomepage = WebSite.NavigateToAccountHomePage();
            var financePage     = accountHomepage.OpenFinance();

            financePage.OpenFundingProjection();

            WebSite.NavigateToEstimateFundsStartPage();

            EstimateFundsStartPage page =
                new EstimateFundsStartPage(WebSite.getDriver());

            page.ClickStartForAccountWithoutApprenticeships();
            EstimateCostsPage estimateCostsPage = new EstimateCostsPage(WebSite.getDriver());

            if (!WebSite.CurrentUrl.Contains("apprenticeship/add"))
            {
                var isAnyapprenticeshipExist = estimateCostsPage.IsApprenticeshipsTableVisible();
                while (isAnyapprenticeshipExist)
                {
                    estimateCostsPage.RemoveFirstApprenticeship();
                    isAnyapprenticeshipExist = estimateCostsPage.IsApprenticeshipsTableVisible();
                }
            }

            if (!WebSite.CurrentUrl.Contains("apprenticeship/add"))
            {
                EstimateCostsPage fundsStartPage = new EstimateCostsPage(WebSite.getDriver());
                fundsStartPage.AddApprenticeshipsButton.Click();
            }

            AddApprenticeshipsToEstimateCostPage addApprenticeshipPage =
                new AddApprenticeshipsToEstimateCostPage(WebSite.getDriver());

            addApprenticeshipPage.SelectApprenticeshipDropdown.SelectDropDown(WebSite.getDriver(), "Actuary, Level: 7 (Standard)");
            addApprenticeshipPage.PageHeader.Click();
            addApprenticeshipPage.NumberOfApprenticesInput.EnterTextInThisElement("1");
            addApprenticeshipPage.StartDateMonthInput.EnterTextInThisElement("10");
            addApprenticeshipPage.StartDateYearInput.EnterTextInThisElement("2019");
            addApprenticeshipPage.TotalCostInput.Clear();
            addApprenticeshipPage.TotalCostInput.EnterTextInThisElement("18,000");
            addApprenticeshipPage.ContinueButton.ClickThisElement();

            EstimateCostsPage secondEstimateCostsPage = new EstimateCostsPage(WebSite.getDriver());

            secondEstimateCostsPage.EditApprenticeships();
        }
예제 #3
0
        public void WhenIHaveNoCurrentModelledApprenticeships()
        {
            EstimateFundsStartPage page =
                new EstimateFundsStartPage(WebSite.getDriver());

            page.ClickStartForAccountWithoutApprenticeships();
            EstimateCostsPage estimateCostsPage = new EstimateCostsPage(WebSite.getDriver());

            if (!WebSite.CurrentUrl.Contains("apprenticeship/add"))
            {
                var isAnyapprenticeshipExist = estimateCostsPage.IsApprenticeshipsTableVisible();
                while (isAnyapprenticeshipExist)
                {
                    estimateCostsPage.RemoveFirstApprenticeship();
                    isAnyapprenticeshipExist = estimateCostsPage.IsApprenticeshipsTableVisible();
                }
            }
        }
        public void GivenThatIMOnTheAddApprenticeshipPage()
        {
            EmployeeLogin    = "******";
            EmployeePassword = "******";

            var loginPage = WebSite.NavigateToLoginPage();

            loginPage.LoginAsUser(EmployeeLogin, EmployeePassword);

            var accountHomepage = WebSite.NavigateToAccountHomePage();
            var financePage     = accountHomepage.OpenFinance();

            financePage.OpenFundingProjection();

            WebSite.NavigateToEstimateFundsStartPage();

            EstimateFundsStartPage page =
                new EstimateFundsStartPage(WebSite.getDriver());

            page.ClickStartForAccountWithoutApprenticeships();
            EstimateCostsPage estimateCostsPage = new EstimateCostsPage(WebSite.getDriver());

            if (!WebSite.CurrentUrl.Contains("apprenticeship/add"))
            {
                var isAnyapprenticeshipExist = estimateCostsPage.IsApprenticeshipsTableVisible();
                while (isAnyapprenticeshipExist)
                {
                    estimateCostsPage.RemoveFirstApprenticeship();
                    isAnyapprenticeshipExist = estimateCostsPage.IsApprenticeshipsTableVisible();
                }
            }

            if (!WebSite.CurrentUrl.Contains("apprenticeship/add"))
            {
                EstimateCostsPage fundsStartPage = new EstimateCostsPage(WebSite.getDriver());
                fundsStartPage.AddApprenticeshipsButton.Click();
            }
        }
예제 #5
0
        public void GivenThatIHaveRemovedAnApprenticeship()
        {
            EmployeeLogin    = "******";
            EmployeePassword = "******";

            var loginPage = WebSite.NavigateToLoginPage();

            loginPage.LoginAsUser(EmployeeLogin, EmployeePassword);

            var accountHomepage = WebSite.NavigateToAccountHomePage();
            var financePage     = accountHomepage.OpenFinance();

            financePage.OpenFundingProjection();

            WebSite.NavigateToEstimateFundsStartPage();

            EstimateFundsStartPage page =
                new EstimateFundsStartPage(WebSite.getDriver());

            page.ClickStartForAccountWithoutApprenticeships();
            EstimateCostsPage estimateCostsPage = new EstimateCostsPage(WebSite.getDriver());

            if (!WebSite.CurrentUrl.Contains("apprenticeship/add"))
            {
                var isAnyapprenticeshipExist = estimateCostsPage.IsApprenticeshipsTableVisible();
                while (isAnyapprenticeshipExist)
                {
                    estimateCostsPage.RemoveFirstApprenticeship();
                    isAnyapprenticeshipExist = estimateCostsPage.IsApprenticeshipsTableVisible();
                }
            }

            if (!WebSite.CurrentUrl.Contains("apprenticeship/add"))
            {
                EstimateCostsPage fundsStartPage = new EstimateCostsPage(WebSite.getDriver());
                fundsStartPage.AddApprenticeshipsButton.Click();
            }

            string month     = DateTime.UtcNow.Month.ToString();
            string nextMonth = (DateTime.UtcNow.Month + 1).ToString();
            string year      = DateTime.UtcNow.Year.ToString();

            AddApprenticeshipsToEstimateCostPage addApprenticeshipPage =
                new AddApprenticeshipsToEstimateCostPage(WebSite.getDriver());

            addApprenticeshipPage.UseTransferAllowance.Click();
            addApprenticeshipPage.SelectApprenticeshipDropdown.SelectDropDown(WebSite.getDriver(), "Actuary, Level: 7 (Standard)");
            addApprenticeshipPage.PageHeader.ClickThisElement();
            addApprenticeshipPage.NumberOfApprenticesInput.EnterTextInThisElement("1");
            addApprenticeshipPage.StartDateMonthInput.EnterTextInThisElement(month);
            addApprenticeshipPage.StartDateYearInput.EnterTextInThisElement(year);
            addApprenticeshipPage.ContinueButton.ClickThisElement();

            EstimateCostsPage secondFundsStartPage = new EstimateCostsPage(WebSite.getDriver());

            secondFundsStartPage.AddApprenticeshipsButton.Click();

            addApprenticeshipPage.UseTransferAllowance.Click();
            addApprenticeshipPage.SelectApprenticeshipDropdown.SelectDropDown(WebSite.getDriver(), "Actuary, Level: 7 (Standard)");
            addApprenticeshipPage.PageHeader.ClickThisElement();
            addApprenticeshipPage.NumberOfApprenticesInput.EnterTextInThisElement("1");
            addApprenticeshipPage.StartDateMonthInput.EnterTextInThisElement(nextMonth);
            addApprenticeshipPage.StartDateYearInput.EnterTextInThisElement(year);
            addApprenticeshipPage.ContinueButton.ClickThisElement();

            estimateCostsPage.ClickRemoveApprenticeshipButton();

            RemoveApprenticeshipPage removeApprenticeshipPage = new RemoveApprenticeshipPage(WebSite.getDriver());

            removeApprenticeshipPage.ConfirmRemoval();
        }