source: devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/calendar/CalendarTodayViewPage.java @ 4864

Revision 4864, 804 bytes checked in by luiz-fernando, 13 years ago (diff)

Ticket #1771 - Adicionado testes automatizados para modulo da agenda

Line 
1package org.expressolivre.cte.pages.calendar;
2
3import org.expressolivre.cte.pages.common.Page;
4import org.openqa.selenium.WebDriver;
5
6/**
7 * @author L.F.Estivalet (Serpro)
8 *
9 *         Created on Feb 9, 2011 at 9:58:16 AM
10 *
11 */
12public class CalendarTodayViewPage extends Page {
13
14        public CalendarTodayViewPage(WebDriver driver) {
15                super(driver);
16                // TODO Auto-generated constructor stub
17        }
18
19        /**
20         * Procura o "id" do compromisso baseado no titulo do mesmo.
21         *
22         * @param title
23         *            Titulo do compromisso.
24         * @return "id" do compromisso.
25         */
26        public String getAppointmentId(String title) {
27                String source = driver.getPageSource();
28                int i = source.indexOf("\"title\":\"" + title);
29                int j = source.indexOf("\"id\":", i);
30                return source.substring(j + 5, source.indexOf(",", j));
31        }
32}
Note: See TracBrowser for help on using the repository browser.