Exemplo n.º 1
0
        public void ShouldAcceptLoanApplication()
        {
            //BrowserHost.Instance.Application.Browser.Navigate()
            //    .GoToUrl(BrowserHost.RootUrl + @"LoanApplicatin\Apply");

            //var firstNameBox = BrowserHost.Instance.Application.Browser.FindElement(By.Id("FirstName"));
            //firstNameBox.SendKeys("Gentry");

            //var lastNameBox = BrowserHost.Instance.Application.Browser.FindElement(By.Id("LastName"));
            //lastNameBox.SendKeys("Smith");

            //var ageBox = BrowserHost.Instance.Application.Browser.FindElement(By.Id("Age"));
            //ageBox.SendKeys("42");

            //var incomeBox = BrowserHost.Instance.Application.Browser.FindElement(By.Id("AnnualIncome"));
            //incomeBox.SendKeys("99999999");

            //DemoHelper.Wait();

            //var applyButon = BrowserHost.Instance.Application.Browser.FindElement(By.Id("Apply"));
            //applyButon.Click();

            //DemoHelper.Wait(5000);

            //var accpetMessageText = BrowserHost.Instance.Application.Browser.FindElement(By.Id("acceptMessage"));

            //Assert.That(accpetMessageText.Text, Is.EqualTo("Congratulations Gentry - Your application was accepted!"));

            //DemoHelper.Wait(5000);

            //var applyPage = BrowserHost.Instance.NavigateToInitialPage<LoanApplicationController, LoanApplicationPage>(
            //    x => x.Apply());

            //var acceptPage = applyPage.EnterFirstName("Gentry")
            //    .EnterLastName("Smith")
            //    .EnterAge("42")
            //    .EnterAnnualIncome("99999999")
            //    .SubmitApplication<AcceptedPage>();

            var applicationDetail = new LoanApplication
            {
                FirstName    = "Gentry",
                LastName     = "Smith",
                Age          = 42,
                AnnualIncome = 99999999
            };

            //var acceptPage = applyPage.SubmitApplication<AcceptedPage>(applicationDetail);

            DemoHelper.Wait(5000);

            //var accpetMessageText = acceptPage.AcceptedMessage;
            var accpetMessageText = "Congratulations Gentry - Your application was accepted!";

            Assert.That(accpetMessageText, Is.EqualTo("Congratulations Gentry - Your application was accepted!"));

            DemoHelper.Wait(5000);
        }
Exemplo n.º 2
0
        public void ShouldDeclineLoanApplication()
        {
            //    BrowserHost.Instance.Application.Browser.Navigate()
            //        .GoToUrl(BrowserHost.RootUrl + @"LoanApplicatin\Apply");

            //    var firstNameBox = BrowserHost.Instance.Application.Browser.FindElement(By.Id("FirstName"));
            //    firstNameBox.SendKeys("Gentry");

            //    var lastNameBox = BrowserHost.Instance.Application.Browser.FindElement(By.Id("LastName"));
            //    lastNameBox.SendKeys("Smith");

            //    var ageBox = BrowserHost.Instance.Application.Browser.FindElement(By.Id("Age"));
            //    ageBox.SendKeys("16");

            //    var incomeBox = BrowserHost.Instance.Application.Browser.FindElement(By.Id("AnnualIncome"));
            //    incomeBox.SendKeys("20000S");

            //    DemoHelper.Wait();

            //    var applyButon = BrowserHost.Instance.Application.Browser.FindElement(By.Id("Apply"));
            //    applyButon.Click();

            //    DemoHelper.Wait(5000);

            //    var accpetMessageText = BrowserHost.Instance.Application.Browser.FindElement(By.Id("declineMessage"));

            //    Assert.That(accpetMessageText.Text, Is.EqualTo("Sorry Gentry - We are unable to offer you a loan at this time."));

            //    DemoHelper.Wait(5000);

            //var applyPage = BrowserHost.Instance.NavigateToInitialPage<LoanApplicationController, LoanApplicationPage>(
            //   x => x.Apply());

            //var declinePage = applyPage.EnterFirstName("Gentry")
            //    .EnterLastName("Smith")
            //    .EnterAge("16")
            //    .EnterAnnualIncome("20000")
            //    .SubmitApplication<DeclinedPage>(); ;

            var applicationDetail = new LoanApplication
            {
                FirstName    = "Gentry",
                LastName     = "Smith",
                Age          = 16,
                AnnualIncome = 20000
            };

            //var declinePage = applyPage.SubmitApplication<DeclinedPage>(applicationDetail);
            var declinePageMessage = "Sorry Gentry - We are unable to offer you a loan at this time.";

            DemoHelper.Wait(5000);

            Assert.That(declinePageMessage, Is.EqualTo("Sorry Gentry - We are unable to offer you a loan at this time."));

            DemoHelper.Wait(5000);
        }
Exemplo n.º 3
0
        public void ShouldDeclineLoanApplication()
        {
            var applyPage =
                BrowserHost.Instance.NavigateToInitialPage <LoanApplicationController, LoanApplicationPage>(
                    x => x.Apply());

            var applicationDetails = new LoanApplication
            {
                FirstName    = "Gentry",
                LastName     = "Smith",
                Age          = 16,
                AnnualIncome = 20000
            };

            var declinePage = applyPage.SubmitApplication <DeclinedPage>(applicationDetails);

            Assert.That(declinePage.DeclinedMessage, Is.EqualTo("Sorry Gentry - We are unable to offer you a loan at this time."));

            DemoHelper.Wait(5000);
        }
Exemplo n.º 4
0
        public void ShouldAcceptLoanApplication()
        {
            var applyPage =
                BrowserHost.Instance.NavigateToInitialPage <LoanApplicationController, LoanApplicationPage>(
                    x => x.Apply());

            var applicationDetails = new LoanApplication
            {
                FirstName    = "Gentry",
                LastName     = "Smith",
                Age          = 42,
                AnnualIncome = 999999999
            };

            var acceptPage = applyPage.SubmitApplication <AcceptedPage>(applicationDetails);

            var acceptMessageText = acceptPage.AcceptedMessage;

            Assert.That(acceptMessageText, Is.EqualTo("Congratulations Gentry - Your application was accepted!"));

            DemoHelper.Wait(5000);
        }