Changeset 3766 for devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/email/MailPage.java
- Timestamp:
- 02/15/11 16:04:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/testlink/automation2.0/src/test/java/br/gov/serpro/expresso/cte/pages/email/MailPage.java
r3745 r3766 144 144 public void createNewEmail() { 145 145 this.newEmail.click(); 146 waitForElement ById("to_1");146 waitForElement(By.id("to_1")); 147 147 } 148 148 … … 173 173 174 174 public String readEmail(String subject) { 175 // waitForElementByXpath("//div[@id='exmail_main_body']/table[1]/tbody[@id='border_tbody']/tr[1]/td[2]/table/tbody/tr/td[1]"); 175 176 String id = findEmailIdBySuject(subject); 176 clickElement(id); 177 return id.substring(id.lastIndexOf("_") + 1); 178 // waitForElementByXpath("//div[@id='exmail_main_body']/table[1]/tbody[@id='border_tbody']/tr[1]/td[2]/table/tbody/tr/td[1]"); 177 id = id.substring(id.lastIndexOf("_") + 1); 178 clickElement(By.id("td_who_" + id)); 179 super.waitForElement(By.id("div_message_scroll_" + id + "_r")); 180 return id; 179 181 } 180 182 181 183 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]"); 184 super.waitForElement(By 185 .xpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr/td[2]/span[2]/span[1]")); 183 186 this.editEmail.click(); 184 187 } … … 193 196 */ 194 197 public void forwardEmail(String id, String to) { 195 super.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[3]/span[3]"); 198 super.waitForElement(By 199 .xpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[3]/span[3]")); 196 200 this.forwardEmail.click(); 197 super.waitForElement ById("to_" + id);201 super.waitForElement(By.id("to_" + id)); 198 202 driver.findElement(By.id("to_" + id)).sendKeys(to); 199 203 driver.findElement(By.id("send_button_" + id)).click(); … … 201 205 202 206 private void reply(String id) { 203 super.waitForElement ById("to_" + id);207 super.waitForElement(By.id("to_" + id)); 204 208 driver.findElement(By.id("send_button_" + id)).click(); 205 209 } … … 212 216 */ 213 217 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]"); 218 super.waitForElement(By 219 .xpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[3]/span[5]")); 215 220 this.replyEmail.click(); 216 221 this.reply(id); … … 225 230 public void replyAllEmailWithoutHistory(String id) { 226 231 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]"); 232 super.waitForElement(By 233 .xpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span[3]")); 228 234 this.replyAllEmailWithoutHistory.click(); 229 235 this.reply(id); … … 238 244 public void replyEmailWithoutHistory(String id) { 239 245 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]"); 246 super.waitForElement(By 247 .xpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span[2]")); 241 248 this.replyEmailWithoutHistory.click(); 242 249 this.reply(id); … … 251 258 public void replyAllEmail(String id) { 252 259 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]"); 260 super.waitForElement(By 261 .xpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[2]/td/div/span[1]")); 254 262 this.replyAllEmail.click(); 255 263 this.reply(id); … … 263 271 */ 264 272 public void openFolder(String folder) { 265 clickElement(folder); 266 waitForElementById("divScrollMain_0"); 273 clickElement(By.id(folder)); 274 waitForElement(By.id("divScrollMain_0")); 275 waitForElement(By 276 .xpath("//div[@id='divScrollMain_0']/table[@id='table_box']/tbody[@id='tbody_box']/tr[1]/td[1]/input[1]")); 267 277 } 268 278 … … 275 285 public void openFolder(WebElement folder) { 276 286 folder.click(); 277 waitForElement ById("divScrollMain_0");287 waitForElement(By.id("divScrollMain_0")); 278 288 } 279 289 … … 305 315 public void editFolder() { 306 316 this.toolsMenu.click(); 307 this.waitForElementByXpath("//div[@id='menu_tools']/table/tbody/tr[4]/td"); 317 this.waitForElement(By 318 .xpath("//div[@id='menu_tools']/table/tbody/tr[4]/td")); 308 319 this.editFolder.click(); 309 320 } … … 337 348 338 349 public void setImportantFlag() { 339 this.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[3]"); 350 this.waitForElement(By 351 .xpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[3]")); 340 352 this.importantFlag.click(); 341 353 } 342 354 343 355 public void setNormalFlag() { 344 this.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[3]"); 356 this.waitForElement(By 357 .xpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[3]")); 345 358 this.normalFlag.click(); 346 359 } 347 360 348 361 public void setNotReadFlag() { 349 this.waitForElementByXpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[2]"); 362 this.waitForElement(By 363 .xpath("//div[@id='exmail_main_body']/div[2]/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/span[2]")); 350 364 this.notReadFlag.click(); 351 365 } … … 422 436 public void sendMail() { 423 437 this.send.click(); 438 } 439 440 /** 441 * Fecha aba do email sendo composto e confirma que email nao esta salvo. 442 */ 443 public void closeMail() { 444 this.closeMail(true); 445 } 446 447 public void closeMail(boolean checkAlert) { 448 super.clickElement(By.xpath("//td[@id='border_id_1']/div/div[2]/img")); 449 if (checkAlert) { 450 Alert closeAlert = driver.switchTo().alert(); 451 closeAlert.accept(); 452 } 424 453 } 425 454 … … 461 490 if (select) { 462 491 // Marca checkbox correspondente ao id da mensagem. 463 clickElement( "check_box" + id.substring(1));492 clickElement(By.id("check_box" + id.substring(1))); 464 493 } 465 494 return id;
Note: See TracChangeset
for help on using the changeset viewer.