Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/email/MailPage.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/email/MailPage.java	(revision 3663)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/email/MailPage.java	(revision 3708)
@@ -2,5 +2,8 @@
 
 import org.apache.commons.lang.StringUtils;
+import org.openqa.selenium.Alert;
+import org.openqa.selenium.By;
 import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.RenderedWebElement;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
@@ -30,5 +33,20 @@
 
 	@FindBy(id = "important_message_1")
+	/** Flag de importante no momento de compor um email. */
 	private WebElement important;
+
+	@FindBy(xpath = "//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[3]")
+	/** Flag de importante de um email aberto. */
+	private WebElement importantFlag;
+
+	@FindBy(id = "span_flag_FLAGGED")
+	/** Filtra emails importantes. */
+	private WebElement importantFilter;
+
+	@FindBy(xpath = "//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[3]")
+	private WebElement normalFlag;
+
+	@FindBy(xpath = "//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[2]")
+	private WebElement notReadFlag;
 
 	@FindBy(id = "return_receipt_1")
@@ -50,5 +68,5 @@
 	private WebElement saveEmail;
 
-	@FindBy(xpath = "//div[@id='div_message_scroll_1']/form/table/tbody/tr[10]/td[2]/a")
+	@FindBy(linkText = "Anexos: adicionar+")
 	private WebElement attachmentLink;
 
@@ -56,4 +74,7 @@
 	private WebElement attachment;
 
+	@FindBy(id = "inputFile_1_2")
+	private WebElement attachment2;
+
 	@FindBy(xpath = "//div[@id='footer_menu']/table[@id='footer_box']/tbody/tr[@id='table_message']/td[@id='span_options']/span[1]/span")
 	private WebElement deleteEmailLink;
@@ -71,4 +92,32 @@
 	private WebElement totalEmails;
 
