Ignore:
Timestamp:
02/15/11 16:04:00 (13 years ago)
Author:
luiz-fernando
Message:

Ticket #1402 - Novos casos de teste implementados usando WebDriver?

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  
    144144        public void createNewEmail() { 
    145145                this.newEmail.click(); 
    146                 waitForElementById("to_1"); 
     146                waitForElement(By.id("to_1")); 
    147147        } 
    148148 
     
    173173 
    174174        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]"); 
    175176                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; 
    179181        } 
    180182 
    181183        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]")); 
    183186                this.editEmail.click(); 
    184187        } 
     
    193196         */ 
    194197        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]")); 
    196200                this.forwardEmail.click(); 
    197                 super.waitForElementById("to_" + id); 
     201                super.waitForElement(By.id("to_" + id)); 
    198202                driver.findElement(By.id("to_" + id)).sendKeys(to); 
    199203                driver.findElement(By.id("send_button_" + id)).click(); 
     
    201205 
    202206        private void reply(String id) { 
    203                 super.waitForElementById("to_" + id); 
     207                super.waitForElement(By.id("to_" + id)); 
    204208                driver.findElement(By.id("send_button_" + id)).click(); 
    205209        } 
     
    212216         */ 
    213217        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]")); 
    215220                this.replyEmail.click(); 
    216221                this.reply(id); 
     
    225230        public void replyAllEmailWithoutHistory(String id) { 
    226231                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]")); 
    228234                this.replyAllEmailWithoutHistory.click(); 
    229235                this.reply(id); 
     
    238244        public void replyEmailWithoutHistory(String id) { 
    239245                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]")); 
    241248                this.replyEmailWithoutHistory.click(); 
    242249                this.reply(id); 
     
    251258        public void replyAllEmail(String id) { 
    252259                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]")); 
    254262                this.replyAllEmail.click(); 
    255263                this.reply(id); 
     
    263271         */ 
    264272        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]")); 
    267277        } 
    268278 
     
    275285        public void openFolder(WebElement folder) { 
    276286                folder.click(); 
    277                 waitForElementById("divScrollMain_0"); 
     287                waitForElement(By.id("divScrollMain_0")); 
    278288        } 
    279289 
     
    305315        public void editFolder() { 
    306316                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")); 
    308319                this.editFolder.click(); 
    309320        } 
     
    337348 
    338349        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]")); 
    340352                this.importantFlag.click(); 
    341353        } 
    342354 
    343355        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]")); 
    345358                this.normalFlag.click(); 
    346359        } 
    347360 
    348361        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]")); 
    350364                this.notReadFlag.click(); 
    351365        } 
     
    422436        public void sendMail() { 
    423437                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                } 
    424453        } 
    425454 
     
    461490                if (select) { 
    462491                        // Marca checkbox correspondente ao id da mensagem. 
    463                         clickElement("check_box" + id.substring(1)); 
     492                        clickElement(By.id("check_box" + id.substring(1))); 
    464493                } 
    465494                return id; 
Note: See TracChangeset for help on using the changeset viewer.