Changeset 3532


Ignore:
Timestamp:
11/23/10 15:43:36 (13 years ago)
Author:
luiz-fernando
Message:

Ticket #1402 - Adicionado suporte para entrar com o conteudo do email

Location:
devel/testlink/automation
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • devel/testlink/automation/pom.xml

    r3521 r3532  
    4646                        <groupId>junit</groupId> 
    4747                        <artifactId>junit</artifactId> 
    48                         <version>4.1</version> 
     48                        <version>4.8.1</version> 
    4949                </dependency> 
    5050                <dependency> 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/common/ExpressoMailTestCase.java

    r3523 r3532  
    6363        } 
    6464 
    65         /** 
    66          * Cria um novo email informando destinatario e assunto. 
     65        private void writeBody(String text) { 
     66                selenium.getEval("selenium.browserbot.getCurrentWindow().document.getElementById('body_1').contentWindow.document.body.innerHTML='" 
     67                                + text + "';"); 
     68        } 
     69 
     70        /** 
     71         * Cria um novo email informando destinatario, assunto e conteudo do email. 
     72         *  
     73         * @param to 
     74         *            Destinatário (campo Para:). 
     75         * @param subject 
     76         *            Assunto do email. 
     77         * @param text 
     78         *            Conteudo do email. 
     79         * @throws Exception 
     80         */ 
     81        public void composeEmail(String to, String subject, String text) 
     82                        throws Exception { 
     83                this.composeEmail(); 
     84                selenium.type(Campo.PARA_1.getValue(), to); 
     85                selenium.type(Campo.ASSUNTO_1.getValue(), subject); 
     86                this.writeBody(text); 
     87 
     88        } 
     89 
     90        /** 
     91         * Cria um novo email informando destinatario, assunto e conteudo do email. 
    6792         *  
    6893         * @param to 
     
    90115 
    91116        /** 
     117         * @param to 
     118         *            Destinatário (campo Para:). 
     119         * @param subject 
     120         *            Assunto do email. 
     121         * @param text 
     122         *            Conteudo do email. 
    92123         * @param remove 
    93124         *            Se <code>true</code>, remove o logo apos o envio da Caixa de 
     
    95126         *            pressionar o botao Enviar. 
    96127         */ 
    97         public void sendEmail(String to, String subject, boolean remove) 
     128        public void sendEmail(String to, String subject, String text, boolean remove) 
    98129                        throws Exception { 
    99                 this.composeEmail(to, subject); 
     130                this.composeEmail(to, subject, text); 
    100131                selenium.click(Campo.ENVIAR_EMAIL_1.getValue()); 
    101132                this.assertMessage(Campo.MENSAGEM.value, Mensagem.EMAIL_ENVIADO.value); 
     
    473504                                "[SELENIUM] Teste envio mensagem somente cópia"), // 
    474505                ASSUNTO_SOMENTE_COPIA_OCULTA( 
    475                                 "[SELENIUM] Teste mensagem somente cópia oculta"); 
     506                                "[SELENIUM] Teste mensagem somente cópia oculta"), // 
     507                TEXTO_EMAIL( 
     508                                "<p>Email enviado a partir do Selenium!</p><p>Favor ignorar!</p>"), // 
     509                TEXTO_EMAIL_CONFIRMACAO_LEITURA( 
     510                                "<p>Email enviado a partir do Selenium!</p><p>Teste de confirmação de leitura</p><p>Favor ignorar!</p>"), // 
     511                TEXTO_EMAIL_COPIA_OCULTA( 
     512                                "<p>Email enviado a partir do Selenium!</p><p>Teste de cópia oculta</p><p>Favor ignorar!</p>"), // 
     513                TEXTO_EMAIL_COPIA( 
     514                                "<p>Email enviado a partir do Selenium!</p><p>Teste de cópia</p><p>Favor ignorar!</p>"), // 
     515                TEXTO_EMAIL_IMPORTANTE( 
     516                                "<p>Email enviado a partir do Selenium!</p><p>Teste de email importante</p><p>Favor ignorar!</p>"), // 
     517                TEXTO_EMAIL_MULTIPLOS_ANEXOS( 
     518                                "<p>Email enviado a partir do Selenium!</p><p>Teste de email com múltiplos anexos</p><p>Favor ignorar!</p>"), // 
     519                TEXTO_EMAIL_MULTIPLOS_DESTINATARIOS( 
     520                                "<p>Email enviado a partir do Selenium!</p><p>Teste de email com múltiplos destinatários</p><p>Favor ignorar!</p>"), // 
     521                TEXTO_EMAIL_SEM_ASSUNTO( 
     522                                "<p>Email enviado a partir do Selenium!</p><p>Teste de email sem assunto</p><p>Favor ignorar!</p>"), // 
     523                TEXTO_EMAIL_SALVO( 
     524                                "<p>Email enviado a partir do Selenium!</p><p>Teste para salvar um email na pasta rascunhos</p><p>Favor ignorar!</p>"), // 
     525                TEXTO_EMAIL_ANEXO( 
     526                                "<p>Email enviado a partir do Selenium!</p><p>Teste de anexo</p><p>Favor ignorar!</p>"); 
    476527                private String value; 
    477528 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/email/compor/EnviarEmailAnexoTestCase.java

    r3523 r3532  
    3131        public void testa() throws Exception { 
    3232                super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), 
    33                                 Valor.ASSUNTO_ANEXO.getValue()); 
     33                                Valor.ASSUNTO_ANEXO.getValue(), 
     34                                Valor.TEXTO_EMAIL_ANEXO.getValue()); 
    3435                selenium.click(Campo.ADICIONAR_ANEXO.getValue()); 
    3536                selenium.type(Campo.ANEXO_1.getValue(), Valor.ANEXO_1.getValue()); 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/email/compor/EnviarEmailConfirmacaoLeituraTestCase.java

    r3523 r3532  
    1616        public void testa() throws Exception { 
    1717                super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), 
    18                                 Valor.ASSUNTO_CONFIRMACAO_LEITURA.getValue()); 
     18                                Valor.ASSUNTO_CONFIRMACAO_LEITURA.getValue(), 
     19                                Valor.TEXTO_EMAIL_CONFIRMACAO_LEITURA.getValue()); 
    1920                selenium.click(Campo.CONFIRMACAO_LEITURA.getValue()); 
    2021                super.sendEmail(); 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/email/compor/EnviarEmailCopiaOcultaTestCase.java

    r3523 r3532  
    1616        public void testa() throws Exception { 
    1717                super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), 
    18                                 Valor.ASSUNTO_COPIA_OCULTA.getValue()); 
     18                                Valor.ASSUNTO_COPIA_OCULTA.getValue(), 
     19                                Valor.TEXTO_EMAIL_COPIA_OCULTA.getValue()); 
    1920                selenium.click(Campo.COPIA_OCULTA_1.getValue()); 
    2021                selenium.type(Campo.COPIA_OCULTA_CAMPO_1.getValue(), 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/email/compor/EnviarEmailCopiaTestCase.java

    r3523 r3532  
    1616        public void testa() throws Exception { 
    1717                super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), 
    18                                 Valor.ASSUNTO_COPIA.getValue()); 
     18                                Valor.ASSUNTO_COPIA.getValue(), 
     19                                Valor.TEXTO_EMAIL_COPIA.getValue()); 
    1920                selenium.click(Campo.COPIA_1.getValue()); 
    2021                selenium.type(Campo.COPIA_CAMPO_1.getValue(), 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/email/compor/EnviarEmailImportanteTestCase.java

    r3523 r3532  
    3131        public void testa() throws Exception { 
    3232                super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), 
    33                                 Valor.ASSUNTO_IMPORTANTE.getValue()); 
     33                                Valor.ASSUNTO_IMPORTANTE.getValue(), 
     34                                Valor.TEXTO_EMAIL_IMPORTANTE.getValue()); 
    3435                selenium.click(Campo.IMPORTANTE_CHECKBOX.getValue()); 
    3536                super.sendEmail(); 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/email/compor/EnviarEmailMultiplosAnexosTestCase.java

    r3523 r3532  
    1616        public void testa() throws Exception { 
    1717                super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), 
    18                                 Valor.ASSUNTO_MULTIPLOS_ANEXOS.getValue()); 
     18                                Valor.ASSUNTO_MULTIPLOS_ANEXOS.getValue(), 
     19                                Valor.TEXTO_EMAIL_MULTIPLOS_ANEXOS.getValue()); 
    1920                selenium.click(Campo.ADICIONAR_ANEXO.getValue()); 
    2021                selenium.type(Campo.ANEXO_1.getValue(), Valor.ANEXO_1.getValue()); 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/email/compor/EnviarEmailMultiplosDestinatariosTestCase.java

    r3523 r3532  
    3232        public void testa() throws Exception { 
    3333                super.sendEmail(Valor.EMAIL_TESTE_MULTIPLOS.getValue(), 
    34                                 Valor.ASSUNTO_MULTIPLOS_DESTINATARIOS.getValue(), apagarEmail); 
     34                                Valor.ASSUNTO_MULTIPLOS_DESTINATARIOS.getValue(), 
     35                                Valor.TEXTO_EMAIL_MULTIPLOS_DESTINATARIOS.getValue(), 
     36                                apagarEmail); 
    3537        } 
    3638} 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/email/compor/EnviarEmailSemAssuntoTestCase.java

    r3523 r3532  
    1717        @Test 
    1818        public void testa() throws Exception { 
    19                 super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), ""); 
     19                super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), "", 
     20                                Valor.TEXTO_EMAIL_SEM_ASSUNTO.getValue()); 
    2021                super.sendEmail(); 
    2122                assertTrue(selenium.getConfirmation().matches( 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/email/compor/EnviarEmailTestCase.java

    r3523 r3532  
    3535        public void testa() throws Exception { 
    3636                super.sendEmail(Valor.EMAIL_TESTE_1.getValue(), 
    37                                 Valor.ASSUNTO.getValue(), apagarEmail); 
     37                                Valor.ASSUNTO.getValue(), Valor.TEXTO_EMAIL.getValue(), 
     38                                apagarEmail); 
    3839        } 
    3940} 
  • devel/testlink/automation/src/test/java/br/gov/serpro/cte/email/compor/SalvarEmailTestCase.java

    r3523 r3532  
    1616        public void testaSalvarEmail() throws Exception { 
    1717                super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), 
    18                                 Valor.ASSUNTO_SALVAR.getValue()); 
     18                                Valor.ASSUNTO_SALVAR.getValue(), 
     19                                Valor.TEXTO_EMAIL_SALVO.getValue()); 
    1920                selenium.click(Campo.SALVAR.getValue()); 
    2021                super.waitForElement(Campo.MENSAGEM.getValue()); 
Note: See TracChangeset for help on using the changeset viewer.