Esempio n. 1
0
        public void ValidarMensagemNaoInformacaoDosCamposDeCadastro()
        {
            #region Arranje

            var usuario    = GerarUsuarioHelper.GerarUsuario();
            var listaErros = new List <string> {
                "You must register at least one phone number.",
                "lastname is required.",
                "firstname is required.",
                "passwd is required.",
                "address1 is required.",
                "city is required.",
                "The Zip/Postal code you've entered is invalid. It must follow this format: 00000",
                "This country requires you to choose a State."
            };

            #endregion Arranje

            #region Act

            authenticationPage.NavegaParaPagina(Resources.Resource.UrlAuthentication);
            authenticationPage.PreencheCampoEmailCreateAccount(usuario.Email);
            authenticationPage.ClickBtnCreateAccount();
            authenticationPage.ClickBtnRegisterAnAccount();

            #endregion Act

            #region Assert

            Assert.AreEqual(authenticationPage.RetornaMensagemCampoRequerido(), "*Required field", "A mensagem esta diferente do esperado.");
            var listaErrosPagina = authenticationPage.RetornaListadeErros();
            Assert.AreEqual(listaErros, listaErrosPagina);

            #endregion Assert
        }
Esempio n. 2
0
        public void ValidarCadastroDeUsuario()
        {
            #region Arranje

            AuthenticationPage login     = new AuthenticationPage(driver);
            MyAccountPage      myAccount = new MyAccountPage(driver);
            var usuario = GerarUsuarioHelper.GerarUsuario();

            #endregion Arranje

            #region Act

            login.NavegaParaPagina(Properties.Resource.UrlAuthentication);
            login.PreencheCampoEmailCreateAccount(usuario.Email);
            login.ClickBtnCreateAccount();
            login.PreecherDadosUsuario(usuario);
            login.ClickBtnRegisterAnAccount();

            #endregion Act

            #region Assert

            Assert.AreEqual(myAccount.RetornaTextoDaMensagem(), "MY ACCOUNT", "Não foi encontrado o texto referente a pagina My account");
            Assert.AreEqual(myAccount.RetornaNomeDoUsuarioDaPagina(), usuario.NomeCompleto, "O nome do usuário esta diferente do esperado");

            #endregion Assert

            #region Finalization

            ManipularArquivoHelper.SalvarNoArquivoEmFormatoJson(usuario);

            #endregion Finalization
        }