Index: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/email/MailPage.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/email/MailPage.java	(revision 3799)
+++ devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/email/MailPage.java	(revision 3853)
@@ -134,4 +134,14 @@
 	private WebElement editEmail;
 
+	@FindBy(xpath = "//div[@id='lertContainer']/div[@id='lertWindow']/div[@id='lertButtons']/a[1]")
+	private WebElement cancelNewEmail;
+
+	@FindBy(xpath = "//div[@id='lertContainer']/div[@id='lertWindow']/div[@id='lertButtons']/a[2]")
+	private WebElement discardNewEmail;
+
+	@FindBy(xpath = "//div[@id='lertContainer']/div[@id='lertWindow']/div[@id='lertButtons']/a[3]")
+	/** Esse botao eh no alerta ao fechar uma mensagem nao salva e nao o botao salvar para rascunhos. */
+	private WebElement saveNewEmail;
+
 	/**
 	 * @param driver
@@ -144,4 +154,16 @@
 		this.newEmail.click();
 		waitForElement(By.id("to_1"));
+	}
+
+	public void cancelNewEmail() {
+		this.cancelNewEmail.click();
+	}
+
+	public void discardNewEmail() {
+		this.discardNewEmail.click();
+	}
+
+	public void saveNewEmail() {
+		this.saveNewEmail.click();
 	}
 
@@ -471,4 +493,8 @@
 			closeAlert.accept();
 		}
+	}
+
+	public void closeMail(String id) {
+		super.clickElement(By.xpath("//td[@id='border_id_" + id + "']//img"));
 	}
 
Index: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/SalvarEmailSomenteCopiaTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/SalvarEmailSomenteCopiaTestCase.java	(revision 3799)
+++ devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/SalvarEmailSomenteCopiaTestCase.java	(revision 3853)
@@ -50,4 +50,5 @@
 		Assert.assertEquals(EMAIL_TEXTO_SALVAR_SOMENTE_COPIA, body);
 
+		mp.closeMail(id);
 	}
 
Index: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/EnviarEmailSemAssuntoTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/EnviarEmailSemAssuntoTestCase.java	(revision 3799)
+++ devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/EnviarEmailSemAssuntoTestCase.java	(revision 3853)
@@ -48,8 +48,16 @@
 		// Sistema exibe um alerta para confirmacao do envio do email sem
 		// assunto.
+
 		Alert noSubject = driver.switchTo().alert();
 		assert MSG_ENVIAR_SEM_ASSUNTO.equals(noSubject.getText());
 		noSubject.dismiss();
+
 		mp.closeMail(false);
+
+		// Ao tentar fechar o novo email um novo alerta aparece.
+		Alert discard = driver.switchTo().alert();
+		assert MSG_EMAIL_DESCARTAR.equals(noSubject.getText());
+		discard.accept();
+
 	}
 
Index: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/SalvarEmailSomenteCopiaOcultaTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/SalvarEmailSomenteCopiaOcultaTestCase.java	(revision 3799)
+++ devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/SalvarEmailSomenteCopiaOcultaTestCase.java	(revision 3853)
@@ -50,4 +50,6 @@
 		body = body.substring(spanOpen, spanClose);
 		Assert.assertEquals(EMAIL_TEXTO_SALVAR_SOMENTE_COPIA_OCULTA, body);
+
+		mp.closeMail(id);
 	}
 
Index: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/DescartarEmailTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/DescartarEmailTestCase.java	(revision 3853)
+++ devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/email/compor/DescartarEmailTestCase.java	(revision 3853)
@@ -0,0 +1,59 @@
+package org.expressolivre.cte.email.compor;
+
+import org.expressolivre.cte.common.BaseEmailTestCase;
+import org.testng.annotations.Test;
+
+/**
+ * Suite:[FUN02.1] Compor Mensagem
+ * 
+ * Caso de Teste:
+ * 
+ * EL-1092:Descartar nova mensagem nao salva - Cancelar
+ * 
+ * EL-1239:Descartar nova mensagem nao salva - Descartar
+ * 
+ * EL-1240:Descartar nova mensagem nao salva - Salvar
+ * 
+ * Link: http://testlink.expressolivre.org/linkto.php?tprojectPrefix=EL&item=
+ * testcase&id=EL-1092
+ * 
+ * http://testlink.expressolivre.org/linkto.php?tprojectPrefix=EL&item=
+ * testcase&id=EL-1239
+ * 
+ * http://testlink.expressolivre.org/linkto.php?tprojectPrefix=EL&item=
+ * testcase&id=EL-1240
+ * 
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Feb 23, 2011 at 3:10:58 PM
+ * 
+ */
+public class DescartarEmailTestCase extends BaseEmailTestCase {
+
+	/**
+	 * Executa o teste. Testa os botoes Cancelar e Descartar nova mensagem.
+	 */
+	@Test
+	public void testCancelDiscard() {
+		mp.composeEmail(EMAIL_TESTE_1, EMAIL_ASSUNTO, EMAIL_TEXTO);
+		mp.closeMail(false);
+		mp.cancelNewEmail();
+		mp.closeMail(false);
+		mp.discardNewEmail();
+	}
+
+	@Test
+	public void testSalvar() {
+		mp.composeEmail(EMAIL_TESTE_1, EMAIL_ASSUNTO_SALVAR, EMAIL_TEXTO_SALVAR);
+		mp.closeMail(false);
+		mp.saveNewEmail();
+
+		// Espera um momento para a mensagem ser salva...
+		mp.waitAMoment(15000);
+
+		// Ir na pasta Rascunhos para assegurar que o email foi salvo.
+		mp.openFolder("lINBOX/Draftstree_folders");
+		String id = mp.readEmail(EMAIL_ASSUNTO_SALVAR);
+	}
+
+}
Index: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/config.properties
===================================================================
--- devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/config.properties	(revision 3799)
+++ devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/config.properties	(revision 3853)
@@ -1,9 +1,9 @@
-#url=https://10.30.202.205
-#user=teste1.mp
-#passwd=teste
+url=https://10.30.202.205
+user=teste1.mp
+passwd=teste
 
