mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 01:16:40 +00:00
Adjusted pages object for event creation dialog to use new input POs
This commit is contained in:
+10
-13
@@ -10,11 +10,14 @@ import org.openqa.selenium.WebElement;
|
||||
import com.sap.sailing.selenium.core.BySeleniumId;
|
||||
import com.sap.sailing.selenium.core.FindBy;
|
||||
import com.sap.sailing.selenium.pages.common.DataEntryDialogPO;
|
||||
import com.sap.sailing.selenium.pages.gwt.BetterDateTimeBoxPO;
|
||||
import com.sap.sailing.selenium.pages.gwt.CheckBoxPO;
|
||||
import com.sap.sailing.selenium.pages.gwt.TextAreaPO;
|
||||
import com.sap.sailing.selenium.pages.gwt.TextBoxPO;
|
||||
|
||||
public class EventCreateDialogPO extends DataEntryDialogPO {
|
||||
|
||||
private static final DateFormat DATE_TIME_BOX_FORMAT = new SimpleDateFormat("dd/mm/yyyy hh:mm");
|
||||
private static final DateFormat DATE_TIME_BOX_FORMAT = new SimpleDateFormat("dd/MM/yyyy hh:mm");
|
||||
|
||||
@FindBy(how = BySeleniumId.class, using = "NameTextBox")
|
||||
private WebElement nameTextBox;
|
||||
@@ -39,19 +42,13 @@ public class EventCreateDialogPO extends DataEntryDialogPO {
|
||||
}
|
||||
|
||||
void createEvent(String name, String description, String venue, Date start, Date end, boolean isPublic) {
|
||||
setTextValue(nameTextBox, name);
|
||||
setTextValue(descriptionTextArea, description);
|
||||
setTextValue(venueTextBox, venue);
|
||||
setTextValue(startDateTimeBox, DATE_TIME_BOX_FORMAT.format(start));
|
||||
setTextValue(endDateTimeBox, DATE_TIME_BOX_FORMAT.format(end));
|
||||
CheckBoxPO checkBox = new CheckBoxPO(driver, isPublicCheckBox);
|
||||
checkBox.setSelected(isPublic);
|
||||
TextBoxPO.create(driver, nameTextBox).appendText(name);
|
||||
TextAreaPO.create(driver, descriptionTextArea).appendText(description);
|
||||
TextBoxPO.create(driver, venueTextBox).appendText(venue);
|
||||
BetterDateTimeBoxPO.create(driver, startDateTimeBox).setText(DATE_TIME_BOX_FORMAT.format(start));
|
||||
BetterDateTimeBoxPO.create(driver, endDateTimeBox).setText(DATE_TIME_BOX_FORMAT.format(end));
|
||||
CheckBoxPO.create(driver, isPublicCheckBox).setSelected(isPublic);
|
||||
pressOk();
|
||||
}
|
||||
|
||||
private void setTextValue(WebElement webElement, String value) {
|
||||
webElement.clear();
|
||||
webElement.sendKeys(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user