package br.gov.serpro.expresso.cte.pages.calendar; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import br.gov.serpro.expresso.cte.pages.common.Page; /** * @author L.F.Estivalet (Serpro) * * Created on Feb 8, 2011 at 9:19:20 AM * */ public class AppointmentPage extends Page { /** Tipo do evento. */ @FindBy(id = "cal[type]") private WebElement type; /** Titulo do evento. */ @FindBy(name = "cal[title]") private WebElement title; /** Descrição completa do evento. */ @FindBy(name = "cal[description]") private WebElement description; /** Categorias do evento. */ @FindBy(name = "categories[]") private WebElement categories; /** Localização do evento. */ @FindBy(name = "cal[location]") private WebElement location; /** Data inicial do evento. */ @FindBy(name = "start[str]") private WebElement startDate; /** Hora inicial do evento. */ @FindBy(id = "start_hour") private WebElement startHour; /** Minuto inicial do evento; */ @FindBy(id = "start_minute") private WebElement startMinute; /** Data final do evento. */ @FindBy(name = "end[str]") private WebElement endDate; /** Hora final do evento. */ @FindBy(id = "end_hour") private WebElement endHour; /** Minuto final do evento; */ @FindBy(id = "end_minute") private WebElement endMinute; /** Prioridade do evento. */ @FindBy(name = "cal[priority]") private WebElement priority; /** Alarme dia. */ @FindBy(name = "cal[alarmdays]") private WebElement alarmDays; /** Alarme hora. */ @FindBy(name = "cal[alarmhours]") private WebElement alarmHours; /** Alarme minuto. */ @FindBy(name = "cal[alarmminutes]") private WebElement alarmMinutes; /** Tipo recursao. */ @FindBy(name = "cal[recur_type]") private WebElement recurType; @FindBy(name = "cal[rpt_use_end]") private WebElement rptUseEnd; @FindBy(name = "recur_enddate[str]") private WebElement recurEndDate; /** Domingo, Segunda, Terça, .... */ @FindBy(name = "cal[rpt_day][]") private WebElement rptDay; @FindBy(name = "cal[recur_interval]") private WebElement recurInterval; /** Observacao. */ @FindBy(name = "cal[#Observação]") private WebElement notes; /** Salvar. */ @FindBy(id = "submit_button") private WebElement save; public AppointmentPage(WebDriver driver) { super(driver); // TODO Auto-generated constructor stub } /** * @param type * the type to set */ public void setType(String type) { super.setComboValue(this.type, type); } /** * @param title * the title to set */ public void setTitle(String title) { this.title.sendKeys(title); } /** * @param description * the description to set */ public void setDescription(String description) { this.description.sendKeys(description); } /** * @param categories * the categories to set */ public void setCategories(String categories) { this.categories.sendKeys(categories); } /** * @param location * the location to set */ public void setLocation(String location) { this.location.sendKeys(location); } /** * @param startDate * the start to set */ public void setStartDate(String startDate) { this.startDate.clear(); this.startDate.sendKeys(startDate); } /** * @param startHour * the startHour to set */ public void setStartHour(String startHour) { this.startHour.clear(); this.startHour.sendKeys(startHour); } /** * @param startMinute * the startMinute to set */ public void setStartMinute(String startMinute) { this.startMinute.clear(); this.startMinute.sendKeys(startMinute); } /** * @param endDate * the end to set */ public void setEndDate(String endDate) { this.endDate.clear(); this.endDate.sendKeys(endDate); } /** * @param endHour * the endHour to set */ public void setEndHour(String endHour) { this.endHour.clear(); this.endHour.sendKeys(endHour); } /** * @param endMinute * the endMinute to set */ public void setEndMinute(String endMinute) { this.endMinute.clear(); this.endMinute.sendKeys(endMinute); } /** * @param priority * the priority to set */ public void setPriority(String priority) { super.setComboValue(this.priority, priority); } /** * @param notes * the notes to set */ public void setNotes(String notes) { this.notes.sendKeys(notes); } /** * @param alarmDays * the alarmDays to set */ public void setAlarmDays(String alarmDays) { super.setComboValue(this.alarmDays, alarmDays); } /** * @param alarmHours * the alarmHours to set */ public void setAlarmHours(String alarmHours) { super.setComboValue(this.alarmHours, alarmHours); } /** * @param alarmMinutes * the alarmMinutes to set */ public void setAlarmMinutes(String alarmMinutes) { super.setComboValue(this.alarmMinutes, alarmMinutes); } /** * @param recurType * the recurType to set */ public void setRecurType(String recurType) { super.setComboValue(this.recurType, recurType); } public void saveAppointment() { this.save.click(); } }