-url=https://cte.serpro.gov.br
-user=luiz-fernando.estivalet
-passwd=senha
+#url=https://cte.serpro.gov.br
+#user=luiz-fernando.estivalet
+#passwd=senha
 
 config.email=email.preferences_mp.properties
Index: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/mensagens.properties
===================================================================
--- devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/mensagens.properties	(revision 3799)
+++ devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/mensagens.properties	(revision 3853)
@@ -20,2 +20,3 @@
 email.movido=Mensagem movida para a pasta {0}
 pasta.removida=A pasta {0} foi removida com sucesso!
+descartar.mensagem=Sua mensagem não foi salva ou enviada. Descartar a mensagem?
Index: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/Constants.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/Constants.java	(revision 3799)
+++ devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/Constants.java	(revision 3853)
@@ -115,4 +115,6 @@
 	public static final String MSG_EMAIL_PASTA_REMOVIDA = Config.getInstance()
 			.getMensagem("pasta.removida", EMAIL_PASTA_TESTE);
+	public static final String MSG_EMAIL_DESCARTAR = Config.getInstance()
+			.getMensagem("descartar.mensagem", EMAIL_PASTA_TESTE);
 
 }
Index: devel/testlink/automation2.0/[FUN02.1] - ComporMensagem.xml
===================================================================
--- devel/testlink/automation2.0/[FUN02.1] - ComporMensagem.xml	(revision 3799)
+++ devel/testlink/automation2.0/[FUN02.1] - ComporMensagem.xml	(revision 3853)
@@ -27,4 +27,7 @@
 			<class name="org.expressolivre.cte.email.compor.EnviarEmailDestinatarioInvalidoTestCase" />
 			<class name="org.expressolivre.cte.email.compor.EnviarEmailSemDestinatarioTestCase" />
+			<class name="org.expressolivre.cte.email.compor.SalvarEmailSomenteCopiaOcultaTestCase" />
+			<class name="org.expressolivre.cte.email.compor.SalvarEmailSomenteCopiaTestCase" />
+			<class name="org.expressolivre.cte.email.compor.DescartarEmailTestCase" />
 		</classes>
 	</test>
Index: devel/testlink/automation2.0/pom.xml
===================================================================
--- devel/testlink/automation2.0/pom.xml	(revision 3799)
+++ devel/testlink/automation2.0/pom.xml	(revision 3853)
@@ -49,5 +49,5 @@
 		  <groupId>org.testng</groupId>
 		  <artifactId>testng</artifactId>
-		  <version>5.14.1</version>
+		  <version>5.14.3</version>
 		  <scope>test</scope>
 		</dependency>
