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

Revision 4890, 1.6 KB 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.common.Constants;
4import org.expressolivre.cte.pages.common.Page;
5import org.openqa.selenium.By;
6import org.openqa.selenium.WebDriver;
7import org.openqa.selenium.WebElement;
8import org.openqa.selenium.support.FindBy;
9import org.openqa.selenium.support.PageFactory;
10
11/**
12 * @author L.F.Estivalet (Serpro)
13 *
14 *         Created on Feb 8, 2011 at 9:13:50 AM
15 *
16 */
17public class CalendarPage extends Page {
18
19        /** Como para selecionar mes. */
20        @FindBy(name = "date")
21        private WebElement date;
22
23        public CalendarPage(WebDriver driver) {
24                super(driver);
25                // TODO Auto-generated constructor stub
26        }
27
28        public CalendarTodayViewPage openTodayView() {
29                super.clickElement(By
30                                .xpath("//table[@id='calendar_head_table']/tbody/tr/td[2]/a/img"));
31                return PageFactory.initElements(driver, CalendarTodayViewPage.class);
32        }
33
34        public void openAppointmentPage(String date) {
35                driver.get(Constants.URL
36                                + "/index.php?menuaction=calendar.uicalendar.add&date=" + date);
37        }
38
39        public AppointmentViewPage openAppointmentViewPage(String id) {
40                driver.get(Constants.URL
41                                + "/index.php?menuaction=calendar.uicalendar.view&cal_id=" + id);
42                return PageFactory.initElements(driver, AppointmentViewPage.class);
43        }
44
45        public AppointmentViewPage openAppointmentViewPage(String id, String date) {
46                driver.get(Constants.URL
47                                + "/index.php?menuaction=calendar.uicalendar.view&cal_id=" + id
48                                + "&date=" + date);
49                System.out
50                                .println("/index.php?menuaction=calendar.uicalendar.view&cal_id="
51                                                + id + "&date=" + date);
52                return PageFactory.initElements(driver, AppointmentViewPage.class);
53        }
54}
Note: See TracBrowser for help on using the repository browser.