+	@FindBy(xpath = "//div[@id='exmail_main_body']/table[1]/tbody[@id='border_tbody']/tr[1]/td[2]/table/tbody/tr/td[1]")
+	private WebElement emailTab;
+
+	@FindBy(id = "chk_box_select_all_messages")
+	private WebElement selectAllEmails;
+
+	@FindBy(xpath = "//td[@id='link_tools']/div/span")
+	private WebElement toolsMenu;
+
+	@FindBy(xpath = "//div[@id='menu_tools']/table/tbody/tr[4]/td")
+	private WebElement editFolder;
+
+	@FindBy(xpath = "//input[@value='Nova Pasta']")
+	private WebElement createNewFolder;
+
+	@FindBy(xpath = "//input[@value='Excluir pasta']")
+	private WebElement deleteFolder;
+
+	@FindBy(xpath = "//span[@onclick='wfolders.makeWindow(\"\",\"move_to\")']")
+	/** Opcao de mover do rodape. */
+	private WebElement moveEmailLink;
+
+	@FindBy(id = "dJSWin_wfolders_bok")
+	private WebElement moveEmailButton;
+
+	@FindBy(xpath = "//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[3]/span[3]")
+	private WebElement forwardEmail;
+
 	/**
 	 * @param driver
@@ -78,15 +127,14 @@
 	}
 
-	/**
-	 * @param to
-	 * @param subject
-	 * @param body
-	 */
-	public void composeEmail(String to, String subject, String body) {
+	public void createNewEmail() {
 		this.newEmail.click();
 		waitForElementById("to_1");
-		this.to.sendKeys(to);
+	}
+
+	public void setSubject(String subject) {
 		this.subject.sendKeys(subject != null ? subject : "");
-
+	}
+
+	public void setBody(String body) {
 		// Foi o unico jeito que consegui pegar o richtexteditor...
 		if (body != null) {
@@ -98,4 +146,39 @@
 
 	/**
+	 * @param to
+	 * @param subject
+	 * @param body
+	 */
+	public void composeEmail(String to, String subject, String body) {
+		this.createNewEmail();
+		this.to.sendKeys(to);
+		this.setSubject(subject);
+		this.setBody(body);
+	}
+
+	public String readEmail(String subject) {
+		String id = findEmailIdBySuject(subject);
+		clickElement(id);
+		return id.substring(id.lastIndexOf("_") + 1);
+		// waitForElementByXpath("//div[@id='exmail_main_body']/table[1]/tbody[@id='border_tbody']/tr[1]/td[2]/table/tbody/tr/td[1]");
+	}
+
+	/**
+	 * Encaminha uma mensagem.
+	 * 
+	 * @param id
+	 *            Id da mensagem a ser encaminhada
+	 * @param to
+	 *            Destinatario
+	 */
+	public void forwardEmail(String id, String to) {
+		super.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[3]/span[3]");
+		this.forwardEmail.click();
+		super.waitForElementById("to_" + id);
+		driver.findElement(By.id("to_" + id)).sendKeys(to);
+		driver.findElement(By.id("send_button_" + id)).click();
+	}
+
+	/**
 	 * Abre uma pasta de email especifica.
 	 * 
@@ -119,4 +202,8 @@
 	}
 
+	public void setImportantFilter() {
+		this.importantFilter.click();
+	}
+
 	/**
 	 * Limpa a lixeira.
@@ -134,9 +221,56 @@
 	}
 
+	public void moveEmail(String folderName) {
+		this.moveEmailLink.click();
+		super.findAndClickElement("lINBOX/" + folderName + "wfolders_tree");
+		this.moveEmailButton.click();
+	}
+
+	public void editFolder() {
+		this.toolsMenu.click();
+		this.waitForElementByXpath("//div[@id='menu_tools']/table/tbody/tr[4]/td");
+		this.editFolder.click();
+	}
+
+	public void createNewFolder(String folderName) {
+		this.editFolder();
+		this.createNewFolder.click();
+		Alert newFolder = driver.switchTo().alert();
+		assert "Insira o nome da nova pasta: ".equals(newFolder.getText());
+		newFolder.sendKeys(folderName);
+		newFolder.accept();
+	}
+
+	public void deleteFolder(String folderName) {
+		this.editFolder();
+		this.driver.findElement(By.id("lINBOX/" + folderName + "folders_tree"))
+				.click();
+		this.deleteFolder.click();
+		Alert confirm = driver.switchTo().alert();
+		assert ("VocÃª gostaria de excluir a pasta: " + folderName + "?")
+				.equals(confirm.getText());
+		confirm.accept();
+	}
+
 	/**
 	 * Marca email sendo composto como importante.
 	 */
+	public void checkImportantFlag() {
+		this.important.click();
+	}
+
 	public void setImportantFlag() {
-		this.important.click();
+		this.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[3]");
+		this.importantFlag.click();
+	}
+
+	public void setNormalFlag() {
+		this.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[3]");
+		this.normalFlag.click();
+	}
+
+	public void setNotReadFlag() {
+		this.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[2]");
+		this.notReadFlag.click();
 	}
 
@@ -144,5 +278,5 @@
 	 * Marca solicitacao de confirmacao de leitura do email sendo composto.
 	 */
-	public void setReturnReceipt() {
+	public void checkReturnReceipt() {
 		this.returnReceipt.click();
 	}
@@ -163,4 +297,8 @@
 	public void deleteEmail() {
 		this.deleteEmailLink.click();
+	}
+
+	public void selectAllEmails() {
+		this.selectAllEmails.click();
 	}
 
@@ -196,4 +334,9 @@
 		this.attachmentLink.click();
 		this.attachment.sendKeys(attachment);
+	}
+
+	public void addAttachment2(String attachment) {
+		this.attachmentLink.click();
+		this.attachment2.sendKeys(attachment);
 	}
 
@@ -244,4 +387,37 @@
 
 	/**
+	 * @return Ids de todos os emails da pasta selecionada.
+	 */
+	public String[] getEmailIds() {
+		String[] ids = new String[this.getTotalEmails()];
+		for (int i = 1; i <= this.getTotalEmails(); i++) {
+			String id = driver
+					.findElement(
+							By.xpath("//div[@id='divScrollMain_0']/table[@id='table_box']/tbody[@id='tbody_box']/tr["
+									+ i + "]/td[1]/input[1]")).getAttribute(
+							"id");
+			ids[i - 1] = id.substring(id.lastIndexOf("_") + 1);
+		}
+		return ids;
+	}
+
+	/**
+	 * @param emailId
+	 *            Id do email.
+	 * @return <code>true</code> se email importante, <code>false</code> caso
+	 *         contrario.
+	 */
+	public boolean isImportant(String emailId) {
+		return super
+				.isDisplayed((RenderedWebElement) driver.findElement(By
+						.xpath("//div[@id='exmail_main_body']/div[@id='content_id_0']/div[@id='divScrollMain_0']/table[@id='table_box']/tbody[@id='tbody_box']/tr[@id='"
+								+ emailId + "']/td[5]/img")));
+	}
+
+	public String findEmailIdBySuject(String subject) {
+		return findEmailIdBySuject(subject, false);
+	}
+
+	/**
 	 * Verifica se mensagem informada corresponde ao exibido pelo Expresso na
 	 * div onde sao exibidas mensagens ao usuario.
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/common/Page.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/common/Page.java	(revision 3663)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/common/Page.java	(revision 3708)
@@ -43,4 +43,15 @@
 
 	/**
+	 * Aguarda elemento aparecer e depois clica.
+	 * 
+	 * @param id
+	 *            Id do elemento a ser clicado.
+	 */
+	public void findAndClickElement(String id) {
+		this.waitForElementById(id);
+		this.clickElement(id);
+	}
+
+	/**
 	 * Aguarda por um elemento.
 	 * 
@@ -76,5 +87,5 @@
 	 * @param e
 	 */
-	private void isDisplayed(RenderedWebElement e) {
+	public boolean isDisplayed(RenderedWebElement e) {
 		System.out.println("starting tentatives");
 		// Up to 10 times
@@ -83,5 +94,5 @@
 			// Check whether our element is visible yet
 			if (e.isDisplayed()) {
-				return;
+				return true;
 			}
 
@@ -92,5 +103,5 @@
 			}
 		}
-
+		return false;
 	}
 
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailMultiplosAnexosTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailMultiplosAnexosTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailMultiplosAnexosTestCase.java	(revision 3708)
@@ -0,0 +1,24 @@
+package br.gov.serpro.expresso.cte.email.compor;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 18, 2011 at 9:02:46 AM
+ * 
+ */
+public class EnviarEmailMultiplosAnexosTestCase extends BaseEmailTestCase {
+	@Test
+	public void test() {
+		mp.composeEmail(EMAIL_TESTE_1, EMAIL_ASSUNTO_MULTIPLOS_ANEXOS,
+				EMAIL_TEXTO_MULTIPLOS_ANEXOS);
+		mp.addAttachment("/home/luiz/Desktop/arquivo.txt");
+		mp.addAttachment2("/home/luiz/Desktop/arquivo2.txt");
+		mp.sendMail();
+		mp.assertMessage(MSG_EMAIL_ENVIADO);
+	}
+
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailSomenteCopiaTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailSomenteCopiaTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailSomenteCopiaTestCase.java	(revision 3708)
@@ -0,0 +1,24 @@
+package br.gov.serpro.expresso.cte.email.compor;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 18, 2011 at 9:31:01 AM
+ * 
+ */
+public class EnviarEmailSomenteCopiaTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() {
+		mp.createNewEmail();
+		mp.setCarbonCopy(EMAIL_TESTE_1);
+		mp.setSubject(EMAIL_ASSUNTO_COPIA);
+		mp.setBody(EMAIL_ASSUNTO_COPIA);
+		mp.sendMail();
+		mp.assertMessage(MSG_EMAIL_ENVIADO);
+	}
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailConfirmacaoLeituraTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailConfirmacaoLeituraTestCase.java	(revision 3663)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailConfirmacaoLeituraTestCase.java	(revision 3708)
@@ -17,5 +17,5 @@
 		mp.composeEmail("luiz-fernando.estivalet@cte.serpro.gov.br",
 				"assunto conf leitura", "texto conf leitura");
-		mp.setReturnReceipt();
+		mp.checkReturnReceipt();
 		mp.sendMail();
 		mp.assertMessage("Sua mensagem foi enviada e salva.");
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailDestinatarioInvalidoTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailDestinatarioInvalidoTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailDestinatarioInvalidoTestCase.java	(revision 3708)
@@ -0,0 +1,20 @@
+package br.gov.serpro.expresso.cte.email.compor;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 18, 2011 at 8:59:39 AM
+ * 
+ */
+public class EnviarEmailDestinatarioInvalidoTestCase extends BaseEmailTestCase {
+	@Test
+	public void test() {
+		mp.composeEmail(EMAIL_INVALIDO, EMAIL_ASSUNTO, EMAIL_TEXTO);
+		mp.sendMail();
+		mp.assertMessage(MSG_EMAIL_DESTINATARIO_INVALIDO);
+	}
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailSomenteCopiaOcultaTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailSomenteCopiaOcultaTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailSomenteCopiaOcultaTestCase.java	(revision 3708)
@@ -0,0 +1,24 @@
+package br.gov.serpro.expresso.cte.email.compor;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 18, 2011 at 9:31:01 AM
+ * 
+ */
+public class EnviarEmailSomenteCopiaOcultaTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() {
+		mp.createNewEmail();
+		mp.setBlindCarbonCopy(EMAIL_TESTE_1);
+		mp.setSubject(EMAIL_ASSUNTO_COPIA_OCULTA);
+		mp.setBody(EMAIL_ASSUNTO_COPIA_OCULTA);
+		mp.sendMail();
+		mp.assertMessage(MSG_EMAIL_ENVIADO);
+	}
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailTestCase.java	(revision 3663)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailTestCase.java	(revision 3708)
@@ -17,5 +17,5 @@
 		mp.composeEmail(EMAIL_TESTE_1, EMAIL_ASSUNTO, EMAIL_TEXTO);
 		mp.sendMail();
-		mp.assertMessage(EMAIL_ENVIADO);
+		mp.assertMessage(MSG_EMAIL_ENVIADO);
 	}
 }
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailImportanteTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailImportanteTestCase.java	(revision 3663)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailImportanteTestCase.java	(revision 3708)
@@ -16,5 +16,5 @@
 		mp.composeEmail("luiz-fernando.estivalet@cte.serpro.gov.br",
 				"assunto importante", "texto importante");
-		mp.setImportantFlag();
+		mp.checkImportantFlag();
 		mp.sendMail();
 		mp.assertMessage("Sua mensagem foi enviada e salva.");
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailMultiplosDestinatariosTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailMultiplosDestinatariosTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/compor/EnviarEmailMultiplosDestinatariosTestCase.java	(revision 3708)
@@ -0,0 +1,24 @@
+package br.gov.serpro.expresso.cte.email.compor;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 18, 2011 at 9:24:40 AM
+ * 
+ */
+public class EnviarEmailMultiplosDestinatariosTestCase extends
+		BaseEmailTestCase {
+	@Test
+	public void test() {
+		mp.composeEmail(EMAIL_TESTE_N_DESTINATARIOS,
+				EMAIL_ASSUNTO_MULTIPLOS_DESTINATARIOS,
+				EMAIL_TEXTO_MULTIPLOS_DESTINATARIOS);
+		mp.sendMail();
+		mp.assertMessage(MSG_EMAIL_ENVIADO);
+	}
+
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/responder/EncaminharEmailTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/responder/EncaminharEmailTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/responder/EncaminharEmailTestCase.java	(revision 3708)
@@ -0,0 +1,20 @@
+package br.gov.serpro.expresso.cte.email.responder;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 19, 2011 at 3:05:45 PM
+ * 
+ */
+public class EncaminharEmailTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() {
+		String id = mp.readEmail(EMAIL_ASSUNTO);
+		mp.forwardEmail(id, EMAIL_TESTE_1);
+	}
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/MarcarEmailNaoLidoTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/MarcarEmailNaoLidoTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/MarcarEmailNaoLidoTestCase.java	(revision 3708)
@@ -0,0 +1,22 @@
+package br.gov.serpro.expresso.cte.email.ler;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 18, 2011 at 12:02:55 PM
+ * 
+ */
+public class MarcarEmailNaoLidoTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() {
+		mp.readEmail(EMAIL_ASSUNTO);
+		mp.setNotReadFlag();
+		mp.assertMessage(MSG_EMAIL_NAO_LIDO);
+	}
+
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/MarcarEmailNormalTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/MarcarEmailNormalTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/MarcarEmailNormalTestCase.java	(revision 3708)
@@ -0,0 +1,22 @@
+package br.gov.serpro.expresso.cte.email.ler;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 18, 2011 at 11:57:45 AM
+ * 
+ */
+public class MarcarEmailNormalTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() {
+		mp.readEmail(EMAIL_ASSUNTO);
+		mp.setNormalFlag();
+		mp.assertMessage(MSG_EMAIL_NORMAL);
+	}
+
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/LerEmailTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/LerEmailTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/LerEmailTestCase.java	(revision 3708)
@@ -0,0 +1,13 @@
+package br.gov.serpro.expresso.cte.email.ler;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+public class LerEmailTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() {
+		mp.readEmail(EMAIL_ASSUNTO);
+	}
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/ApagarEmailAbertoTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/ApagarEmailAbertoTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/ApagarEmailAbertoTestCase.java	(revision 3708)
@@ -0,0 +1,22 @@
+package br.gov.serpro.expresso.cte.email.ler;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 18, 2011 at 9:39:28 AM
+ * 
+ */
+public class ApagarEmailAbertoTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() {
+		mp.readEmail(EMAIL_ASSUNTO);
+		mp.waitAMoment(100000000);
+		mp.deleteEmail();
+		// mp.assertMessage(MSG_EMAIL_APAGAR_MENSAGENS);
+	}
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/MarcarEmailImportanteTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/MarcarEmailImportanteTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/ler/MarcarEmailImportanteTestCase.java	(revision 3708)
@@ -0,0 +1,22 @@
+package br.gov.serpro.expresso.cte.email.ler;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 18, 2011 at 12:07:49 PM
+ * 
+ */
+public class MarcarEmailImportanteTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() {
+		mp.readEmail(EMAIL_ASSUNTO);
+		mp.setImportantFlag();
+		mp.assertMessage(MSG_EMAIL_IMPORTANTE);
+	}
+
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/pastas/ApagarPastaTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/pastas/ApagarPastaTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/pastas/ApagarPastaTestCase.java	(revision 3708)
@@ -0,0 +1,20 @@
+package br.gov.serpro.expresso.cte.email.pastas;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 19, 2011 at 2:40:25 PM
+ * 
+ */
+public class ApagarPastaTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() throws Exception {
+		mp.deleteFolder("Selenium");
+	}
+
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/pastas/CriarPastaTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/pastas/CriarPastaTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/pastas/CriarPastaTestCase.java	(revision 3708)
@@ -0,0 +1,20 @@
+package br.gov.serpro.expresso.cte.email.pastas;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 19, 2011 at 11:10:33 AM
+ * 
+ */
+public class CriarPastaTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() throws Exception {
+		mp.createNewFolder("Selenium");
+	}
+
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/MoverEmailSelecionadoTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/MoverEmailSelecionadoTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/MoverEmailSelecionadoTestCase.java	(revision 3708)
@@ -0,0 +1,20 @@
+package br.gov.serpro.expresso.cte.email.listar;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 19, 2011 at 2:55:01 PM
+ * 
+ */
+public class MoverEmailSelecionadoTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void testaMoverEmailSelecionado() throws Exception {
+		mp.findEmailIdBySuject(EMAIL_ASSUNTO, true);
+		mp.moveEmail("Selenium");
+	}
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/ApagarEmailSelecionadoTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/ApagarEmailSelecionadoTestCase.java	(revision 3663)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/ApagarEmailSelecionadoTestCase.java	(revision 3708)
@@ -17,5 +17,5 @@
 		mp.findEmailIdBySuject(EMAIL_ASSUNTO, true);
 		mp.deleteEmail();
-		mp.assertMessage(EMAIL_APAGAR_MENSAGEM);
+		mp.assertMessage(MSG_EMAIL_APAGAR_MENSAGEM);
 	}
 
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/ApagarTodosEmailsTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/ApagarTodosEmailsTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/ApagarTodosEmailsTestCase.java	(revision 3708)
@@ -0,0 +1,21 @@
+package br.gov.serpro.expresso.cte.email.listar;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 19, 2011 at 10:37:41 AM
+ * 
+ */
+public class ApagarTodosEmailsTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() {
+		mp.selectAllEmails();
+		mp.deleteEmail();
+		mp.assertMessage(MSG_EMAIL_APAGAR_MENSAGEM);
+	}
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/ListarEmailsImportantesTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/ListarEmailsImportantesTestCase.java	(revision 3708)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/ListarEmailsImportantesTestCase.java	(revision 3708)
@@ -0,0 +1,42 @@
+package br.gov.serpro.expresso.cte.email.listar;
+
+import junit.framework.Assert;
+
+import org.testng.annotations.Test;
+
+import br.gov.serpro.expresso.cte.common.BaseEmailTestCase;
+
+/**
+ * @author L.F.Estivalet (Serpro)
+ * 
+ *         Created on Jan 19, 2011 at 10:43:10 AM
+ * 
+ */
+public class ListarEmailsImportantesTestCase extends BaseEmailTestCase {
+
+	@Test
+	public void test() throws Exception {
+		mp.setImportantFilter();
+
+		// TODO Deve ter um jeito melhor de fazer isso, mas nao consegui pegar o
+		// numero total de mensagens apos filtrar pelas mensagens importantes.
+		// Se nao colocar o comando abaixo, ele continua pegando o numero de
+		// mensagens totais e nao apenas as importantes.
+		super.dummyWait();
+
+		// Busca todos os IDs dos emails apos aplicar o filtro "Importante".
+		String[] t = mp.getEmailIds();
+
+		boolean ok = true;
+		// Verifica se todas as mensagens estao marcadas como "Importante".
+		for (int i = 0; i < t.length; i++) {
+			if (!mp.isImportant(t[i])) {
+				ok = false;
+				break;
+			}
+
+		}
+		Assert.assertTrue(ok);
+
+	}
+}
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/LimparLixeiraTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/LimparLixeiraTestCase.java	(revision 3663)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/email/listar/LimparLixeiraTestCase.java	(revision 3708)
@@ -19,5 +19,5 @@
 		// Alerta de confirmacao de limpeza da lixeira.
 		Alert confirm = driver.switchTo().alert();
-		assert EMAIL_LIMPAR_LIXEIRA.equals(confirm.getText());
+		assert MSG_EMAIL_LIMPAR_LIXEIRA.equals(confirm.getText());
 		confirm.accept();
 
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/common/BaseTestCase.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/common/BaseTestCase.java	(revision 3663)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/common/BaseTestCase.java	(revision 3708)
@@ -34,3 +34,31 @@
 	}
 
+	/**
+	 * TODO Rever esse metodo. Foi o unico jeito que consegui fazer pegar o
+	 * numero total de mensagens importantes. O metodo apenas aguarda 5 segundos
+	 * antes de continuar a execucao.
+	 * 
+	 * @throws Exception
+	 * 
+	 * @see br.gov.serpro.cte.email.listar.ListarEmailsImportantesTestCase
+	 */
+	public void dummyWait() throws Exception {
+		dummyWait(5);
+	}
+
+	/**
+	 * @param seconds
+	 * @throws Exception
+	 */
+	public void dummyWait(int seconds) throws Exception {
+		for (int second = 0;; second++) {
+			if (second >= seconds) {
+				System.out.println("timeout");
+				return;
+			}
+			Thread.sleep(1000);
+		}
+
+	}
+
 }
