Ignore:
Timestamp:
08/03/11 10:09:33 (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/calendar/CalendarPage.java

    r4890 r4895  
    1717public class CalendarPage extends Page { 
    1818 
    19         /** Como para selecionar mes. */ 
     19        /** Combo para selecionar categoria. */ 
     20        @FindBy(name = "cat_id") 
     21        private WebElement category; 
     22 
     23        @FindBy(name = "filter") 
     24        private WebElement filter; 
     25 
     26        @FindBy(name = "owner") 
     27        private WebElement owner; 
     28 
     29        /** Campo para pesquisar agenda. */ 
     30        @FindBy(xpath = "/html/body/div[@id='divSubContainer']/table/tbody/tr/td[@id='tdAppbox']/div[@id='divAppbox']/table[@id='tableDivAppbox']/tbody/tr/td/table[@id='calendar_head_table']/tbody/tr/td[4]/nobr/form/div/input[9]") 
     31        private WebElement searchText; 
     32 
     33        /** Botao para acionar a pesquisa na agenda. */ 
     34        @FindBy(xpath = "//table[@id='calendar_head_table']/tbody/tr/td[4]/nobr/form/div/input[@id='']") 
     35        private WebElement searchButton; 
     36 
     37        /** Combo para selecionar mes. */ 
    2038        @FindBy(name = "date") 
    2139        private WebElement date; 
    2240 
     41        /** Combo para selecionar ano. */ 
     42        @FindBy(name = "year") 
     43        private WebElement year; 
     44 
     45        /** 
     46         * @param driver 
     47         */ 
    2348        public CalendarPage(WebDriver driver) { 
    2449                super(driver); 
     
    2651        } 
    2752 
     53        /** 
     54         * Abre a visao diaria da agenda. 
     55         *  
     56         * @return Pagina da visao diaria da agenda. 
     57         */ 
    2858        public CalendarTodayViewPage openTodayView() { 
    2959                super.clickElement(By 
     
    3262        } 
    3363 
     64        /** 
     65         * Abre tela para adicionar novo compromisso. 
     66         *  
     67         * @param date 
     68         *            Data do compromisso. 
     69         */ 
    3470        public void openAppointmentPage(String date) { 
    3571                driver.get(Constants.URL 
     
    3773        } 
    3874 
     75        /** 
     76         * @param id 
     77         * @return 
     78         */ 
    3979        public AppointmentViewPage openAppointmentViewPage(String id) { 
    4080                driver.get(Constants.URL 
     
    4383        } 
    4484 
     85        /** 
     86         * @param id 
     87         * @param date 
     88         * @return 
     89         */ 
    4590        public AppointmentViewPage openAppointmentViewPage(String id, String date) { 
    4691                driver.get(Constants.URL 
    4792                                + "/index.php?menuaction=calendar.uicalendar.view&cal_id=" + id 
    4893                                + "&date=" + date); 
    49                 System.out 
    50                                 .println("/index.php?menuaction=calendar.uicalendar.view&cal_id=" 
    51                                                 + id + "&date=" + date); 
    5294                return PageFactory.initElements(driver, AppointmentViewPage.class); 
    5395        } 
     96 
     97        /** 
     98         * Coloca um texto para pesquisar na agenda. 
     99         *  
     100         * @param searchText 
     101         *            Texto a ser pesquisado. 
     102         */ 
     103        public void setSearchText(String searchText) { 
     104                this.searchText.clear(); 
     105                this.searchText.sendKeys(searchText); 
     106        } 
     107 
     108        /** 
     109         * Dispara a pesquisa na agenda. 
     110         *  
     111         * @return Pagina de resultados da pesquisa. 
     112         */ 
     113        public AppointmentSearchResultPage searchAppointment() { 
     114                this.searchButton.click(); 
     115                return PageFactory.initElements(driver, 
     116                                AppointmentSearchResultPage.class); 
     117        } 
     118 
    54119} 
Note: See TracChangeset for help on using the changeset viewer.