1 | package org.expressolivre.cte.email.compor; |
---|
2 | |
---|
3 | import org.expressolivre.cte.common.BaseEmailTestCase; |
---|
4 | import org.openqa.selenium.Alert; |
---|
5 | import org.testng.annotations.Test; |
---|
6 | |
---|
7 | /** |
---|
8 | * Suite:[FUN02.1] Compor Mensagem |
---|
9 | * |
---|
10 | * Caso de Teste: |
---|
11 | * |
---|
12 | * EL-533:Enviar mensagem sem assunto |
---|
13 | * |
---|
14 | * EL-1091:Enviar mensagem sem assunto - Cancelar |
---|
15 | * |
---|
16 | * Link: http://testlink.expressolivre.org/linkto.php?tprojectPrefix=EL&item= |
---|
17 | * testcase&id=EL-533 |
---|
18 | * |
---|
19 | * http://testlink.expressolivre.org/linkto.php?tprojectPrefix=EL&item= |
---|
20 | * testcase&id=EL-1091 |
---|
21 | * |
---|
22 | * @author L.F.Estivalet (Serpro) |
---|
23 | * |
---|
24 | * Created on Jan 4, 2011 at 3:53:07 PM |
---|
25 | * |
---|
26 | */ |
---|
27 | public class EnviarEmailSemAssuntoTestCase extends BaseEmailTestCase { |
---|
28 | |
---|
29 | /** |
---|
30 | * Executa o teste. Envia um email sem assunto. |
---|
31 | */ |
---|
32 | @Test |
---|
33 | public void enviarEmailSemAssuntoAceitar() { |
---|
34 | mp.composeEmail(EMAIL_TESTE_1, "", EMAIL_TEXTO_SEM_ASSUNTO); |
---|
35 | mp.sendMail(); |
---|
36 | // Sistema exibe um alerta para confirmacao do envio do email sem |
---|
37 | // assunto. |
---|
38 | Alert noSubject = driver.switchTo().alert(); |
---|
39 | assert MSG_ENVIAR_SEM_ASSUNTO.equals(noSubject.getText()); |
---|
40 | noSubject.accept(); |
---|
41 | mp.assertMessage(MSG_EMAIL_ENVIADO); |
---|
42 | } |
---|
43 | |
---|
44 | @Test |
---|
45 | public void enviarEmailSemAssuntoRejeitar() { |
---|
46 | mp.composeEmail(EMAIL_TESTE_1, "", EMAIL_TEXTO_SEM_ASSUNTO); |
---|
47 | mp.sendMail(); |
---|
48 | // Sistema exibe um alerta para confirmacao do envio do email sem |
---|
49 | // assunto. |
---|
50 | |
---|
51 | Alert noSubject = driver.switchTo().alert(); |
---|
52 | assert MSG_ENVIAR_SEM_ASSUNTO.equals(noSubject.getText()); |
---|
53 | noSubject.dismiss(); |
---|
54 | |
---|
55 | mp.closeMail(false); |
---|
56 | mp.discardNewEmail(); |
---|
57 | } |
---|
58 | |
---|
59 | } |
---|