package org.expressolivre.cte.pages.calendar; import org.expressolivre.cte.pages.common.Page; import org.openqa.selenium.Alert; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.testng.Assert; /** * @author L.F.Estivalet (Serpro) * * Created on Jul 25, 2011 at 2:25:28 PM * */ public class AppointmentViewPage extends Page { @FindBy(xpath = "//table[@id='calendar_viewevent_button_left']/tbody/tr/td[1]/nobr/form/div/input[@id='']") private WebElement editButton; @FindBy(xpath = "//table[@id='calendar_viewevent_button_left']/tbody/tr/td[2]/nobr/form/div/input[@id='']") private WebElement readyButton; @FindBy(xpath = "//table[@id='calendar_viewevent_button_center']/tbody/tr/td[1]/nobr/form/div/input[@id='']") private WebElement alarmManagerButton; @FindBy(xpath = "//table[@id='calendar_viewevent_button_center']/tbody/tr/td[2]/nobr/form/div/input[@id='']") private WebElement exportButton; @FindBy(xpath = "//table[@id='calendar_viewevent_button_right']/tbody/tr/td/nobr/form/div/input[@id='']") private WebElement removeButton; @FindBy(xpath = "//table[@id='calendar_viewevent_button_right']/tbody/tr/td[2]/nobr/form/div/input[@id='']") private WebElement removeSeriesButton; @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[1]/td[2]") private WebElement title; @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[2]/td[2]") private WebElement startTime; @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[3]/td[2]") private WebElement endTime; @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[4]/td[2]") private WebElement priority; @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[5]/td[2]") private WebElement accessType; @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[6]/td[2]") private WebElement participants; @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[7]/td[2]") private WebElement createdBy; @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[8]/td[2]") private WebElement updatedOn; @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[9]/td[2]") private WebElement lastUpdateBy; @FindBy(xpath = "//table[@id='calendar_view_event']/tbody/tr[10]/td[2]") private WebElement attachments; public AppointmentViewPage(WebDriver driver) { super(driver); // TODO Auto-generated constructor stub } public void removeAppointment() { this.removeButton.click(); Alert alert = driver.switchTo().alert(); Assert.assertEquals( alert.getText(), "Tem certeza que deseja remover esta entrada?\nIsto irá remover esta entrada para todos usuários."); alert.accept(); } public void removeSeriesAppointment() { this.removeSeriesButton.click(); Alert alert = driver.switchTo().alert(); Assert.assertEquals( alert.getText(), "Tem certeza que deseja remover esta entrada?\nIsto irá remover esta entrada para todos usuários."); alert.accept(); } /** * @return the title */ public String getTitle() { return title.getText(); } /** * @return the startTime */ public String getStartTime() { return startTime.getText(); } /** * @return the endTime */ public String getEndTime() { return endTime.getText(); } /** * @return the priority */ public String getPriority() { return priority.getText(); } /** * @return the accessType */ public String getAccessType() { return accessType.getText(); } /** * @return the participants */ public String getParticipants() { return participants.getText(); } /** * @return the createdBy */ public String getCreatedBy() { return createdBy.getText(); } /** * @return the updatedOn */ public String getUpdatedOn() { return updatedOn.getText(); } /** * @return the lastUpdateBy */ public String getLastUpdateBy() { return lastUpdateBy.getText(); } /** * @return the attachments */ public String getAttachments() { return attachments.getText(); } }