1 | package br.gov.serpro.cte.email.compor; |
---|
2 | |
---|
3 | import org.junit.Test; |
---|
4 | |
---|
5 | import br.gov.serpro.cte.common.ExpressoMailTestCase; |
---|
6 | |
---|
7 | /** |
---|
8 | * TODO Ainda nao consegui pegar o campo do RichTextEditor para colocar conteudo |
---|
9 | * ao corpo do email. |
---|
10 | * |
---|
11 | * @author L.F.Estivalet (Serpro) |
---|
12 | * |
---|
13 | * Created on Nov 16, 2010 at 4:00:58 PM |
---|
14 | * |
---|
15 | */ |
---|
16 | public class EnviarEmailTestCase extends ExpressoMailTestCase { |
---|
17 | |
---|
18 | @Test |
---|
19 | public void testaEnviarEmail() throws Exception { |
---|
20 | super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), |
---|
21 | Valor.ASSUNTO.getValue()); |
---|
22 | super.sendEmail(); |
---|
23 | } |
---|
24 | |
---|
25 | @Test |
---|
26 | public void testaEnviarEmailSemDestinatario() throws Exception { |
---|
27 | super.composeEmail("", Valor.ASSUNTO_SEM_DESTINATARIO.getValue()); |
---|
28 | super.sendEmail(); |
---|
29 | super.assertMessage(Mensagem.SEM_DESTINATARIO.getValue()); |
---|
30 | } |
---|
31 | |
---|
32 | @Test |
---|
33 | public void testaEnviarEmailDestinatarioInvalido() throws Exception { |
---|
34 | super.composeEmail(Valor.EMAIL_INVALIDO.getValue(), |
---|
35 | Valor.ASSUNTO_EMAIL_INVALIDO.getValue()); |
---|
36 | super.sendEmail(); |
---|
37 | super.assertMessage(Mensagem.DESTINATARIO_INVALIDO.getValue()); |
---|
38 | } |
---|
39 | |
---|
40 | @Test |
---|
41 | public void testaEnviarEmailSemAssunto() throws Exception { |
---|
42 | super.composeEmail(Valor.EMAIL_TESTE_1.getValue(), ""); |
---|
43 | super.sendEmail(); |
---|
44 | assertTrue(selenium.getConfirmation().matches( |
---|
45 | Mensagem.SEM_ASSUNTO.getValue())); |
---|
46 | } |
---|
47 | |
---|
48 | @Test |
---|
49 | public void testaEnviarEmailMultiplosDestinatarios() throws Exception { |
---|
50 | super.composeEmail(Valor.EMAIL_TESTE_MULTIPLOS.getValue(), |
---|
51 | Valor.ASSUNTO_MULTIPLOS_DESTINATARIOS.getValue()); |
---|
52 | super.sendEmail(); |
---|
53 | } |
---|
54 | |
---|
55 | } |
---|