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