[3782] | 1 | package org.expressolivre.cte.common; |
---|
[3745] | 2 | |
---|
[3782] | 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; |
---|
[3745] | 7 | import org.openqa.selenium.support.PageFactory; |
---|
[4864] | 8 | import org.testng.annotations.BeforeMethod; |
---|
[3745] | 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 | |
---|
[4895] | 18 | /** |
---|
| 19 | * Instancia da pagina do calendario utilizada pelos demais testes da |
---|
| 20 | * agenda. |
---|
| 21 | */ |
---|
[3745] | 22 | protected CalendarPage cp; |
---|
| 23 | |
---|
| 24 | /** |
---|
| 25 | * Antes dos demais testes do modulo do calendario serem iniciados, este |
---|
| 26 | * teste eh executado. Ele faz o login no Expresso e vai direto para a |
---|
| 27 | * pagina incial. Depois clica-se no modulo Calendario para entao |
---|
| 28 | * inicializar componentes da pagina. |
---|
| 29 | */ |
---|
[4864] | 30 | @BeforeMethod |
---|
[3745] | 31 | public void init() { |
---|
| 32 | HomePage hp = PageFactory.initElements(driver, HomePage.class); |
---|
| 33 | hp.enterCalendar(); |
---|
| 34 | cp = PageFactory.initElements(driver, CalendarPage.class); |
---|
| 35 | } |
---|
| 36 | |
---|
[4895] | 37 | /** |
---|
| 38 | * Abre visao diaria da agenda. |
---|
| 39 | * |
---|
| 40 | * @return Pagina da visao diaria da agenda. |
---|
| 41 | */ |
---|
[3745] | 42 | public CalendarTodayViewPage openTodayView() { |
---|
| 43 | cp.openTodayView(); |
---|
| 44 | return PageFactory.initElements(driver, CalendarTodayViewPage.class); |
---|
| 45 | } |
---|
| 46 | |
---|
[4895] | 47 | /** |
---|
| 48 | * Cria um novo compromisso. |
---|
| 49 | * |
---|
| 50 | * @param date |
---|
| 51 | * Data do compromisso. |
---|
| 52 | * @return Pagina para adicionar informacoes do compromisso. |
---|
| 53 | */ |
---|
[3745] | 54 | public AppointmentPage newAppointment(String date) { |
---|
| 55 | cp.openAppointmentPage(date); |
---|
| 56 | return PageFactory.initElements(driver, AppointmentPage.class); |
---|
| 57 | } |
---|
| 58 | } |
---|