- Timestamp:
- 02/10/11 14:58:57 (14 years ago)
- Location:
- devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages
- Files:
-
- 6 added
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/common/HomePage.java
r3663 r3745 1 package br.gov.serpro.expresso.cte.pages. email;1 package br.gov.serpro.expresso.cte.pages.common; 2 2 3 3 import org.openqa.selenium.WebDriver; 4 4 import org.openqa.selenium.WebElement; 5 5 import org.openqa.selenium.support.FindBy; 6 7 import br.gov.serpro.expresso.cte.pages.common.Page;8 6 9 7 /** … … 16 14 @FindBy(xpath = "//a/img[@id='expressoMail12id']") 17 15 private WebElement mail; 16 17 @FindBy(id = "calendarid") 18 private WebElement calendar; 18 19 19 20 /** … … 28 29 waitForElementByXpath("//table[@id='folders_tbl']/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span"); 29 30 } 31 32 public void enterCalendar() { 33 calendar.click(); 34 waitForElementById("divAppbox"); 35 } 30 36 } -
devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/common/LoginPage.java
r3663 r3745 1 package br.gov.serpro.expresso.cte.pages. email;1 package br.gov.serpro.expresso.cte.pages.common; 2 2 3 3 import org.openqa.selenium.WebDriver; … … 5 5 import org.openqa.selenium.support.FindBy; 6 6 7 import br.gov.serpro.expresso.cte.pages.common.Page;8 7 9 8 /** -
devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/common/Page.java
r3708 r3745 1 1 package br.gov.serpro.expresso.cte.pages.common; 2 2 3 import java.util.List; 3 4 import java.util.concurrent.TimeUnit; 4 5 … … 7 8 import org.openqa.selenium.RenderedWebElement; 8 9 import org.openqa.selenium.WebDriver; 10 import org.openqa.selenium.WebElement; 9 11 10 /**11 * @author L.F.Estivalet (Serpro)12 *13 * Created on Jan 4, 2011 at 3:50:44 PM14 *15 */16 12 /** 17 13 * @author L.F.Estivalet (Serpro) … … 40 36 public void clickElement(String id) { 41 37 driver.findElement(By.id(id)).click(); 38 } 39 40 public void clickElement(By by) { 41 driver.findElement(by).click(); 42 42 } 43 43 … … 141 141 } 142 142 143 /** 144 * @param element 145 * @param value 146 */ 147 public void setComboValue(WebElement element, String value) { 148 List<WebElement> options = element.findElements(By.tagName("option")); 149 for (WebElement option : options) { 150 if (option.getText().equals(value)) { 151 option.setSelected(); 152 break; 153 } 154 } 155 } 143 156 } -
devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/email/MailPage.java
r3708 r3745 120 120 private WebElement forwardEmail; 121 121 122 @FindBy(xpath = "//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[3]/span[5]") 123 private WebElement replyEmail; 124 125 @FindBy(xpath = "//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span[1]") 126 private WebElement replyAllEmail; 127 128 @FindBy(xpath = "//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span[2]") 129 private WebElement replyEmailWithoutHistory; 130 131 @FindBy(xpath = "//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span[3]") 132 private WebElement replyAllEmailWithoutHistory; 133 134 @FindBy(xpath = "//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr/td[2]/span[2]/span[1]") 135 private WebElement editEmail; 136 122 137 /** 123 138 * @param driver … … 164 179 } 165 180 181 public void editEmail() { 182 super.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr/td[2]/span[2]/span[1]"); 183 this.editEmail.click(); 184 } 185 166 186 /** 167 187 * Encaminha uma mensagem. … … 178 198 driver.findElement(By.id("to_" + id)).sendKeys(to); 179 199 driver.findElement(By.id("send_button_" + id)).click(); 200 } 201 202 private void reply(String id) { 203 super.waitForElementById("to_" + id); 204 driver.findElement(By.id("send_button_" + id)).click(); 205 } 206 207 /** 208 * Responde uma mensagem. 209 * 210 * @param id 211 * Id da mensagem a ser respondida 212 */ 213 public void replyEmail(String id) { 214 super.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[3]/span[5]"); 215 this.replyEmail.click(); 216 this.reply(id); 217 } 218 219 /** 220 * Responde uma mensagem. 221 * 222 * @param id 223 * Id da mensagem a ser respondida 224 */ 225 public void replyAllEmailWithoutHistory(String id) { 226 super.findAndClickElement("msg_opt_reply_options_" + id + "_r"); 227 super.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span[3]"); 228 this.replyAllEmailWithoutHistory.click(); 229 this.reply(id); 230 } 231 232 /** 233 * Responde uma mensagem. 234 * 235 * @param id 236 * Id da mensagem a ser respondida 237 */ 238 public void replyEmailWithoutHistory(String id) { 239 super.findAndClickElement("msg_opt_reply_options_" + id + "_r"); 240 super.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span[2]"); 241 this.replyEmailWithoutHistory.click(); 242 this.reply(id); 243 } 244 245 /** 246 * Responde uma mensagem. 247 * 248 * @param id 249 * Id da mensagem a ser respondida 250 */ 251 public void replyAllEmail(String id) { 252 super.findAndClickElement("msg_opt_reply_options_" + id + "_r"); 253 super.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span[1]"); 254 this.replyAllEmail.click(); 255 this.reply(id); 180 256 } 181 257 … … 346 422 public void sendMail() { 347 423 this.send.click(); 424 } 425 426 public void sendMail(String id) { 427 super.findAndClickElement("send_button_" + id); 348 428 } 349 429
Note: See TracChangeset
for help on using the changeset viewer.