1 | package org.expressolivre.cte.common; |
---|
2 | |
---|
3 | import org.expressolivre.cte.pages.calendar.AppointmentPage; |
---|
4 | import org.expressolivre.cte.pages.calendar.CalendarPage; |
---|
5 | import org.expressolivre.cte.pages.calendar.CalendarTodayViewPage; |
---|
6 | import org.expressolivre.cte.pages.common.HomePage; |
---|
7 | import org.openqa.selenium.support.PageFactory; |
---|
8 | import org.testng.annotations.Test; |
---|
9 | |
---|
10 | /** |
---|
11 | * @author L.F.Estivalet (Serpro) |
---|
12 | * |
---|
13 | * Created on Feb 8, 2011 at 9:16:54 AM |
---|
14 | * |
---|
15 | */ |
---|
16 | public class BaseCalendarTestCase extends BaseTestCase { |
---|
17 | |
---|
18 | protected CalendarPage cp; |
---|
19 | |
---|
20 | /** |
---|
21 | * Antes dos demais testes do modulo do calendario serem iniciados, este |
---|
22 | * teste eh executado. Ele faz o login no Expresso e vai direto para a |
---|
23 | * pagina incial. Depois clica-se no modulo Calendario para entao |
---|
24 | * inicializar componentes da pagina. |
---|
25 | */ |
---|
26 | @Test |
---|
27 | public void init() { |
---|
28 | HomePage hp = PageFactory.initElements(driver, HomePage.class); |
---|
29 | hp.enterCalendar(); |
---|
30 | cp = PageFactory.initElements(driver, CalendarPage.class); |
---|
31 | } |
---|
32 | |
---|
33 | public CalendarTodayViewPage openTodayView() { |
---|
34 | cp.openTodayView(); |
---|
35 | return PageFactory.initElements(driver, CalendarTodayViewPage.class); |
---|
36 | } |
---|
37 | |
---|
38 | public AppointmentPage newAppointment(String date) { |
---|
39 | cp.openAppointmentPage(date); |
---|
40 | return PageFactory.initElements(driver, AppointmentPage.class); |
---|
41 | } |
---|
42 | } |
---|