Beispiel #1
0
        public void DeveRealizarCadastroEmpresario()
        {
            cadastro.btnValor2();
            cadastro.btnParcelas();
            cadastro.setNome();
            cadastro.setEmail();

            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("btnTenThousand")).Enabled);
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("btnNineTerm")).Enabled);
            Assert.IsEmpty(DriverFactory.getDriver().FindElement(By.Id("name")).Text);
            Assert.IsEmpty(DriverFactory.getDriver().FindElement(By.Id("email")).Text);
            BaseTest.esperar(2000);

            cadastro.btnContinuarHome();
            BaseTest.esperar(2000);
            cadastro.setCPF();
            var cpf = DriverFactory.getDriver().FindElement(By.Id("borrower.cpf")).GetAttribute("value");

            cadastro.setDataNascimento("15/01/1991");
            cadastro.setValorMensal("4000000");
            cadastro.SelecionarSexoMasculino();
            cadastro.SelecionarCasado();
            cadastro.SelecionarOcupacaoEmpresario();
            cadastro.SelecionarProfissaoPiscicultor();
            cadastro.SelecionarFormacao();
            cadastro.SelecionarBanco();
            cadastro.SelecionarChequeSim();
            cadastro.SelecionarRestricaoNomeNao();
            cadastro.SelecionarImovelProprioSim();
            cadastro.SelecionarCarroProprioSim();

            Assert.AreEqual(cpf, DriverFactory.getDriver().FindElement(By.Id("borrower.cpf")).GetAttribute("value"));
            Assert.AreEqual("15/01/1991", BasePage.ObterTextoEscritoPorAtributo(By.Id("borrower.dateOfBirth")));
            Assert.AreEqual("40.000,00", BasePage.ObterTextoEscritoPorAtributo(By.Id("borrower.monthlyGrossIncome")));
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("borrower.gender2")).Enabled);
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("borrower.maritalStatus")).Enabled);
            Assert.AreEqual("Empresário", BasePage.ObterTextoEscritoPorTexto(By.XPath("//*[@id='borrower.jobType']/option[7]")));
            Assert.AreEqual("              Piscicultor\r\n            ", BasePage.ObterTextoEscritoPorTexto(By.XPath("//*[@id='borrower.profession']/option[4]")));
            Assert.AreEqual("Superior Completo", BasePage.ObterTextoEscritoPorTexto(By.XPath("//*[@id='borrower.educationLevel']/option[6]")));
            Assert.AreEqual("Santander", BasePage.ObterTextoEscritoPorTexto(By.XPath("//*[@id='borrower.bankingData.bankNumber']/option[9]")));
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("borrower.bankingData.hasCheckbook")).Enabled);
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("borrower.hasNegativeCreditRecord2")).Enabled);
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("hasProperty")).Enabled);
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("hasVehicle")).Enabled);

            cadastro.btnContinuarCadastro();
            BaseTest.esperar(2000);
            cadastro.setCep("09560-400");
            BaseTest.esperar(2000);
            cadastro.setNumero("53");
            cadastro.setCelular("(11)98135-0706");

            Assert.AreEqual("09560-400", BasePage.ObterTextoEscritoPorAtributo(By.Id("homeAddress.cep")));
            Assert.AreEqual("53", BasePage.ObterTextoEscritoPorAtributo(By.Id("homeAddress.number")));
            Assert.AreEqual("(11) 981350706", BasePage.ObterTextoEscritoPorAtributo(By.Id("mobilePhone")));

            cadastro.btnContinuarCadastro();
            new WebDriverWait(DriverFactory.getDriver(), TimeSpan.FromSeconds(120)).Until(ExpectedConditions.ElementExists((By.Id("emailConfirmation"))));
            var ConfirmEmail = DriverFactory.getDriver().FindElement(By.Id("email")).GetAttribute("value");

            cadastro.setConfirmaEmail(ConfirmEmail);

            BaseTest.esperar(2000);
        }