Ignore:
Timestamp:
07/18/11 10:56:36 (13 years ago)
Author:
luiz-fernando
Message:

Ticket #1771 - Refactoring, criadas novas classes para Pasta, Filtro, Pesquisa

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/email/MailPage.java

    r4627 r4780  
    2525        private WebElement newEmail; 
    2626 
    27         /** Campo "Para:". */ 
    28         @FindBy(id = "to_1") 
    29         private WebElement to; 
    30  
    3127        /** Campo "Assunto:". */ 
    3228        @FindBy(id = "subject_1") 
    3329        private WebElement subject; 
    3430 
    35         /** Botao para enviar email. */ 
    36         @FindBy(id = "send_button_1") 
    37         private WebElement send; 
    38  
    3931        /** Flag de importante no momento de compor um email. */ 
    4032        @FindBy(id = "important_message_1") 
     
    114106        private WebElement exportEmailLink; 
    115107 
     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 
    116114        /** Link para pasta lixeira. */ 
    117115        @FindBy(id = "lINBOX/Trashtree_folders") 
     
    268266         */ 
    269267        public void setBody(String body) { 
     268                this.setBody(1, body); 
     269        } 
     270 
     271        public void setBody(Integer id, String body) { 
    270272                // Foi o unico jeito que consegui pegar o richtexteditor... 
    271273                if (body != null) { 
     
    273275                        body = body.replaceAll("(\r\n|\r|\n|\n\r)", "<br>"); 
    274276                        ((JavascriptExecutor) driver) 
    275                                         .executeScript("document.getElementById('body_1').contentWindow.document.body.innerHTML='" 
     277                                        .executeScript("document.getElementById('body_" + id 
     278                                                        + "').contentWindow.document.body.innerHTML='" 
    276279                                                        + body + "';"); 
    277280                } 
     
    284287         */ 
    285288        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) { 
    286300                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(); 
    290310        } 
    291311 
     
    363383        } 
    364384 
    365         protected void waitLoading() { 
     385        public void waitLoading() { 
    366386                // Espera pelo "Carregando..." aparecer. 
    367387                waitForElement(By.id("divProgressBar")); 
     
    443463                // Espera pelo "Carregando..." aparecer. 
    444464                waitForElement(By.id("divProgressBar")); 
    445                 waitForElement(By.id("divScrollMain_0")); 
     465                // waitForElement(By.id("divScrollMain_0")); 
    446466                // Espera pelo "Carregando..." desaparecer. 
    447467                isNotDisplayed(this 
     
    519539        public void moveEmail(String folderName) { 
    520540                this.moveEmailLink.click(); 
    521                 super.findAndClickElement("lINBOX/" + folderName + "wfolders_tree"); 
     541                super.findAndClickElement(folderName); 
    522542                this.moveEmailButton.click(); 
    523543        } 
     
    613633        } 
    614634 
     635        public void importEmail() { 
     636                this.importEmailLink.click(); 
     637        } 
     638 
     639        public void importSelectFolder() { 
     640                this.importSelectFolderButton.click(); 
     641        } 
     642 
    615643        /** 
    616644         * Seleciona todos emails da pasta corrente. 
     
    669697         */ 
    670698        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(); 
    672707        } 
    673708 
     
    926961        } 
    927962 
     963        public WebElement getReturnReceipt() { 
     964                return returnReceipt; 
     965        } 
    928966} 
Note: See TracChangeset for help on using the changeset viewer.