Beispiel #1
0
        public void DeveRealizarCadastroEstudante()
        {
            cadastro.btnValor();
            cadastro.btnParcelas();
            cadastro.setNome();
            cadastro.setEmail();

            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("btnTwoThousand")).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("07/03/1994");
            cadastro.setValorMensal("100000");
            cadastro.SelecionarSexoMasculino();
            cadastro.SelecionarSolteiro();
            cadastro.SelecionarOcupacaoEstudante();
            cadastro.SelecionarFormacaoEstudante();
            cadastro.SelecionarBanco();
            cadastro.SelecionarChequeNao();
            cadastro.SelecionarRestricaoNomeNao();
            cadastro.SelecionarImovelProprioNao();
            cadastro.SelecionarCarroProprioNao();

            Assert.AreEqual(cpf, DriverFactory.getDriver().FindElement(By.Id("borrower.cpf")).GetAttribute("value"));
            Assert.AreEqual("07/03/1994", BasePage.ObterTextoEscritoPorAtributo(By.Id("borrower.dateOfBirth")));
            Assert.AreEqual("1.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("Estudante", BasePage.ObterTextoEscritoPorTexto(By.XPath("//*[@id='borrower.jobType']/option[8]")));
            Assert.IsFalse(DriverFactory.getDriver().FindElement(By.Id("borrower.profession")).Enabled);
            Assert.AreEqual("2º grau", BasePage.ObterTextoEscritoPorTexto(By.XPath("//*[@id='borrower.educationLevel']/option[4]")));
            Assert.AreEqual("Santander", BasePage.ObterTextoEscritoPorTexto(By.XPath("//*[@id='borrower.bankingData.bankNumber']/option[9]")));
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("borrower.bankingData.hasCheckbook2")).Enabled);
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("borrower.hasNegativeCreditRecord2")).Enabled);
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("hasProperty2")).Enabled);
            Assert.IsTrue(DriverFactory.getDriver().FindElement(By.Id("hasVehicle2")).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);
        }