Index: devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/common/Constants.java
===================================================================
--- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/common/Constants.java	(revision 3663)
+++ devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/common/Constants.java	(revision 3708)
@@ -8,15 +8,45 @@
 	public static final String EMAIL_TESTE_1 = Config.getInstance().getValor(
 			"email.teste.1");
+	public static final String EMAIL_TESTE_N_DESTINATARIOS = Config
+			.getInstance().getValor("email.teste.multiplos");
+	public static final String EMAIL_INVALIDO = Config.getInstance().getValor(
+			"email.invalido");
 	public static final String EMAIL_ASSUNTO = Config.getInstance().getValor(
 			"assunto");
+	public static final String EMAIL_ASSUNTO_COPIA_OCULTA = Config
+			.getInstance().getValor("assunto.somente.copia.oculta");
+	public static final String EMAIL_ASSUNTO_COPIA = Config.getInstance()
+			.getValor("assunto.somente.copia");
+	public static final String EMAIL_ASSUNTO_MULTIPLOS_ANEXOS = Config
+			.getInstance().getValor("assunto.multiplos.anexos");
+	public static final String EMAIL_ASSUNTO_MULTIPLOS_DESTINATARIOS = Config
+			.getInstance().getValor("assunto.multiplos.destinatarios");
 	public static final String EMAIL_TEXTO = Config.getInstance().getValor(
 			"texto.email");
