Ignore:
Timestamp:
08/19/11 16:38:24 (13 years ago)
Author:
luiz-fernando
Message:

Ticket #1771 - Adicionado testes automatizados para modulo da agenda

File:
1 edited

Legend:

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

    r4902 r4962  
    22 
    33import org.apache.commons.lang.StringUtils; 
     4import org.expressolivre.cte.pages.calendar.AppointmentEmailPage; 
    45import org.expressolivre.cte.pages.common.Page; 
    56import org.openqa.selenium.Alert; 
     
    311312 
    312313        public String readEmail(String subject) { 
    313                 // waitForElementByXpath("//div[@id='exmail_main_body']/table[1]/tbody[@id='border_tbody']/tr[1]/td[2]/table/tbody/tr/td[1]"); 
    314314                String id = findEmailIdBySubject(subject); 
    315315                id = id.substring(id.lastIndexOf("_") + 1); 
     
    317317                super.waitForElement(By.id("div_message_scroll_" + id + "_r")); 
    318318                return id; 
     319        } 
     320 
     321        /** 
     322         * @param subject 
     323         *            Procura o email pelo assunto. 
     324         * @return Id do email. 
     325         */ 
     326        public String getEmailId(String subject) { 
     327                String id = findEmailIdBySubject(subject); 
     328                return id.substring(id.lastIndexOf("_") + 1); 
     329        } 
     330 
     331        /** 
     332         * Le um email gerado a partir de um agendamento. 
     333         *  
     334         * @param subject 
     335         * @return 
     336         */ 
     337        public AppointmentEmailPage readAppointmentEmail(String subject) { 
     338                String id = findEmailIdBySubject(subject); 
     339                id = id.substring(id.lastIndexOf("_") + 1); 
     340                clickElement(By.id("td_who_" + id)); 
     341                super.waitForElement(By.id("div_message_scroll_" + id + "_r")); 
     342                return PageFactory.initElements(driver, AppointmentEmailPage.class); 
    319343        } 
    320344 
     
    961985        } 
    962986 
     987        /** 
     988         * O email de notificacao de agendamento tem um "_r" no fim do id. 
     989         *  
     990         * @param id 
     991         * @return 
     992         */ 
     993        public Object getAppointmentBody(String id) { 
     994                waitForElement(By.id("body_" + id + "_r")); 
     995                return ((JavascriptExecutor) driver) 
     996                                .executeScript("return document.getElementById('body_" + id 
     997                                                + "_r" + "').innerHTML;"); 
     998        } 
     999 
    9631000        public WebElement getReturnReceipt() { 
    9641001                return returnReceipt; 
Note: See TracChangeset for help on using the changeset viewer.