Changeset 4780 for devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/email/MailPage.java
- Timestamp:
- 07/18/11 10:56:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/email/MailPage.java
r4627 r4780 25 25 private WebElement newEmail; 26 26 27 /** Campo "Para:". */28 @FindBy(id = "to_1")29 private WebElement to;30 31 27 /** Campo "Assunto:". */ 32 28 @FindBy(id = "subject_1") 33 29 private WebElement subject; 34 30 35 /** Botao para enviar email. */36 @FindBy(id = "send_button_1")37 private WebElement send;38 39 31 /** Flag de importante no momento de compor um email. */ 40 32 @FindBy(id = "important_message_1") … … 114 106 private WebElement exportEmailLink; 115 107 108 @FindBy(xpath = "//div[@id='footer_menu']/table[@id='footer_box']/tbody/tr[@id='table_message']/td[@id='span_options']/span[5]/span") 109 private WebElement importEmailLink; 110 111 @FindBy(xpath = "//div[@id='win_import_window']/div[@id='win_import_window_clientArea']/div[@id='import_window']/div[@id='form_upload']/form/input[2]") 112 private WebElement importSelectFolderButton; 113 116 114 /** Link para pasta lixeira. */ 117 115 @FindBy(id = "lINBOX/Trashtree_folders") … … 268 266 */ 269 267 public void setBody(String body) { 268 this.setBody(1, body); 269 } 270 271 public void setBody(Integer id, String body) { 270 272 // Foi o unico jeito que consegui pegar o richtexteditor... 271 273 if (body != null) { … … 273 275 body = body.replaceAll("(\r\n|\r|\n|\n\r)", "<br>"); 274 276 ((JavascriptExecutor) driver) 275 .executeScript("document.getElementById('body_1').contentWindow.document.body.innerHTML='" 277 .executeScript("document.getElementById('body_" + id 278 + "').contentWindow.document.body.innerHTML='" 276 279 + body + "';"); 277 280 } … … 284 287 */ 285 288 public void composeEmail(String to, String subject, String body) { 289 this.composeEmail(1, to, subject, body); 290 } 291 292 /** 293 * @param id 294 * Corresponde ao id da aba de nova mensagem. 295 * @param to 296 * @param subject 297 * @param body 298 */ 299 public void composeEmail(Integer id, String to, String subject, String body) { 286 300 this.createNewEmail(); 287 this.to.sendKeys(to); 288 this.setSubject(subject); 289 this.setBody(body); 301 driver.findElement(By.id("to_" + id)).sendKeys(to); 302 driver.findElement(By.id("subject_" + id)).sendKeys(subject); 303 this.setBody(id, body); 304 } 305 306 public void quickContactSearch() { 307 driver.findElement( 308 By.xpath("//div[@id='exmail_main_body']/div[@id='content_id_1']/div[@id='div_message_scroll_1']/form/table/tbody/tr[4]/td[3]/img")) 309 .click(); 290 310 } 291 311 … … 363 383 } 364 384 365 p rotectedvoid waitLoading() {385 public void waitLoading() { 366 386 // Espera pelo "Carregando..." aparecer. 367 387 waitForElement(By.id("divProgressBar")); … … 443 463 // Espera pelo "Carregando..." aparecer. 444 464 waitForElement(By.id("divProgressBar")); 445 waitForElement(By.id("divScrollMain_0"));465 // waitForElement(By.id("divScrollMain_0")); 446 466 // Espera pelo "Carregando..." desaparecer. 447 467 isNotDisplayed(this … … 519 539 public void moveEmail(String folderName) { 520 540 this.moveEmailLink.click(); 521 super.findAndClickElement( "lINBOX/" + folderName + "wfolders_tree");541 super.findAndClickElement(folderName); 522 542 this.moveEmailButton.click(); 523 543 } … … 613 633 } 614 634 635 public void importEmail() { 636 this.importEmailLink.click(); 637 } 638 639 public void importSelectFolder() { 640 this.importSelectFolderButton.click(); 641 } 642 615 643 /** 616 644 * Seleciona todos emails da pasta corrente. … … 669 697 */ 670 698 public void sendMail() { 671 this.send.click(); 699 this.sendMail(1); 700 } 701 702 /** 703 * @param id 704 */ 705 public void sendMail(Integer id) { 706 driver.findElement(By.id("send_button_" + id)).click(); 672 707 } 673 708 … … 926 961 } 927 962 963 public WebElement getReturnReceipt() { 964 return returnReceipt; 965 } 928 966 }
Note: See TracChangeset
for help on using the changeset viewer.