-	public static final String EMAIL_ENVIADO = Config.getInstance()
+	public static final String EMAIL_TEXTO_COPIA_OCULTA = Config.getInstance()
+			.getValor("texto.email.copia.oculta");
+	public static final String EMAIL_TEXTO_COPIA = Config.getInstance()
+			.getValor("texto.email.copia");
+	public static final String EMAIL_TEXTO_MULTIPLOS_ANEXOS = Config
+			.getInstance().getValor("texto.email.multiplos.anexos");
+	public static final String EMAIL_TEXTO_MULTIPLOS_DESTINATARIOS = Config
+			.getInstance().getValor("texto.email.multiplos.destinatarios");
+
+	public static final String MSG_EMAIL_ENVIADO = Config.getInstance()
 			.getMensagem("email.enviado");
-
-	public static final String EMAIL_APAGAR_MENSAGEM = Config.getInstance()
+	public static final String MSG_EMAIL_APAGAR_MENSAGEM = Config.getInstance()
 			.getMensagem("apagar.uma.mensagem");
-	public static final String EMAIL_LIMPAR_LIXEIRA = Config.getInstance()
+	public static final String MSG_EMAIL_APAGAR_MENSAGENS = Config
+			.getInstance().getMensagem("apagar.mensagem");
+	public static final String MSG_EMAIL_LIMPAR_LIXEIRA = Config.getInstance()
 			.getMensagem("limpar.lixeira");
+	public static final String MSG_EMAIL_DESTINATARIO_INVALIDO = Config
+			.getInstance().getMensagem("destinatario.invalido");
+	public static final String MSG_EMAIL_IMPORTANTE = Config.getInstance()
+			.getMensagem("marcar.importante");
+	public static final String MSG_EMAIL_NORMAL = Config.getInstance()
+			.getMensagem("marcar.normal");
+	public static final String MSG_EMAIL_NAO_LIDO = Config.getInstance()
+			.getMensagem("marcar.nao.lido");
 
 }
