All page objects renamed (with suffix PO) to make it easier to

differentiate between classes in our GWT projec and page objects.
This commit is contained in:
D049941 committed 2014-02-03 12:22:20 +01:00
1 parent 361bc7bcd7
commit 2cf6e3e104
35 files changed
+267 -267

No files matched your search

@@ -8,7 +8,7 @@ import java.lang.annotation.Target;
/**
* <p>Used to mark a field in test cases that should be injected with the {@link TestEnvironment} by the
* {@link Selenium} runner. The environment provides the web driver to use for the tests as well as other information
* {@link SeleniumRunner} runner. The environment provides the web driver to use for the tests as well as other information
* as configured.</p>
*
* @author
@@ -28,7 +28,7 @@ import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import com.sap.sailing.selenium.core.Selenium.SeleniumJUnit4ClassRunner;
import com.sap.sailing.selenium.core.SeleniumRunner.SeleniumJUnit4ClassRunner;
import com.sap.sailing.selenium.core.TestEnvironmentConfiguration.DriverDefinition;
import com.sap.sailing.selenium.core.impl.TestEnvironmentImpl;
@@ -40,7 +40,7 @@ import com.sap.sailing.selenium.core.impl.TestEnvironmentImpl;
* @author
* D049941
*/
public class Selenium extends ParentRunner<SeleniumJUnit4ClassRunner> {
public class SeleniumRunner extends ParentRunner<SeleniumJUnit4ClassRunner> {
/**
* <p>A test runner that will run the tests for a specific browser instance using a Selenium web driver. The web
* driver is provided to the tests by injecting it to annotated fields.</p>
@@ -216,7 +216,7 @@ public class Selenium extends ParentRunner<SeleniumJUnit4ClassRunner> {
* @throws InitializationError
* If there was an error during the initialization of the test runner.
*/
public Selenium(Class<?> klass) throws InitializationError {
public SeleniumRunner(Class<?> klass) throws InitializationError {
super(klass);
this.children = new LinkedList<>();
@@ -5,7 +5,7 @@ import java.net.URL;
import org.openqa.selenium.WebDriver;
/**
* <p>Description of the test environment in which a test is executed by the {@link Selenium} runner. The environment is
* <p>Description of the test environment in which a test is executed by the {@link SeleniumRunner} runner. The environment is
* injected by the runner to fields annotated with {@link Managed} and consists of the web driver which is used, a
* folder where screenshots should be stored and a context root (base URL) against the tests is executed.</p>
*
@@ -12,7 +12,7 @@ import org.openqa.selenium.support.ui.FluentWait;
import com.google.common.base.Function;
import com.sap.sailing.selenium.pages.PageObject;
public class Actions {
public class ActionsHelper {
private static final String ACTION_XPATH = ".//descendant::div[@name='%s']/img";
public static final String EDIT_ACTION = "ACTION_EDIT";
@@ -20,13 +20,13 @@ import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.HostPage;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfigurationPanel;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardGroupConfigurationPanel;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfigurationPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardGroupConfigurationPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaStructureManagementPanel;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaStructureManagementPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesManagementPanel;
import com.sap.sailing.selenium.pages.adminconsole.tractrac.TracTracEventManagementPanel;
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesManagementPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.tractrac.TracTracEventManagementPanelPO;
/**
* <p>The page object representing the administration console. The console consists of multiple tabs with its content
@@ -115,8 +115,8 @@ public class AdminConsolePage extends HostPage {
super(driver);
}
public RegattaStructureManagementPanel goToRegattaStructure() {
return new RegattaStructureManagementPanel(this.driver, goToTab(REGATTA_STRUCTURE_TAB_LABEL,
public RegattaStructureManagementPanelPO goToRegattaStructure() {
return new RegattaStructureManagementPanelPO(this.driver, goToTab(REGATTA_STRUCTURE_TAB_LABEL,
REGATTA_STRUCTURE_TAB_IDENTIFIER));
}
@@ -127,23 +127,23 @@ public class AdminConsolePage extends HostPage {
* @return
* The page object for the TracTracEvents tab.
*/
public TracTracEventManagementPanel goToTracTracEvents() {
return new TracTracEventManagementPanel(this.driver, goToTab(TRACTRAC_EVENTS_TAB_LABEL,
public TracTracEventManagementPanelPO goToTracTracEvents() {
return new TracTracEventManagementPanelPO(this.driver, goToTab(TRACTRAC_EVENTS_TAB_LABEL,
TRACTRAC_EVENTS_TAB_IDENTIFIER));
}
public TrackedRacesManagementPanel goToTrackedRaces() {
return new TrackedRacesManagementPanel(this.driver, goToTab(TRACKED_RACES_TAB_LABEL,
public TrackedRacesManagementPanelPO goToTrackedRaces() {
return new TrackedRacesManagementPanelPO(this.driver, goToTab(TRACKED_RACES_TAB_LABEL,
TRACKED_RACES_TAB_IDENTIFIER));
}
public LeaderboardConfigurationPanel goToLeaderboardConfiguration() {
return new LeaderboardConfigurationPanel(this.driver, goToTab(LEADERBOARD_CONFIGURATION_TAB_LABEL,
public LeaderboardConfigurationPanelPO goToLeaderboardConfiguration() {
return new LeaderboardConfigurationPanelPO(this.driver, goToTab(LEADERBOARD_CONFIGURATION_TAB_LABEL,
LEADERBOARD_CONFIGURATION_TAB_IDENTIFIER));
}
public LeaderboardGroupConfigurationPanel goToLeaderboardGroupConfiguration() {
return new LeaderboardGroupConfigurationPanel(this.driver, goToTab(LEADERBOARD_GROUP_CONFIGURATION_TAB_LABEL,
public LeaderboardGroupConfigurationPanelPO goToLeaderboardGroupConfiguration() {
return new LeaderboardGroupConfigurationPanelPO(this.driver, goToTab(LEADERBOARD_GROUP_CONFIGURATION_TAB_LABEL,
LEADERBOARD_GROUP_CONFIGURATION_TAB_IDENTIFIER));
}
@@ -6,16 +6,16 @@ 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.DataEntryDialog;
import com.sap.sailing.selenium.pages.common.DataEntryDialogPO;
public class FlexibleLeaderboardCreateDialog extends DataEntryDialog {
public class FlexibleLeaderboardCreateDialogPO extends DataEntryDialogPO {
@FindBy(how = BySeleniumId.class, using = "NameTextBox")
private WebElement nameTextBox;
@FindBy(how = BySeleniumId.class, using = "DisplayNameTextBox")
private WebElement displayNameTextBox;
public FlexibleLeaderboardCreateDialog(WebDriver driver, WebElement element) {
public FlexibleLeaderboardCreateDialogPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -12,15 +12,15 @@ import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
import com.sap.sailing.selenium.pages.adminconsole.Actions;
import com.sap.sailing.selenium.pages.adminconsole.ActionsHelper;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListComposite.RegattaDescriptor;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListCompositePO.RegattaDescriptor;
import com.sap.sailing.selenium.pages.gwt.CellTable;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.gwt.GenericCellTable;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.gwt.GenericCellTablePO;
public class LeaderboardConfigurationPanel extends PageArea {
public class LeaderboardConfigurationPanelPO extends PageArea {
@FindBy(how = BySeleniumId.class, using = "CreateFlexibleLeaderboardButton")
private WebElement createFlexibleLeaderboardButton;
@@ -39,56 +39,56 @@ public class LeaderboardConfigurationPanel extends PageArea {
@FindBy(how = BySeleniumId.class, using = "LeaderboardDetailsPanel")
private WebElement leaderboardDetailsPanel;
public LeaderboardConfigurationPanel(WebDriver driver, WebElement element) {
public LeaderboardConfigurationPanelPO(WebDriver driver, WebElement element) {
super(driver, element);
}
public FlexibleLeaderboardCreateDialog startCreatingFlexibleLeaderboard() {
public FlexibleLeaderboardCreateDialogPO startCreatingFlexibleLeaderboard() {
this.createFlexibleLeaderboardButton.click();
// Wait, since we trigger an AJAX-request to get the available events
waitForAjaxRequests();
WebElement dialog = findElementBySeleniumId(this.driver, "FlexibleLeaderboardCreateDialog");
return new FlexibleLeaderboardCreateDialog(this.driver, dialog);
return new FlexibleLeaderboardCreateDialogPO(this.driver, dialog);
}
// TODO: Extend with display name, scoring system, event, course area and discars
public void createFlexibleLeaderboard(String name) {
FlexibleLeaderboardCreateDialog dialog = startCreatingFlexibleLeaderboard();
FlexibleLeaderboardCreateDialogPO dialog = startCreatingFlexibleLeaderboard();
dialog.setName(name);
dialog.pressOk();
}
public RegattaLeaderboardCreateDialog startCreatingRegattaLeaderboard() {
public RegattaLeaderboardCreateDialogPO startCreatingRegattaLeaderboard() {
this.createRegattaLeaderboardButton.click();
WebElement dialog = findElementBySeleniumId(this.driver, "RegattaLeaderboardCreateDialog");
return new RegattaLeaderboardCreateDialog(this.driver, dialog);
return new RegattaLeaderboardCreateDialogPO(this.driver, dialog);
}
public void createRegattaLeaderboard(RegattaDescriptor regatta) {
RegattaLeaderboardCreateDialog dialog = startCreatingRegattaLeaderboard();
RegattaLeaderboardCreateDialogPO dialog = startCreatingRegattaLeaderboard();
dialog.selectRegatta(regatta);
dialog.pressOk();
}
public void deleteLeaderboard(String leaderboard) {
DataEntry entry = findLeaderboard(leaderboard);
DataEntryPO entry = findLeaderboard(leaderboard);
if(entry != null) {
WebElement removeAction = Actions.findRemoveAction(entry.getWebElement());
WebElement removeAction = ActionsHelper.findRemoveAction(entry.getWebElement());
removeAction.click();
Actions.acceptAlert(this.driver);
ActionsHelper.acceptAlert(this.driver);
waitForAjaxRequests();
}
}
public String getLeaderboardURL(String leaderboard) {
DataEntry entry = findLeaderboard(leaderboard);
DataEntryPO entry = findLeaderboard(leaderboard);
if(entry != null) {
WebElement link = entry.getWebElement().findElement(By.xpath(".//td/div/a"));
@@ -102,41 +102,41 @@ public class LeaderboardConfigurationPanel extends PageArea {
public List<String> getAvailableLeaderboards() {
List<String> leaderboards = new ArrayList<>();
CellTable<DataEntry> table = getLeaderboardTable();
List<DataEntry> entries = table.getEntries();
CellTablePO<DataEntryPO> table = getLeaderboardTable();
List<DataEntryPO> entries = table.getEntries();
for(DataEntry entry : entries) {
for(DataEntryPO entry : entries) {
leaderboards.add(entry.getColumnContent(0));
}
return leaderboards;
}
public LeaderboardDetailsPanel getLeaderboardDetails(String leaderboard) {
CellTable<DataEntry> table = getLeaderboardTable();
List<DataEntry> entries = table.getEntries();
public LeaderboardDetailsPanelPO getLeaderboardDetails(String leaderboard) {
CellTablePO<DataEntryPO> table = getLeaderboardTable();
List<DataEntryPO> entries = table.getEntries();
for(DataEntry entry : entries) {
for(DataEntryPO entry : entries) {
String name = entry.getColumnContent(0);
if(leaderboard.equals(name)) {
entry.select();
return new LeaderboardDetailsPanel(this.driver, this.leaderboardDetailsPanel);
return new LeaderboardDetailsPanelPO(this.driver, this.leaderboardDetailsPanel);
}
}
return null;
}
private CellTable<DataEntry> getLeaderboardTable() {
return new GenericCellTable<>(this.driver, this.leaderboardsCellTable, DataEntry.class);
private CellTablePO<DataEntryPO> getLeaderboardTable() {
return new GenericCellTablePO<>(this.driver, this.leaderboardsCellTable, DataEntryPO.class);
}
private DataEntry findLeaderboard(String leaderboard) {
CellTable<DataEntry> table = getLeaderboardTable();
private DataEntryPO findLeaderboard(String leaderboard) {
CellTablePO<DataEntryPO> table = getLeaderboardTable();
for(DataEntry entry : table.getEntries()) {
for(DataEntryPO entry : table.getEntries()) {
String name = entry.getColumnContent(0);
if(leaderboard.equals(name)) {
@@ -12,15 +12,15 @@ import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
import com.sap.sailing.selenium.pages.adminconsole.Actions;
import com.sap.sailing.selenium.pages.adminconsole.ActionsHelper;
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesList.TrackedRaceDescriptor;
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesListPO.TrackedRaceDescriptor;
import com.sap.sailing.selenium.pages.gwt.CellTable;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.gwt.GenericCellTable;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.gwt.GenericCellTablePO;
public class LeaderboardDetailsPanel extends PageArea {
public class LeaderboardDetailsPanelPO extends PageArea {
public static class RaceDescriptor {
private final String name;
private final String fleet;
@@ -90,16 +90,16 @@ public class LeaderboardDetailsPanel extends PageArea {
@FindBy(how = BySeleniumId.class, using = "TrackedRacesListComposite")
private WebElement trackedRacesListComposite;
public LeaderboardDetailsPanel(WebDriver driver, WebElement element) {
public LeaderboardDetailsPanelPO(WebDriver driver, WebElement element) {
super(driver, element);
}
public List<RaceDescriptor> getRaces() {
List<RaceDescriptor> result = new ArrayList<>();
CellTable<DataEntry> racesTable = getRacesTable();
CellTablePO<DataEntryPO> racesTable = getRacesTable();
for(DataEntry entry : racesTable.getEntries()) {
for(DataEntryPO entry : racesTable.getEntries()) {
String name = entry.getColumnContent(0);
String fleet = entry.getColumnContent(1);
//String medalRace = entry.getColumnContent(2);
@@ -122,31 +122,31 @@ public class LeaderboardDetailsPanel extends PageArea {
// }
public void unlinkRace(RaceDescriptor race) {
DataEntry entry = findRace(race);
DataEntryPO entry = findRace(race);
if(entry != null) {
WebElement action = Actions.findUnlinkRaceAction(entry.getWebElement());
WebElement action = ActionsHelper.findUnlinkRaceAction(entry.getWebElement());
action.click();
}
}
public void refreshRaceLog(RaceDescriptor race) {
DataEntry entry = findRace(race);
DataEntryPO entry = findRace(race);
if(entry != null) {
WebElement action = Actions.findRefreshAction(entry.getWebElement());
WebElement action = ActionsHelper.findRefreshAction(entry.getWebElement());
action.click();
// QUESTION [D049941]: What else can happen?
Actions.acceptAlert(this.driver);
ActionsHelper.acceptAlert(this.driver);
}
}
public void linkRace(RaceDescriptor race, TrackedRaceDescriptor tracking) {
DataEntry raceRow = findRace(race);
DataEntry trackingRow = findTracking(tracking);
DataEntryPO raceRow = findRace(race);
DataEntryPO trackingRow = findTracking(tracking);
if(raceRow == null || trackingRow == null) {
}
@@ -155,10 +155,10 @@ public class LeaderboardDetailsPanel extends PageArea {
trackingRow.select();
}
private DataEntry findRace(RaceDescriptor race) {
CellTable<DataEntry> racesTable = getRacesTable();
private DataEntryPO findRace(RaceDescriptor race) {
CellTablePO<DataEntryPO> racesTable = getRacesTable();
for(DataEntry entry : racesTable.getEntries()) {
for(DataEntryPO entry : racesTable.getEntries()) {
String name = entry.getColumnContent(0);
String fleet = entry.getColumnContent(1);
//String medalRace = entry.getColumnContent(2);
@@ -174,10 +174,10 @@ public class LeaderboardDetailsPanel extends PageArea {
return null;
}
private DataEntry findTracking(TrackedRaceDescriptor tracking) {
CellTable<DataEntry> trackingTable = getTrackedRacesTable();
private DataEntryPO findTracking(TrackedRaceDescriptor tracking) {
CellTablePO<DataEntryPO> trackingTable = getTrackedRacesTable();
for(DataEntry entry : trackingTable.getEntries()) {
for(DataEntryPO entry : trackingTable.getEntries()) {
String regatta = entry.getColumnContent(0);
String boatClass = entry.getColumnContent(1);
String raceName = entry.getColumnContent(2);
@@ -191,13 +191,13 @@ public class LeaderboardDetailsPanel extends PageArea {
return null;
}
private CellTable<DataEntry> getRacesTable() {
return new GenericCellTable<>(this.driver, this.racesCellTable, DataEntry.class);
private CellTablePO<DataEntryPO> getRacesTable() {
return new GenericCellTablePO<>(this.driver, this.racesCellTable, DataEntryPO.class);
}
private CellTable<DataEntry> getTrackedRacesTable() {
private CellTablePO<DataEntryPO> getTrackedRacesTable() {
WebElement table = findElementBySeleniumId(this.trackedRacesListComposite, "TrackedRacesCellTable");
return new GenericCellTable<>(this.driver, table, DataEntry.class);
return new GenericCellTablePO<>(this.driver, table, DataEntryPO.class);
}
}
@@ -8,14 +8,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.PageArea;
import com.sap.sailing.selenium.pages.adminconsole.Actions;
import com.sap.sailing.selenium.pages.gwt.CellTable;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.gwt.GenericCellTable;
import com.sap.sailing.selenium.pages.adminconsole.ActionsHelper;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.gwt.GenericCellTablePO;
import com.sap.sailing.selenium.pages.gwt.query.Alias;
import com.sap.sailing.selenium.pages.gwt.query.TableQuery;
public class LeaderboardGroupConfigurationPanel extends PageArea {
public class LeaderboardGroupConfigurationPanelPO extends PageArea {
@FindBy(how = BySeleniumId.class, using = "CreateLeaderboardGroupButton")
private WebElement createLeaderboardGroupButton;
@@ -28,42 +28,42 @@ public class LeaderboardGroupConfigurationPanel extends PageArea {
@FindBy(how = BySeleniumId.class, using = "LeaderboardGroupDetailsPanel")
private WebElement leaderboardGroupDetailsPanel;
public LeaderboardGroupConfigurationPanel(WebDriver driver, WebElement element) {
public LeaderboardGroupConfigurationPanelPO(WebDriver driver, WebElement element) {
super(driver, element);
}
public LeaderboardGroupCreateDialog startCreatingLeaderboardGroup() {
public LeaderboardGroupCreateDialogPO startCreatingLeaderboardGroup() {
this.createLeaderboardGroupButton.click();
WebElement dialog = findElementBySeleniumId(this.driver, "LeaderboardGroupCreateDialog");
return new LeaderboardGroupCreateDialog(this.driver, dialog);
return new LeaderboardGroupCreateDialogPO(this.driver, dialog);
}
public void createLeaderboardGroup(String name, String description) {
LeaderboardGroupCreateDialog dialog = startCreatingLeaderboardGroup();
LeaderboardGroupCreateDialogPO dialog = startCreatingLeaderboardGroup();
dialog.setName(name);
dialog.setDescription(description);
dialog.pressOk();
}
public CellTable<DataEntry> getLeaderboardGroupsTable() {
return new GenericCellTable<DataEntry>(this.driver, this.leaderboardGroupsTable, DataEntry.class);
public CellTablePO<DataEntryPO> getLeaderboardGroupsTable() {
return new GenericCellTablePO<DataEntryPO>(this.driver, this.leaderboardGroupsTable, DataEntryPO.class);
}
public void deleteLeaderboardGroup(String name) {
DataEntry result = findLeaderboardGroup(name);
DataEntryPO result = findLeaderboardGroup(name);
if (result != null) {
Actions.findRemoveAction(result.getWebElement()).click();
Actions.acceptAlert(this.driver);
ActionsHelper.findRemoveAction(result.getWebElement()).click();
ActionsHelper.acceptAlert(this.driver);
waitForAjaxRequests();
}
}
public LeaderboardGroupDetailsPanel getLeaderboardGroupDetails(String name) {
DataEntry result = findLeaderboardGroup(name);
public LeaderboardGroupDetailsPanelPO getLeaderboardGroupDetails(String name) {
DataEntryPO result = findLeaderboardGroup(name);
if (result != null) {
result.select();
@@ -72,18 +72,18 @@ public class LeaderboardGroupConfigurationPanel extends PageArea {
return getLeaderboardGroupDetails();
}
public LeaderboardGroupDetailsPanel getLeaderboardGroupDetails() {
public LeaderboardGroupDetailsPanelPO getLeaderboardGroupDetails() {
if(!this.leaderboardGroupDetailsPanel.isDisplayed()) {
return null;
}
return new LeaderboardGroupDetailsPanel(this.driver, this.leaderboardGroupDetailsPanel);
return new LeaderboardGroupDetailsPanelPO(this.driver, this.leaderboardGroupDetailsPanel);
}
private DataEntry findLeaderboardGroup(String name) {
CellTable<DataEntry> table = getLeaderboardGroupsTable();
final DataEntry alias = Alias.alias(DataEntry.class);
TableQuery<DataEntry> query = new TableQuery<>();
private DataEntryPO findLeaderboardGroup(String name) {
CellTablePO<DataEntryPO> table = getLeaderboardGroupsTable();
final DataEntryPO alias = Alias.alias(DataEntryPO.class);
TableQuery<DataEntryPO> query = new TableQuery<>();
query.from(table)
.where(
$(alias.getColumnContent("Name")).eq(name)
@@ -6,9 +6,9 @@ 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.DataEntryDialog;
import com.sap.sailing.selenium.pages.common.DataEntryDialogPO;
public class LeaderboardGroupCreateDialog extends DataEntryDialog {
public class LeaderboardGroupCreateDialogPO extends DataEntryDialogPO {
@FindBy(how = BySeleniumId.class, using = "NameTextBox")
private WebElement nameField;
@@ -16,7 +16,7 @@ public class LeaderboardGroupCreateDialog extends DataEntryDialog {
@FindBy(how = BySeleniumId.class, using = "DescriptionTextArea")
private WebElement descriptionField;
public LeaderboardGroupCreateDialog(WebDriver driver, WebElement element) {
public LeaderboardGroupCreateDialogPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -10,14 +10,14 @@ import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
import com.sap.sailing.selenium.pages.gwt.CellTable;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.gwt.GenericCellTable;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.gwt.GenericCellTablePO;
import com.sap.sailing.selenium.pages.gwt.query.Alias;
import com.sap.sailing.selenium.pages.gwt.query.TableQuery;
public class LeaderboardGroupDetailsPanel extends PageArea {
public class LeaderboardGroupDetailsPanelPO extends PageArea {
@FindBy(how = BySeleniumId.class, using = "LeaderboardsFilterTextBox")
private WebElement leaderboardsFilterTextBox;
@@ -27,7 +27,7 @@ public class LeaderboardGroupDetailsPanel extends PageArea {
@FindBy(how = BySeleniumId.class, using = "RefreshLeaderboardsButton")
private WebElement refreshLeaderboardsButton;
public LeaderboardGroupDetailsPanel(WebDriver driver, WebElement element) {
public LeaderboardGroupDetailsPanelPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -35,15 +35,15 @@ public class LeaderboardGroupDetailsPanel extends PageArea {
this.refreshLeaderboardsButton.click();
}
public CellTable<DataEntry> getLeaderboardsTable() {
return new GenericCellTable<DataEntry>(this.driver, this.leaderboardsCellTable, DataEntry.class);
public CellTablePO<DataEntryPO> getLeaderboardsTable() {
return new GenericCellTablePO<DataEntryPO>(this.driver, this.leaderboardsCellTable, DataEntryPO.class);
}
public DataEntry findLeaderboardEntry(String name) {
CellTable<DataEntry> table = getLeaderboardsTable();
DataEntry alias = Alias.alias(DataEntry.class);
public DataEntryPO findLeaderboardEntry(String name) {
CellTablePO<DataEntryPO> table = getLeaderboardsTable();
DataEntryPO alias = Alias.alias(DataEntryPO.class);
TableQuery<DataEntry> query = new TableQuery<>();
TableQuery<DataEntryPO> query = new TableQuery<>();
query.from(table).
where($(alias.getColumnContent("Leaderboard Name")).eq(name));
@@ -7,17 +7,17 @@ import org.openqa.selenium.support.ui.Select;
import com.sap.sailing.selenium.core.BySeleniumId;
import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListComposite.RegattaDescriptor;
import com.sap.sailing.selenium.pages.common.DataEntryDialog;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListCompositePO.RegattaDescriptor;
import com.sap.sailing.selenium.pages.common.DataEntryDialogPO;
public class RegattaLeaderboardCreateDialog extends DataEntryDialog {
public class RegattaLeaderboardCreateDialogPO extends DataEntryDialogPO {
@FindBy(how = BySeleniumId.class, using = "NameTextBox")
private WebElement nameTextField;
@FindBy(how = BySeleniumId.class, using = "RegattaListBox")
private WebElement regattaDropDown;
public RegattaLeaderboardCreateDialog(WebDriver driver, WebElement element) {
public RegattaLeaderboardCreateDialogPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -6,9 +6,9 @@ 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.DataEntryDialog;
import com.sap.sailing.selenium.pages.common.DataEntryDialogPO;
public class RegattaCreateDialog extends DataEntryDialog {
public class RegattaCreateDialogPO extends DataEntryDialogPO {
@FindBy(how = BySeleniumId.class, using = "RegattaNameTextField")
private WebElement regattaNameTextField;
@@ -25,7 +25,7 @@ public class RegattaCreateDialog extends DataEntryDialog {
@FindBy(how = BySeleniumId.class, using = "AddSeriesButton")
private WebElement addSeriesButton;
public RegattaCreateDialog(WebDriver driver, WebElement element) {
public RegattaCreateDialogPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -41,11 +41,11 @@ public class RegattaCreateDialog extends DataEntryDialog {
// TODO: Scoring System, Event and Course Area
public SeriesCreateDialog addSeries() {
public SeriesCreateDialogPO addSeries() {
this.addSeriesButton.click();
WebElement dialog = findElementBySeleniumId(this.driver, "SeriesCreateDialog");
return new SeriesCreateDialog(this.driver, dialog);
return new SeriesCreateDialogPO(this.driver, dialog);
}
}
@@ -8,14 +8,14 @@ import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
import com.sap.sailing.selenium.pages.adminconsole.Actions;
import com.sap.sailing.selenium.pages.adminconsole.ActionsHelper;
import com.sap.sailing.selenium.pages.gwt.CellTable;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.gwt.GenericCellTable;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.gwt.GenericCellTablePO;
// TODO: Implement if needed
public class RegattaDetailsComposite extends PageArea {
public class RegattaDetailsCompositePO extends PageArea {
@FindBy(how = BySeleniumId.class, using = "NameLabel")
private WebElement regattaNameLabel;
@@ -31,7 +31,7 @@ public class RegattaDetailsComposite extends PageArea {
@FindBy(how = BySeleniumId.class, using = "SeriesCellTable")
private WebElement seriesTable;
public RegattaDetailsComposite(WebDriver driver, WebElement element) {
public RegattaDetailsCompositePO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -55,38 +55,38 @@ public class RegattaDetailsComposite extends PageArea {
//
// }
public SeriesEditDialog editSeries(String series) {
DataEntry entry = findSeries(series);
public SeriesEditDialogPO editSeries(String series) {
DataEntryPO entry = findSeries(series);
if(entry != null) {
WebElement action = Actions.findEditAction(entry.getWebElement());
WebElement action = ActionsHelper.findEditAction(entry.getWebElement());
action.click();
WebElement dialog = findElementBySeleniumId(this.driver, "SeriesEditDialog");
return new SeriesEditDialog(this.driver, dialog);
return new SeriesEditDialogPO(this.driver, dialog);
}
return null;
}
public void deleteSeries(String series) {
DataEntry entry = findSeries(series);
DataEntryPO entry = findSeries(series);
if(entry != null) {
WebElement removeAction = Actions.findRemoveAction(entry.getWebElement());
WebElement removeAction = ActionsHelper.findRemoveAction(entry.getWebElement());
removeAction.click();
Actions.acceptAlert(this.driver);
ActionsHelper.acceptAlert(this.driver);
//waitForAjaxRequests();
}
}
private DataEntry findSeries(String series) {
CellTable<DataEntry> table = getSeriesTable();
private DataEntryPO findSeries(String series) {
CellTablePO<DataEntryPO> table = getSeriesTable();
for(DataEntry entry : table.getEntries()) {
for(DataEntryPO entry : table.getEntries()) {
String name = entry.getColumnContent(0);
if(series.equals(name))
@@ -96,7 +96,7 @@ public class RegattaDetailsComposite extends PageArea {
return null;
}
private CellTable<DataEntry> getSeriesTable() {
return new GenericCellTable<>(this.driver, this.seriesTable, DataEntry.class);
private CellTablePO<DataEntryPO> getSeriesTable() {
return new GenericCellTablePO<>(this.driver, this.seriesTable, DataEntryPO.class);
}
}
@@ -5,9 +5,9 @@ import org.openqa.selenium.WebElement;
import com.sap.sailing.selenium.pages.PageArea;
public class RegattaEditDialog extends PageArea {
public class RegattaEditDialogPO extends PageArea {
public RegattaEditDialog(WebDriver driver, WebElement element) {
public RegattaEditDialogPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -12,14 +12,14 @@ import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
import com.sap.sailing.selenium.pages.adminconsole.Actions;
import com.sap.sailing.selenium.pages.adminconsole.ActionsHelper;
import com.sap.sailing.selenium.pages.gwt.CellTable;
import com.sap.sailing.selenium.pages.gwt.CellTable.SortingOrder;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.gwt.GenericCellTable;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.CellTablePO.SortingOrder;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.gwt.GenericCellTablePO;
public class RegattaListComposite extends PageArea {
public class RegattaListCompositePO extends PageArea {
public static class RegattaDescriptor {
private final String name;
private final String boatClass;
@@ -90,7 +90,7 @@ public class RegattaListComposite extends PageArea {
@FindBy(how = BySeleniumId.class, using = "RegattasCellTable")
private WebElement regattasTable;
public RegattaListComposite(WebDriver driver, WebElement element) {
public RegattaListCompositePO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -104,9 +104,9 @@ public class RegattaListComposite extends PageArea {
public List<RegattaDescriptor> getRegattas() {
List<RegattaDescriptor> descriptors = new LinkedList<>();
CellTable<DataEntry> table = getRegattasTable();
CellTablePO<DataEntryPO> table = getRegattasTable();
for(DataEntry entry : table.getEntries()) {
for(DataEntryPO entry : table.getEntries()) {
String name = entry.getColumnContent(0);
String boatClass = entry.getColumnContent(1);
@@ -117,7 +117,7 @@ public class RegattaListComposite extends PageArea {
}
public void selectRegatta(RegattaDescriptor regatta) {
DataEntry entry = findRegatta(regatta);
DataEntryPO entry = findRegatta(regatta);
if(entry != null) {
entry.select();
@@ -129,22 +129,22 @@ public class RegattaListComposite extends PageArea {
// }
public void removeRegatta(RegattaDescriptor regatta) {
DataEntry entry = findRegatta(regatta);
DataEntryPO entry = findRegatta(regatta);
if(entry != null) {
WebElement action = Actions.findRemoveAction(entry.getWebElement());
WebElement action = ActionsHelper.findRemoveAction(entry.getWebElement());
action.click();
waitForAjaxRequests();
Actions.acceptAlert(this.driver);
ActionsHelper.acceptAlert(this.driver);
}
}
private DataEntry findRegatta(RegattaDescriptor regatta) {
CellTable<DataEntry> table = getRegattasTable();
private DataEntryPO findRegatta(RegattaDescriptor regatta) {
CellTablePO<DataEntryPO> table = getRegattasTable();
for(DataEntry entry : table.getEntries()) {
for(DataEntryPO entry : table.getEntries()) {
String name = entry.getColumnContent(0);
// String boatClass = columns.getColumnContent(1);
//
@@ -158,11 +158,11 @@ public class RegattaListComposite extends PageArea {
}
private void sortRegattaList(int column, SortingOrder order) {
CellTable<DataEntry> table = getRegattasTable();
CellTablePO<DataEntryPO> table = getRegattasTable();
table.sortByColumn(column, order);
}
private CellTable<DataEntry> getRegattasTable() {
return new GenericCellTable<>(this.driver, this.regattasTable, DataEntry.class);
private CellTablePO<DataEntryPO> getRegattasTable() {
return new GenericCellTablePO<>(this.driver, this.regattasTable, DataEntryPO.class);
}
}
@@ -9,9 +9,9 @@ import com.sap.sailing.selenium.core.BySeleniumId;
import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListComposite.RegattaDescriptor;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListCompositePO.RegattaDescriptor;
public class RegattaStructureManagementPanel extends PageArea {
public class RegattaStructureManagementPanelPO extends PageArea {
public static final String DEFAULT_SERIES_NAME = "Default"; //$NON-NLS-1$
@FindBy(how = BySeleniumId.class, using = "AddRegattaButton")
@@ -26,16 +26,16 @@ public class RegattaStructureManagementPanel extends PageArea {
@FindBy(how = BySeleniumId.class, using = "RegattaDetailsComposite")
WebElement regattaDetails;
public RegattaStructureManagementPanel(WebDriver driver, WebElement element) {
public RegattaStructureManagementPanelPO(WebDriver driver, WebElement element) {
super(driver, element);
}
public RegattaCreateDialog startRegattaCreation() {
public RegattaCreateDialogPO startRegattaCreation() {
this.addRegattaButton.click();
WebElement dialog = findElementBySeleniumId(this.driver, "RegattaCreateDialog"); //$NON-NLS-1$
return new RegattaCreateDialog(this.driver, dialog);
return new RegattaCreateDialogPO(this.driver, dialog);
}
/**
@@ -44,11 +44,11 @@ public class RegattaStructureManagementPanel extends PageArea {
* @param regatta
*/
public void createRegatta(RegattaDescriptor regatta) {
RegattaCreateDialog createRegattaDialog = startRegattaCreation();
RegattaCreateDialogPO createRegattaDialog = startRegattaCreation();
createRegattaDialog.setRegattaName(regatta.getName());
createRegattaDialog.setBoatClass(regatta.getBoatClass());
SeriesCreateDialog addSeriesDialog = createRegattaDialog.addSeries();
SeriesCreateDialogPO addSeriesDialog = createRegattaDialog.addSeries();
addSeriesDialog.setSeriesName(DEFAULT_SERIES_NAME);
addSeriesDialog.pressOk();
@@ -65,24 +65,24 @@ public class RegattaStructureManagementPanel extends PageArea {
// Select all regattas and click the remove button
}
public RegattaListComposite getRegattaList() {
return new RegattaListComposite(this.driver, this.regattaList);
public RegattaListCompositePO getRegattaList() {
return new RegattaListCompositePO(this.driver, this.regattaList);
}
public void selectRegatta(RegattaDescriptor regatta) {
}
public RegattaDetailsComposite getRegattaDetails(RegattaDescriptor regatta) {
RegattaListComposite regattaList = getRegattaList();
public RegattaDetailsCompositePO getRegattaDetails(RegattaDescriptor regatta) {
RegattaListCompositePO regattaList = getRegattaList();
regattaList.selectRegatta(regatta);
return getRegattaDetails();
}
public RegattaDetailsComposite getRegattaDetails() {
public RegattaDetailsCompositePO getRegattaDetails() {
if(this.regattaDetails.isDisplayed())
return new RegattaDetailsComposite(this.driver, this.regattaDetails);
return new RegattaDetailsCompositePO(this.driver, this.regattaDetails);
return null;
}
@@ -6,9 +6,9 @@ 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.DataEntryDialog;
import com.sap.sailing.selenium.pages.common.DataEntryDialogPO;
public class SeriesCreateDialog extends DataEntryDialog {
public class SeriesCreateDialogPO extends DataEntryDialogPO {
@FindBy(how = BySeleniumId.class, using = "NameTextField")
private WebElement seriesNameTextField;
@@ -27,7 +27,7 @@ public class SeriesCreateDialog extends DataEntryDialog {
// @FindBy(how = BySeleniumId.class, using = "FleetListEditorComposite")
// private WebElement fleetsPanel;
public SeriesCreateDialog(WebDriver driver, WebElement element) {
public SeriesCreateDialogPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -7,9 +7,9 @@ import org.openqa.selenium.support.ui.Select;
import com.sap.sailing.selenium.core.BySeleniumId;
import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.common.DataEntryDialog;
import com.sap.sailing.selenium.pages.common.DataEntryDialogPO;
public class SeriesEditDialog extends DataEntryDialog {
public class SeriesEditDialogPO extends DataEntryDialogPO {
@FindBy(how = BySeleniumId.class, using = "MedalSeriesCheckbox")
private WebElement medalSeriesCheckbox;
@@ -32,7 +32,7 @@ public class SeriesEditDialog extends DataEntryDialog {
@FindBy(how = BySeleniumId.class, using = "AddRacesButton")
private WebElement addRacesButton;
public SeriesEditDialog(WebDriver driver, WebElement element) {
public SeriesEditDialogPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -14,11 +14,11 @@ import com.sap.sailing.selenium.core.BySeleniumId;
import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
import com.sap.sailing.selenium.pages.gwt.CellTable;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.gwt.GenericCellTable;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.gwt.GenericCellTablePO;
public class TrackedRacesList extends PageArea {
public class TrackedRacesListPO extends PageArea {
public enum Status {
LOADING,
TRACKING,
@@ -105,7 +105,7 @@ public class TrackedRacesList extends PageArea {
//@FindBy(how = BySeleniumId.class, using = "ExportPopup")
protected TrackedRacesList(WebDriver driver, WebElement element) {
protected TrackedRacesListPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -116,9 +116,9 @@ public class TrackedRacesList extends PageArea {
public List<TrackedRaceDescriptor> getTrackedRaces() {
List<TrackedRaceDescriptor> descriptors = new LinkedList<>();
CellTable<DataEntry> table = getTrackedRacesTable();
CellTablePO<DataEntryPO> table = getTrackedRacesTable();
for(DataEntry entry : table.getEntries()) {
for(DataEntryPO entry : table.getEntries()) {
String regatta = entry.getColumnContent(0);
String boatClass = entry.getColumnContent(1);
String race = entry.getColumnContent(2);
@@ -138,9 +138,9 @@ public class TrackedRacesList extends PageArea {
public List<Status> getStatus(List<TrackedRaceDescriptor> races) {
List<Status> result = new ArrayList<>(Collections.<Status>nCopies(races.size(), null));
CellTable<DataEntry> table = getTrackedRacesTable();
CellTablePO<DataEntryPO> table = getTrackedRacesTable();
for(DataEntry entry : table.getEntries()) {
for(DataEntryPO entry : table.getEntries()) {
String regatta = entry.getColumnContent(0);
String boatClass = entry.getColumnContent(1);
String race = entry.getColumnContent(2);
@@ -170,8 +170,8 @@ public class TrackedRacesList extends PageArea {
waitForAjaxRequests();
}
private CellTable<DataEntry> getTrackedRacesTable() {
return new GenericCellTable<>(this.driver, this.trackedRacesTable, DataEntry.class);
private CellTablePO<DataEntryPO> getTrackedRacesTable() {
return new GenericCellTablePO<>(this.driver, this.trackedRacesTable, DataEntryPO.class);
}
// private List<WebElement> getTrackedRaces(List<TrackedRaceDescriptor> races) {
@@ -7,15 +7,15 @@ import com.sap.sailing.selenium.core.BySeleniumId;
import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
public class TrackedRacesManagementPanel extends PageArea {
public class TrackedRacesManagementPanelPO extends PageArea {
@FindBy(how = BySeleniumId.class, using = "TrackedRacesListComposite")
private WebElement trackedRacesListCoposite;
public TrackedRacesManagementPanel(WebDriver driver, WebElement element) {
public TrackedRacesManagementPanelPO(WebDriver driver, WebElement element) {
super(driver, element);
}
public TrackedRacesList getTrackedRacesList() {
return new TrackedRacesList(this.driver, this.trackedRacesListCoposite);
public TrackedRacesListPO getTrackedRacesList() {
return new TrackedRacesListPO(this.driver, this.trackedRacesListCoposite);
}
}
@@ -17,11 +17,11 @@ import com.sap.sailing.selenium.core.BySeleniumId;
import com.sap.sailing.selenium.pages.PageArea;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListComposite.RegattaDescriptor;
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListCompositePO.RegattaDescriptor;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.gwt.CellTable;
import com.sap.sailing.selenium.pages.gwt.GenericCellTable;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.GenericCellTablePO;
/**
* <p>The page object representing the TracTrac Events tab.</p>
@@ -29,7 +29,7 @@ import com.sap.sailing.selenium.pages.gwt.GenericCellTable;
* @author
* D049941
*/
public class TracTracEventManagementPanel extends PageArea {
public class TracTracEventManagementPanelPO extends PageArea {
public static class TrackableRaceDescriptor {
public final String eventName;
public final String raceName;
@@ -116,7 +116,7 @@ public class TracTracEventManagementPanel extends PageArea {
* @param element
*
*/
public TracTracEventManagementPanel(WebDriver driver, WebElement element) {
public TracTracEventManagementPanelPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -163,9 +163,9 @@ public class TracTracEventManagementPanel extends PageArea {
*/
public List<TrackableRaceDescriptor> getTrackableRaces() {
List<TrackableRaceDescriptor> descriptors = new LinkedList<>();
CellTable<DataEntry> table = getTrackableRacesTable();
CellTablePO<DataEntryPO> table = getTrackableRacesTable();
for(DataEntry entry : table.getEntries()) {
for(DataEntryPO entry : table.getEntries()) {
String event = entry.getColumnContent(0);
String race = entry.getColumnContent(1);
String boatClass = entry.getColumnContent(2);
@@ -223,12 +223,12 @@ public class TracTracEventManagementPanel extends PageArea {
}
public void startTrackingForRaces(List<TrackableRaceDescriptor> races) {
CellTable<DataEntry> table = getTrackableRacesTable();
List<DataEntry> entries = table.getEntries();
Iterator<DataEntry> iterator = entries.iterator();
CellTablePO<DataEntryPO> table = getTrackableRacesTable();
List<DataEntryPO> entries = table.getEntries();
Iterator<DataEntryPO> iterator = entries.iterator();
while(iterator.hasNext()) {
DataEntry entry = iterator.next();
DataEntryPO entry = iterator.next();
String event = entry.getColumnContent(0);
String race = entry.getColumnContent(1);
@@ -247,8 +247,8 @@ public class TracTracEventManagementPanel extends PageArea {
waitForAjaxRequests();
}
private CellTable<DataEntry> getTrackableRacesTable() {
return new GenericCellTable<>(this.driver, this.trackableRacesCellTable, DataEntry.class);
private CellTablePO<DataEntryPO> getTrackableRacesTable() {
return new GenericCellTablePO<>(this.driver, this.trackableRacesCellTable, DataEntryPO.class);
}
private void setSelection(WebElement checkbox, boolean selected) {
@@ -7,7 +7,7 @@ import com.sap.sailing.selenium.core.BySeleniumId;
import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
public abstract class DataEntryDialog extends PageArea {
public abstract class DataEntryDialogPO extends PageArea {
@FindBy(how = BySeleniumId.class, using = "StatusLabel")
private WebElement statusLabel;
@@ -18,7 +18,7 @@ public abstract class DataEntryDialog extends PageArea {
private WebElement cancelButton;
public DataEntryDialog(WebDriver driver, WebElement element) {
public DataEntryDialogPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -28,7 +28,7 @@ import com.sap.sailing.selenium.pages.common.CSSHelper;
* @param <T>
* The type of the data entries the table contains.
*/
public abstract class CellTable<T extends DataEntry> extends PageArea {
public abstract class CellTablePO<T extends DataEntryPO> extends PageArea {
/**
* <p></p>
*/
@@ -92,7 +92,7 @@ public abstract class CellTable<T extends DataEntry> extends PageArea {
* @param element
*
*/
public CellTable(WebDriver driver, WebElement element) {
public CellTablePO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -4,12 +4,12 @@ import org.openqa.selenium.WebElement;
import com.sap.sailing.selenium.pages.PageArea;
public abstract class CellTableRow extends PageArea {
public abstract class CellTableRowPO extends PageArea {
protected static final String ROW_TAG_NAME = "tr"; //$NON-NLS-1$
protected final CellTable<?> table;
protected final CellTablePO<?> table;
public CellTableRow(CellTable<?> table, WebElement element) {
public CellTableRowPO(CellTablePO<?> table, WebElement element) {
super(table.getWebDriver(), element);
this.table = table;
@@ -18,7 +18,7 @@ public abstract class CellTableRow extends PageArea {
/**
* <p>NOTE: This constructor is only used for creating an alias!</p>
*/
protected CellTableRow() {
protected CellTableRowPO() {
super(null, null);
this.table = null;
@@ -9,7 +9,7 @@ import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.PageArea;
import com.sap.sailing.selenium.pages.common.CSSHelper;
public class CheckBox extends PageArea {
public class CheckBoxPO extends PageArea {
protected static final String CHECKBOX_TAG_NAME = "span"; //$NON-NLS-1$
private static final String CHECKBOX_CSS_CLASS = "gwt-CheckBox";
@@ -20,7 +20,7 @@ public class CheckBox extends PageArea {
@FindBy(how = ByTagName.class, using = "label")
private WebElement label;
public CheckBox(WebDriver driver, WebElement element) {
public CheckBoxPO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -21,17 +21,17 @@ import com.sap.sailing.selenium.core.FindBy;
import com.sap.sailing.selenium.pages.common.CSSHelper;
public class DataEntry extends CellTableRow {
public class DataEntryPO extends CellTableRowPO {
protected static final String CELL_TAG_NAME = "td"; //$NON-NLS-1$
@FindBy(how = ByTagName.class, using = CELL_TAG_NAME)
private List<WebElement> columns;
public DataEntry(CellTable<?> table, WebElement element) {
public DataEntryPO(CellTablePO<?> table, WebElement element) {
super(table, element);
}
public DataEntry() {
public DataEntryPO() {
super();
}
@@ -44,7 +44,7 @@ public class DataEntry extends CellTableRow {
}
public boolean isSelected() {
return CSSHelper.hasCSSClass((WebElement) this.context, CellTable.SELECTED_ROW_CSS_CLASS);
return CSSHelper.hasCSSClass((WebElement) this.context, CellTablePO.SELECTED_ROW_CSS_CLASS);
}
public void select() {
@@ -13,7 +13,7 @@ import org.openqa.selenium.WebElement;
* @param <T>
* The type of the data entries the table contains.
*/
public class GenericCellTable<T extends DataEntry> extends CellTable<T> {
public class GenericCellTablePO<T extends DataEntryPO> extends CellTablePO<T> {
/**
* <p></p>
*
@@ -22,7 +22,7 @@ public class GenericCellTable<T extends DataEntry> extends CellTable<T> {
* @param <T>
* The type of the data entries the factory creates.
*/
public static interface DataEntryFactory<T extends DataEntry> {
public static interface DataEntryFactory<T extends DataEntryPO> {
/**
* <p>Creates and returns a new entry which represents the specified element (a row) of the given table.</p>
*
@@ -33,7 +33,7 @@ public class GenericCellTable<T extends DataEntry> extends CellTable<T> {
* @return
* The data entry representing the element.
*/
public <S extends CellTable<T>> T createEntry(S table, WebElement element);
public <S extends CellTablePO<T>> T createEntry(S table, WebElement element);
}
/**
@@ -44,7 +44,7 @@ public class GenericCellTable<T extends DataEntry> extends CellTable<T> {
* @param <T>
* The type of the data entries the factory creates.
*/
public static class DefaultDataEntryFactory<T extends DataEntry> implements DataEntryFactory<T> {
public static class DefaultDataEntryFactory<T extends DataEntryPO> implements DataEntryFactory<T> {
private Class<T> type;
/**
@@ -64,7 +64,7 @@ public class GenericCellTable<T extends DataEntry> extends CellTable<T> {
* with the formal parameter types CellTable and WebElement.</p>
*/
@Override
public <S extends CellTable<T>> T createEntry(S table, WebElement element) {
public <S extends CellTablePO<T>> T createEntry(S table, WebElement element) {
Class<?> clazz = table.getClass();
while(clazz != null) {
@@ -83,11 +83,11 @@ public class GenericCellTable<T extends DataEntry> extends CellTable<T> {
private DataEntryFactory<T> factory;
public GenericCellTable(WebDriver driver, WebElement element, Class<T> entryType) {
public GenericCellTablePO(WebDriver driver, WebElement element, Class<T> entryType) {
this(driver, element, new DefaultDataEntryFactory<>(entryType));
}
public GenericCellTable(WebDriver driver, WebElement element, DataEntryFactory<T> factory) {
public GenericCellTablePO(WebDriver driver, WebElement element, DataEntryFactory<T> factory) {
super(driver, element);
this.factory = factory;
@@ -4,20 +4,20 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.sap.sailing.selenium.pages.gwt.CellTable;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.gwt.query.operation.bool.And;
public class TableQuery<S extends DataEntry> {
private CellTable<? extends S> table;
public class TableQuery<S extends DataEntryPO> {
private CellTablePO<? extends S> table;
private Predicate where;
public TableQuery() {
}
public <Q extends CellTable<? extends S>> TableQuery<S> from(Q table) {
public <Q extends CellTablePO<? extends S>> TableQuery<S> from(Q table) {
this.table = table;
return this;
@@ -3,19 +3,19 @@ package com.sap.sailing.selenium.pages.leaderboard;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import com.sap.sailing.selenium.pages.gwt.CellTable;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.pages.leaderboard.LeaderboardTable.LeaderboardEntry;
import com.sap.sailing.selenium.pages.leaderboard.LeaderboardTablePO.LeaderboardEntry;
public class LeaderboardTable extends CellTable<LeaderboardEntry> {
public class LeaderboardEntry extends DataEntry {
public class LeaderboardTablePO extends CellTablePO<LeaderboardEntry> {
public class LeaderboardEntry extends DataEntryPO {
private static final String TOTAL_RANK = "Total rank";
private static final String COMPETITOR = "Competitor";
private static final String NAME = "Name";
protected LeaderboardEntry(WebElement element) {
super(LeaderboardTable.this, element);
super(LeaderboardTablePO.this, element);
}
@@ -53,7 +53,7 @@ public class LeaderboardTable extends CellTable<LeaderboardEntry> {
// }
}
public LeaderboardTable(WebDriver driver, WebElement element) {
public LeaderboardTablePO(WebDriver driver, WebElement element) {
super(driver, element);
}
@@ -27,7 +27,7 @@ import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.RemoteWebDriver;
import com.sap.sailing.selenium.core.Managed;
import com.sap.sailing.selenium.core.Selenium;
import com.sap.sailing.selenium.core.SeleniumRunner;
import com.sap.sailing.selenium.core.TestEnvironment;
import com.sap.sailing.selenium.core.WindowManager;
@@ -39,7 +39,7 @@ import com.sap.sailing.selenium.core.WindowManager;
* @author
* D049941
*/
@RunWith(Selenium.class)
@RunWith(SeleniumRunner.class)
public abstract class AbstractSeleniumTest {
private static final String CLEAR_STATE_URL = "sailingserver/test-support/clearState"; //$NON-NLS-1$
@@ -7,8 +7,8 @@ import org.junit.Before;
import org.junit.Test;
import com.sap.sailing.selenium.pages.adminconsole.AdminConsolePage;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.FlexibleLeaderboardCreateDialog;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfigurationPanel;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.FlexibleLeaderboardCreateDialogPO;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfigurationPanelPO;
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
/**
@@ -25,10 +25,10 @@ public class TestLeaderboardCreation extends AbstractSeleniumTest {
@Test
public void testCreateFlexibleLeaderboardWithDuplicateName() {
FlexibleLeaderboardCreateDialog dialog;
FlexibleLeaderboardCreateDialogPO dialog;
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
LeaderboardConfigurationPanel leaderboardConfiguration = adminConsole.goToLeaderboardConfiguration();
LeaderboardConfigurationPanelPO leaderboardConfiguration = adminConsole.goToLeaderboardConfiguration();
dialog = leaderboardConfiguration.startCreatingFlexibleLeaderboard();
dialog.setName("Humba Humba");
@@ -8,10 +8,10 @@ import org.junit.Before;
import org.junit.Test;
import com.sap.sailing.selenium.pages.adminconsole.AdminConsolePage;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfigurationPanel;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardGroupConfigurationPanel;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardGroupDetailsPanel;
import com.sap.sailing.selenium.pages.gwt.DataEntry;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfigurationPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardGroupConfigurationPanelPO;
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardGroupDetailsPanelPO;
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
public class TestLeaderboardFilterInLeaderboardGroupConfig extends AbstractSeleniumTest {
@@ -24,19 +24,19 @@ public class TestLeaderboardFilterInLeaderboardGroupConfig extends AbstractSelen
public void testLeaderboardFilterInLeaderboardGroupConfig() {
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
LeaderboardGroupConfigurationPanel leaderboardGroupConfiguration = adminConsole.goToLeaderboardGroupConfiguration();
LeaderboardGroupConfigurationPanelPO leaderboardGroupConfiguration = adminConsole.goToLeaderboardGroupConfiguration();
leaderboardGroupConfiguration.createLeaderboardGroup("Test", "Test");
List<DataEntry> selectedEntries = leaderboardGroupConfiguration.getLeaderboardGroupsTable().getSelectedEntries();
List<DataEntryPO> selectedEntries = leaderboardGroupConfiguration.getLeaderboardGroupsTable().getSelectedEntries();
assertEquals(1, selectedEntries.size());
assertEquals("Test", selectedEntries.get(0).getColumnContent("Name"));
LeaderboardConfigurationPanel leaderboardConfiguration = adminConsole.goToLeaderboardConfiguration();
LeaderboardConfigurationPanelPO leaderboardConfiguration = adminConsole.goToLeaderboardConfiguration();
leaderboardConfiguration.createFlexibleLeaderboard("Test");
leaderboardGroupConfiguration = adminConsole.goToLeaderboardGroupConfiguration();
LeaderboardGroupDetailsPanel leaderboardGroupDetails = leaderboardGroupConfiguration.getLeaderboardGroupDetails();
LeaderboardGroupDetailsPanelPO leaderboardGroupDetails = leaderboardGroupConfiguration.getLeaderboardGroupDetails();
leaderboardGroupDetails.refreshLeaderboards();
DataEntry leaderboardEntry = leaderboardGroupDetails.findLeaderboardEntry("Test");
DataEntryPO leaderboardEntry = leaderboardGroupDetails.findLeaderboardEntry("Test");
assertNotNull(leaderboardEntry);
leaderboardGroupDetails.filterLeaderboards("Test");
@@ -6,7 +6,7 @@ import static org.hamcrest.core.Is.*;
import static org.junit.Assert.*;
import com.sap.sailing.selenium.pages.adminconsole.AdminConsolePage;
import com.sap.sailing.selenium.pages.adminconsole.tractrac.TracTracEventManagementPanel;
import com.sap.sailing.selenium.pages.adminconsole.tractrac.TracTracEventManagementPanelPO;
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
/**
@@ -27,7 +27,7 @@ public class TestRaceFilterForTracTracEvents extends AbstractSeleniumTest {
public void testNoFilter() {
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
TracTracEventManagementPanel tracTracEvents = adminConsole.goToTracTracEvents();
TracTracEventManagementPanelPO tracTracEvents = adminConsole.goToTracTracEvents();
tracTracEvents.listTrackableRaces(BMW_CUP_JSON_URL);
assertThat(tracTracEvents.getTrackableRaces().size(), is(12));
@@ -42,7 +42,7 @@ public class TestRaceFilterForTracTracEvents extends AbstractSeleniumTest {
public void testPartialFilter() {
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
TracTracEventManagementPanel tracTracEvents = adminConsole.goToTracTracEvents();
TracTracEventManagementPanelPO tracTracEvents = adminConsole.goToTracTracEvents();
tracTracEvents.listTrackableRaces(BMW_CUP_JSON_URL);
tracTracEvents.setFilterForTrackableRaces("BMW Cup Race 1"); //$NON-NLS-1$
@@ -57,7 +57,7 @@ public class TestRaceFilterForTracTracEvents extends AbstractSeleniumTest {
public void testExactFilter() {
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
TracTracEventManagementPanel tracTracEvents = adminConsole.goToTracTracEvents();
TracTracEventManagementPanelPO tracTracEvents = adminConsole.goToTracTracEvents();
tracTracEvents.listTrackableRaces(BMW_CUP_JSON_URL);
tracTracEvents.setFilterForTrackableRaces("BMW Cup Race 12"); //$NON-NLS-1$
@@ -72,7 +72,7 @@ public class TestRaceFilterForTracTracEvents extends AbstractSeleniumTest {
public void testNoneMatchingFilter() {
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
TracTracEventManagementPanel tracTracEvents = adminConsole.goToTracTracEvents();
TracTracEventManagementPanelPO tracTracEvents = adminConsole.goToTracTracEvents();
tracTracEvents.listTrackableRaces(BMW_CUP_JSON_URL);
tracTracEvents.setFilterForTrackableRaces("BMW Cup Race 18"); //$NON-NLS-1$
@@ -3,7 +3,7 @@ package com.sap.sailing.selenium.test.adminconsole;
import org.junit.Test;
import com.sap.sailing.selenium.pages.adminconsole.AdminConsolePage;
import com.sap.sailing.selenium.pages.adminconsole.tractrac.TracTracEventManagementPanel;
import com.sap.sailing.selenium.pages.adminconsole.tractrac.TracTracEventManagementPanelPO;
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
/**
@@ -28,7 +28,7 @@ public class TestStartAndStopTrackingForTracTracEvents extends AbstractSeleniumT
public void testStartAndStopTrackingWithCorrectRegatta() {
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
TracTracEventManagementPanel tracTracEvents = adminConsole.goToTracTracEvents();
TracTracEventManagementPanelPO tracTracEvents = adminConsole.goToTracTracEvents();
tracTracEvents.listTrackableRaces(BMW_CUP_JSON_URL);
// TODO: Complete the test case!