예제 #1
0
        public void CadastrandoPessoasEstCivilIncompleto()
        {
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            CadastrandoClientesWorkflow cadastrando = new CadastrandoClientesWorkflow(driver);

            log.Write("Preenchendo campos de login");
            cadastrando.FazLogin("paul", "paul");

            log.Write("Preenchendo campos de dados do cliente - sem Estado Civil");
            cadastrando.CadastroPessoa((GeradorPage.GerandoCpf()), "Tamara", "*****@*****.**", "17071990", "#gender > option:nth-child(3)", "#marital_status > option:nth-child(1)");

            //
            Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

            using (Graphics graphics = Graphics.FromImage(printscreen as Image))
            {
                graphics.CopyFromScreen(Point.Empty, Point.Empty, Screen.GetBounds(Point.Empty).Size);
            }

            byte[] img = (byte[])new ImageConverter().ConvertTo(printscreen, typeof(byte[]));
            File.WriteAllBytes("PrintSemEstCivil.jpg", img);
            //

            VerificacaoDeErro verificaErro = new VerificacaoDeErro(driver);

            verificaErro.VerificaMensagemErro("Mandatory field(s) not informed: \r\n \r\nMarital Status \r\n");
            log.Save();
        }
예제 #2
0
        public void CadastrandoPessoasCpfIncompleto()
        {
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            CadastrandoClientesWorkflow cadastrando = new CadastrandoClientesWorkflow(driver);

            log.Write("Preenchendo campos de login");
            cadastrando.FazLogin("paul", "paul");

            log.Write("Preenchendo campos de dados do cliente - sem CPF");
            cadastrando.CadastroPessoa("", "Tamara Salvatori", "*****@*****.**", "17071990", "#gender > option:nth-child(3)", "#marital_status > option:nth-child(2)");

            log.Write("Screenshot falha CPF - Personal client");
            Screenshot umbrellaCompanyClientFailCpf = ((ITakesScreenshot)driver).GetScreenshot();

            umbrellaCompanyClientFailCpf.SaveAsFile(EvidencesDirectory + GetTimestamp() + ".jpeg", ScreenshotImageFormat.Jpeg);

            IAlert alert = driver.SwitchTo().Alert();

            VerificacaoDeErro verificaErro = new VerificacaoDeErro(driver);

            verificaErro.VerificaMensagemErro("Mandatory field(s) not informed: \r\n \r\nPromo-code \r\n");
            log.Save();
        }