1 | package org.expressolivre.cte.pages.calendar; |
---|
2 | |
---|
3 | import org.expressolivre.cte.common.Constants; |
---|
4 | import org.expressolivre.cte.pages.common.Page; |
---|
5 | import org.openqa.selenium.By; |
---|
6 | import org.openqa.selenium.WebDriver; |
---|
7 | import org.openqa.selenium.WebElement; |
---|
8 | import org.openqa.selenium.support.FindBy; |
---|
9 | import 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 | */ |
---|
17 | public 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 | } |
---|