public void AdicionarUsuarioAoProjetoComSucesso()
        {
            #region Inserindo novo usuário
            string username = "******" + GeneralHelpers.ReturnStringWithRandomCharacters(4);
            string realname = "Realname_" + GeneralHelpers.ReturnStringWithRandomCharacters(4);
            string enabled  = "1";
            string cookie   = GeneralHelpers.ReturnStringWithRandomCharacters(12);
            string email    = GeneralHelpers.ReturnStringWithRandomCharacters(10) + "@teste.com";

            var usuarioCriadoDB = usersDBSteps.InserirUsuarioDB(username, realname, enabled, cookie, email);
            #endregion

            #region Inserindo um novo projeto
            string projectName     = "Project_" + GeneralHelpers.ReturnStringWithRandomCharacters(5);
            var    projetoCriadoDB = projectsDBSteps.InserirProjetoDB(projectName);
            #endregion

            #region Actions
            manageUserFlows.AcessarUsuarioCriadoAtivo(menu, username);
            manageUserEditPage.ClicarNomeProjeto(projetoCriadoDB.ProjectName);
            manageUserEditPage.ClicarAdicionarUsuario();
            #endregion

            #region Validations
            var projetoAtribuidoUsuarioDB = projectsDBSteps.ConsultarProjetoAtribuidoAoUsuarioDB(projetoCriadoDB.ProjectId, usuarioCriadoDB.UserId);
            Assert.IsNotNull(projetoAtribuidoUsuarioDB, "O projeto não foi atribuído ao usuário.");
            #endregion

            usersDBSteps.DeletarUsuarioDB(usuarioCriadoDB.UserId);
            projectsDBSteps.DeletarProjetoDB(projetoCriadoDB.ProjectId);
            projectsDBSteps.DeletarProjetoAtribuidoAoUsuarioDB(projetoCriadoDB.ProjectId, usuarioCriadoDB.UserId);
        }
Beispiel #2
0
        public void CriarProjetoComSucesso()
        {
            #region Parameters
            string projectName = "Project_" + GeneralHelpers.ReturnStringWithRandomCharacters(5);
            string status      = "release";
            string viewState   = "privado";
            string description = "Criando um novo projeto.";

            //Resultado esperado
            int    statusExpected        = 30;
            int    viewStateExpected     = 50;
            string messageSucessExpected = "Operação realizada com sucesso.";
            #endregion

            #region Actions
            myViewPage.ClicarMenu(menu);
            manageProjPage.ClicarCriarNovoProjeto();
            manageProjCreatePage.PreencherNomeProjeto(projectName);
            manageProjCreatePage.SelecionarEstadoProjeto(status);
            manageProjCreatePage.SelecionarVisibilidade(viewState);
            manageProjCreatePage.PreencherDescricao(description);
            manageProjCreatePage.ClicarAdicionarProjeto();
            #endregion

            #region Validations
            Assert.AreEqual(messageSucessExpected, manageProjCreatePage.RetornaMensagemDeSucesso(), "A mensagem retornada não é a esperada.");

            var projetoCriadoDB = projectsDBSteps.ConsultarProjetoDB(projectName);

            Assert.Multiple(() =>
            {
                Assert.IsTrue(manageProjPage.RetornaSeONomeDoProjetoEstaSendoExibidoNaTela(projectName), "O projeto não está sendo exibido na tela.");
                Assert.AreEqual(projetoCriadoDB.ProjectName, projectName, projectName, "O nome do projeto não é o esperado.");
                Assert.AreEqual(projetoCriadoDB.ProjectStatusId, statusExpected, "O status não é o esperado.");
                Assert.AreEqual(projetoCriadoDB.ViewState, viewStateExpected, "A visualização do estado não é a esperada.");
                Assert.AreEqual(projetoCriadoDB.Description, description, "A descrição retornada não é a esperada.");
            });
            #endregion

            projectsDBSteps.DeletarProjetoDB(projetoCriadoDB.ProjectId);
        }