Ignore:
Timestamp:
09/22/11 15:42:43 (13 years ago)
Author:
luiz-fernando
Message:

Ticket #1771 - Novas alteracoes nos metodos basicos para evitar timeouts

File:
1 edited

Legend:

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

    r4895 r5099  
    11package org.expressolivre.cte.pages.calendar; 
    22 
     3import java.util.List; 
     4 
     5import org.openqa.selenium.By; 
    36import org.openqa.selenium.WebDriver; 
     7import org.openqa.selenium.WebElement; 
    48 
    59/** 
     
    2933                return source.substring(j + 5, source.indexOf(",", j)); 
    3034        } 
     35 
     36        /** 
     37         * Verifica se o horario do compromisso aparece na lista. 
     38         *  
     39         * @param startTime 
     40         * @return 
     41         */ 
     42        public boolean isStartTimePresent(String startTime) { 
     43                // Lista todos os horarios. 
     44                boolean foundTime = false; 
     45                List<WebElement> hours = driver.findElements(By 
     46                                .className("dhx_scale_hour")); 
     47                for (WebElement h : hours) { 
     48                        if (h.getText().equals(startTime)) { 
     49                                foundTime = true; 
     50                                break; 
     51                        } 
     52                } 
     53                return foundTime; 
     54        } 
     55 
     56        /** 
     57         * Procura o compromisso pelo titulo. 
     58         *  
     59         * @param title 
     60         * @return 
     61         */ 
     62        public WebElement findAppointment(String title) { 
     63                List<WebElement> elements = driver.findElements(By 
     64                                .className("dhx_title")); 
     65                for (WebElement e : elements) { 
     66                        if (title.equals(e.getText())) { 
     67                                return e; 
     68                        } 
     69                } 
     70                return null; 
     71        } 
     72 
     73        /** 
     74         * Verifica se o compromisso contido no elemento e eh do tipo individual. 
     75         *  
     76         * @param e 
     77         * @return 
     78         */ 
     79        public boolean isSingle(WebElement e) { 
     80                // Recupera o icone referente ao compromisso 
     81                WebElement image = e.findElement(By.xpath("img")); 
     82                return image.getAttribute("src").contains("single.png"); 
     83        } 
     84 
     85        /** 
     86         * Verifica se o compromisso contido no elemento e eh do tipo restrito. 
     87         *  
     88         * @param e 
     89         * @return 
     90         */ 
     91        public boolean isRestrict(WebElement e) { 
     92                // Recupera o icone referente ao compromisso 
     93                List<WebElement> images = e.findElements(By.xpath("img")); 
     94                boolean restrictAppointment = false; 
     95                for (WebElement ele : images) { 
     96                        if (ele.getAttribute("src").contains("private.png")) { 
     97                                return true; 
     98                        } 
     99                } 
     100                return restrictAppointment; 
     101        } 
    31102} 
Note: See TracChangeset for help on using the changeset viewer.