mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-20 19:20:04 +00:00
bug3529 Extended Selenium test with leaderboard settings forwarding
This commit is contained in:
1 parent
42bfd7280c
commit
41b0c73a47
13 files changed
+185
-20
No files matched your search
+24
-8
@@ -59,10 +59,13 @@ public class PageObject {
|
||||
|
||||
public static final int DEFAULT_POLLING_INTERVAL = 5;
|
||||
|
||||
private static final MessageFormat TAB_EXPRESSION = new MessageFormat(
|
||||
private static final MessageFormat TAB_PANEL_EXPRESSION = new MessageFormat(
|
||||
".//div[contains(@class, \"gwt-TabBarItem\")]/div[text()=\"{0}\"]/../..");
|
||||
|
||||
private static final MessageFormat TAB_LAYOUT_PANEL_EXPRESSION = new MessageFormat(
|
||||
".//div[contains(@class, \"gwt-TabLayoutPanelTabInner\")]/div[text()=\"{0}\"]/../..");
|
||||
|
||||
private static final MessageFormat VERTICAL_TAB_EXPRESSION = new MessageFormat(
|
||||
private static final MessageFormat VERTICAL_TAB_LAYOUT_PANEL_EXPRESSION = new MessageFormat(
|
||||
".//div[contains(@class, \"gwt-VerticalTabLayoutPanelTabInner\")]/div[text()=\"{0}\"]/../..");
|
||||
|
||||
/**
|
||||
@@ -455,13 +458,22 @@ public class PageObject {
|
||||
T get(WebDriver driver, WebElement element);
|
||||
}
|
||||
|
||||
protected WebElement goToTab(WebElement tabPanel, String tabName, final String id, boolean isVertical) {
|
||||
final String expression;
|
||||
if (isVertical) {
|
||||
expression = VERTICAL_TAB_EXPRESSION.format(new Object[] {tabName});
|
||||
} else {
|
||||
expression = TAB_EXPRESSION.format(new Object[] {tabName});
|
||||
protected WebElement goToTab(WebElement tabPanel, String tabName, final String id, TabPanelType tabPanelType) {
|
||||
final MessageFormat expressionFormat;
|
||||
switch(tabPanelType) {
|
||||
case TAB_PANEL:
|
||||
expressionFormat = TAB_PANEL_EXPRESSION;
|
||||
break;
|
||||
case TAB_LAYOUT_PANEL:
|
||||
expressionFormat = TAB_LAYOUT_PANEL_EXPRESSION;
|
||||
break;
|
||||
case VERTICAL_TAB_LAYOUT_PANEL:
|
||||
expressionFormat = VERTICAL_TAB_LAYOUT_PANEL_EXPRESSION;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("TabPanelType \"" + tabPanelType + "\" is unsupported");
|
||||
}
|
||||
final String expression = expressionFormat.format(new Object[] {tabName});
|
||||
WebElement tab = tabPanel.findElement(By.xpath(expression));
|
||||
WebDriverWait waitForTab = new WebDriverWait(driver, 20); // here, wait time is 20 seconds
|
||||
waitForTab.until(ExpectedConditions.visibilityOf(tab)); // this will wait for tab to be visible for 20 seconds
|
||||
@@ -477,4 +489,8 @@ public class PageObject {
|
||||
waitForAjaxRequests(); // switching tabs can trigger asynchronous updates, replacing UI elements
|
||||
return content;
|
||||
}
|
||||
|
||||
public enum TabPanelType {
|
||||
TAB_PANEL, TAB_LAYOUT_PANEL, VERTICAL_TAB_LAYOUT_PANEL
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -173,6 +173,6 @@ public class AdminConsolePage extends HostPageWithAuthentication {
|
||||
}
|
||||
|
||||
private WebElement goToTab(String label, final String id, boolean isVertical) {
|
||||
return goToTab(administrationTabPanel, label, id, isVertical);
|
||||
return goToTab(administrationTabPanel, label, id, isVertical ? TabPanelType.VERTICAL_TAB_LAYOUT_PANEL : TabPanelType.TAB_LAYOUT_PANEL);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class EventCreateDialogPO extends DataEntryDialogPO {
|
||||
}
|
||||
|
||||
WebElement goToTab(String tabName, String id) {
|
||||
return goToTab(eventDialogTabPanel, tabName, id, /* isVertical */ false);
|
||||
return goToTab(eventDialogTabPanel, tabName, id, TabPanelType.TAB_LAYOUT_PANEL);
|
||||
}
|
||||
|
||||
WebElement goToLeaderboardGroupsTab() {
|
||||
|
||||
+2
-3
@@ -12,7 +12,6 @@ import com.sap.sailing.selenium.core.FindBy;
|
||||
import com.sap.sailing.selenium.pages.PageArea;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.ActionsHelper;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListCompositePO.RegattaDescriptor;
|
||||
import com.sap.sailing.selenium.pages.common.SettingsDialogPO;
|
||||
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
|
||||
import com.sap.sailing.selenium.pages.gwt.DataEntryPO;
|
||||
import com.sap.sailing.selenium.pages.gwt.GenericCellTablePO;
|
||||
@@ -44,9 +43,9 @@ public class LeaderboardConfigurationPanelPO extends PageArea {
|
||||
return link.getAttribute("href");
|
||||
}
|
||||
|
||||
public SettingsDialogPO getLeaderboardPageUrlConfigurationDialog() {
|
||||
public LeaderboardUrlConfigurationDialogPO getLeaderboardPageUrlConfigurationDialog() {
|
||||
clickActionImage(ACTION_NAME_CONFIGURE_URL);
|
||||
return getPO(SettingsDialogPO::new, "LeaderboardPageUrlConfigurationDialog");
|
||||
return getPO(LeaderboardUrlConfigurationDialogPO::new, "LeaderboardPageUrlConfigurationDialog");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.sap.sailing.selenium.pages.adminconsole.leaderboard;
|
||||
|
||||
import org.openqa.selenium.WebDriver;
|
||||
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.SettingsDialogPO;
|
||||
import com.sap.sailing.selenium.pages.leaderboard.LeaderboardSettingsDialogPO;
|
||||
|
||||
public class LeaderboardUrlConfigurationDialogPO extends SettingsDialogPO {
|
||||
|
||||
private static final String LEADERBOARD_SETTINGS_TAB_LABEL = "Leaderboard"; //$NON-NLS-1$
|
||||
private static final String LEADERBOARD_SETTINGS_TAB_IDENTIFIER = "LeaderboardSettingsPanel"; //$NON-NLS-1$
|
||||
|
||||
@FindBy(how = BySeleniumId.class, using = "TabbedSettingsDialogTabPanel")
|
||||
private WebElement tabbedSettingsDialogTabPanel;
|
||||
|
||||
public LeaderboardUrlConfigurationDialogPO(WebDriver driver, WebElement element) {
|
||||
super(driver, element);
|
||||
}
|
||||
|
||||
public LeaderboardSettingsDialogPO goToLeaderboardSettings() {
|
||||
goToTab(tabbedSettingsDialogTabPanel, LEADERBOARD_SETTINGS_TAB_LABEL, LEADERBOARD_SETTINGS_TAB_IDENTIFIER, TabPanelType.TAB_PANEL);
|
||||
return new LeaderboardSettingsDialogPO(this.driver, this.getWebElement());
|
||||
}
|
||||
|
||||
}
|
||||
+4
-2
@@ -5,6 +5,7 @@ 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.leaderboard.LeaderboardPage;
|
||||
|
||||
public class SettingsDialogPO extends DataEntryDialogPO {
|
||||
|
||||
@@ -15,7 +16,8 @@ public class SettingsDialogPO extends DataEntryDialogPO {
|
||||
super(driver, element);
|
||||
}
|
||||
|
||||
public void pressShareAnchor() {
|
||||
this.shareAnchor.click();
|
||||
public LeaderboardPage openLeaderboard() {
|
||||
String href = this.shareAnchor.getAttribute("href");
|
||||
return LeaderboardPage.goToPage(driver, href);
|
||||
}
|
||||
}
|
||||
+9
@@ -126,6 +126,15 @@ public abstract class CellTablePO<T extends DataEntryPO> extends PageArea {
|
||||
return headers;
|
||||
}
|
||||
|
||||
public boolean containsColumnHeader(String headerToCheck) {
|
||||
for (String header : getColumnHeaders()) {
|
||||
if(header.contains(headerToCheck)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p></p>
|
||||
*
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.sap.sailing.selenium.pages.leaderboard;
|
||||
|
||||
public enum DetailCheckboxInfo {
|
||||
|
||||
//Overall details
|
||||
REGATTA_RANK("RegattaRankCheckBox", "Regatta Rank"), TOTAL_DISTANCE("TotalDistanceTraveledCheckBox", "Total distance"), TOTAL_AVERAGE_SPEED_OVER_GROUND("TotalAverageSpeedOverGroundCheckBox", "∅ SOG"), TOTAL_TIME("TotalTimeSailedInSecondsCheckBox", "Total time"), MAXIMUM_SPEED_OVER_GROUND("MaximumSpeedOverGroundInKnotsCheckBox", "Max SOG"), TIME_ON_TIME_FACTOR("TimeOnTimeFactorCheckBox", "ToT Factor"), TIME_ON_DISTANCE_ALLOWANCE("TimeOnDistanceAllowanceInSecondsPerNauticalMileCheckBox", "ToD Allowance"),
|
||||
|
||||
//Race details
|
||||
RACE_GAP_TO_LEADER("RaceGapToLeaderInSecondsCheckBox", "Gap to leader"), RACE_AVERAGE_SPEED_OVER_GROUND("RaceAverageSpeedOverGroundInKnotsCheckBox", "∅ Speed"), RACE_DISTANCE("RaceDistanceTraveledCheckBox", "Distance"), RACE_DISTANCE_INCLUDING_GATE_START("RaceDistanceTraveledIncludingGateStartCheckBox", "Distance (w/ Gate Start)"), RACE_TIME("RaceTimeTraveledCheckBox", "Time"), RACE_CALCULATED_TIME("RaceCalculatedTimeTraveledCheckBox", "Calculated Time"), RACE_CALCULATED_TIME_AT_ESTIMATED_ARRIVAL_AT_COMPETITOR_FARTHEST_AHEAD("RaceCalculatedTimeAtEstimatedArrivalAtCompetitorFarthestAheadCheckBox", "Calc.Time @ Fastest"), RACE_CURRENT_SPEED_OVER_GROUND("RaceCurrentSpeedOverGroundInKnotsCheckBox", "SOG"), RACE_CURRENT_RIDE_HEIGHT("RaceCurrentRideHeightInMetersCheckBox", "Ride Height"), RACE_DISTANCE_TO_COMPETITOR_FARTHEST_AHEAD("RaceDistanceToCompetitorFarthestAheadInMetersCheckBox", "Gap"), NUMBER_OF_MANEUVERS("NumberOfManeuversCheckBox", "Maneuvers"), DISPLAY_LEGS("DisplayLegsCheckBox", "Legs"), CURRENT_LEG("CurrentLegCheckBox", "On Leg"), RACE_AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR("RaceAverageAbsoluteCrossTrackErrorInMetersCheckBox", "∅ XTE"), RACE_AVERAGE_SIGNED_CROSS_TRACK_ERROR("RaceAverageSignedCrossTrackErrorInMetersCheckBox", "∅ XTE +/-"), RACE_RATIO_BETWEEN_TIME_SINCE_LAST_POSITION_FIX_AND_AVERAGE_SAMPLING_INTERVAL("RaceRatioBetweenTimeSinceLastPositionFixAndAverageSamplingIntervalCheckBox", "GPS Lag"),
|
||||
|
||||
//Race Start Analysis
|
||||
RACE_DISTANCE_TO_START_FIVE_SECONDS_BEFORE_START("RaceDistanceToStartFiveSecondsBeforeRaceStartCheckBox", "Distance to line 5s before start"), RACE_SPEED_OVER_GROUND_FIVE_SECONDS_BEFORE_START("RaceSpeedOverGroundFiveSecondsBeforeStartCheckBox", "SOG 5s before start"), DISTANCE_TO_START_AT_RACE_START("DistanceToStartAtRaceStartCheckBox", "Distance to line at Start"), TIME_BETWEEN_RACE_START_AND_COMPETITOR_START("TimeBetweenRaceStartAndCompetitorStartCheckBox", "Start delay"), SPEED_OVER_GROUND_AT_RACE_START("SpeedOverGroundAtRaceStartCheckBox", "SOG at Start"), SPEED_OVER_GROUND_WHEN_STARTING("SpeedOverGroundWhenPassingStartCheckBox", "SOG when Starting"), DISTANCE_TO_STARBOARD_END_OF_STARTLINE_WHEN_STARTING("DistanceToStarboardEndOfStartlineWhenPassingStartInMetersCheckBox", "Dist. Stb-Side of Line when Starting"), START_TACK("StartTackCheckBox", "Start Tack"),
|
||||
|
||||
//Leg Details
|
||||
AVERAGE_SPEED_OVER_GROUND("AverageSpeedOverGroundInKnotsCheckBox", "∅ Speed"), DISTANCE("DistanceTraveledCheckBox", "Distance"), DISTANCE_INCLUDING_START("DistanceTraveledIncludingGateStartCheckBox", "Distance (w/ Gate Start)"), GAP_TO_LEADER("GapToLeaderInSecondsCheckBox", "Gap to leader"), GAP_CHANGE_SINCE_LEG_START("GapChangeSinceLegStartInSecondsCheckBox", "Gap Change"), SIDE_TO_WHICH_MARK_AT_LEG_START_WAS_ROUNDED("SideToWhichMarkAtLegStartWasRoundedCheckBox", "Mark rounded to"), CURRENT_SPEED_OVER_GROUND("CurrentSpeedOverGroundInKnotsCheckBox", "SOG (∅ at end)"), CURRENT_RIDE_HEIGHT("CurrentRideHeightInMetersCheckBox", "Ride Height (∅ at end)"), WINDWARD_DISTANCE_TO_GO("WindwardDistanceToGoInMetersCheckBox", "Windward distance to go"), NUMBER_OF_MANEVEURS("NumberOfManeuversCheckBox", "Maneuvers"), ESTIMATED_TIME_TO_NEXT_WAYPOINT("EstimatedTimeToNextWaypointInSecondsCheckBox", "ETA"), VELOCITY_MADE_GOOD("VelocityMadeGoodInKnotsCheckBox", "VMG"), TIME("TimeTraveledCheckBox", "Time"), CORRECTED_TIME("CorrectedTimeTraveledCheckBox", "Calculated Time"), AVERAGE_ABSOLUTE_CROSS_TRACK_ERROR("AverageAbsoluteCrossTrackErrorInMetersCheckBox", "∅ XTE"), AVERAGE_SIGNED_CROSS_TRACK_ERROR("AverageSignedCrossTrackErrorInMetersCheckBox", "∅ XTE +/-"), RANK_GAIN("RankGainCheckBox", "Rank Gain"),
|
||||
|
||||
//Maneuvers
|
||||
TACK("TackCheckBox", "Tack"), AVERAGE_TACK_LOSS("AverageTackLossInMetersCheckBox", "∅ Tack Loss"), JIBE("JibeCheckBox", "Jibe"), AVERAGE_JIBE_LOSS("AverageJibeLossInMetersCheckBox", "∅ Jibe Loss"), PENALTY_CIRCLE("PenaltyCircleCheckBox", "Penalty circle"), AVERAGE_MANEUVER_LOSS("AverageManeuverLossInMetersCheckBox", "∅ Maneuver Loss");
|
||||
|
||||
private final String id;
|
||||
private final String label;
|
||||
|
||||
private DetailCheckboxInfo(String id, String label) {
|
||||
this.id = id;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -53,6 +53,11 @@ public class LeaderboardPage extends HostPage {
|
||||
return new LeaderboardPage(driver, leaderboard);
|
||||
}
|
||||
|
||||
public static LeaderboardPage goToPage(WebDriver driver, String href) {
|
||||
driver.get(href);
|
||||
return new LeaderboardPage(driver);
|
||||
}
|
||||
|
||||
private static String getLeaderboard(String leaderboard) {
|
||||
return LEADERBOAR_PARAMTER_NAME + "=" + leaderboard; //$NON-NLS-1$
|
||||
}
|
||||
@@ -83,8 +88,12 @@ public class LeaderboardPage extends HostPage {
|
||||
@FindBy(how = BySeleniumId.class, using = "LeaderboardCellTable")
|
||||
private WebElement leaderboardCellTable;
|
||||
|
||||
private LeaderboardPage(WebDriver driver, String leaderboard) {
|
||||
private LeaderboardPage(WebDriver driver) {
|
||||
super(driver);
|
||||
}
|
||||
|
||||
private LeaderboardPage(WebDriver driver, String leaderboard) {
|
||||
this(driver);
|
||||
|
||||
if(!this.driver.getTitle().equals(leaderboard)) {
|
||||
throw new IllegalStateException("This is not the leaderboard"); //$NON-NLS-1$
|
||||
|
||||
+27
@@ -2,6 +2,7 @@ package com.sap.sailing.selenium.pages.leaderboard;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
@@ -64,6 +65,19 @@ public class LeaderboardSettingsDialogPO extends DataEntryDialogPO {
|
||||
textField.sendKeys(Integer.toString(numberOfRaces));
|
||||
}
|
||||
|
||||
public void setCheckboxValuesForDetails(boolean selected, DetailCheckboxInfo...detailCheckboxInfos) {
|
||||
for (DetailCheckboxInfo detailCheckboxInfo : detailCheckboxInfos) {
|
||||
setCheckboxValue(detailCheckboxInfo.getId(), selected);
|
||||
}
|
||||
}
|
||||
|
||||
public void assertCheckboxValuesForDetails(boolean selected, DetailCheckboxInfo...detailCheckboxInfos) {
|
||||
for (DetailCheckboxInfo detailCheckboxInfo : detailCheckboxInfos) {
|
||||
String checkboxId = detailCheckboxInfo.getId();
|
||||
Assert.assertTrue("Checkbox with id \"" + checkboxId + "\" is set to a wrong value", selected == getCheckboxValue(checkboxId));
|
||||
}
|
||||
}
|
||||
|
||||
public void setOverallDetails() {
|
||||
|
||||
}
|
||||
@@ -107,4 +121,17 @@ public class LeaderboardSettingsDialogPO extends DataEntryDialogPO {
|
||||
List<WebElement> e = settingsPanel.findElements(By.xpath(".//span[" + CSSHelper.containsCSSClassPredicate("gwt-CheckBox") + "]"));
|
||||
return e;
|
||||
}
|
||||
|
||||
public void setCheckboxValue(String checkboxId, boolean selected) {
|
||||
WebElement element = findElementBySeleniumId(checkboxId);
|
||||
CheckBoxPO checkbox = new CheckBoxPO(driver, element);
|
||||
checkbox.setSelected(selected);
|
||||
}
|
||||
|
||||
public boolean getCheckboxValue(String checkboxId) {
|
||||
WebElement element = findElementBySeleniumId(checkboxId);
|
||||
CheckBoxPO checkbox = new CheckBoxPO(driver, element);
|
||||
return checkbox.isSelected();
|
||||
}
|
||||
|
||||
}
|
||||
+42
-4
@@ -1,7 +1,9 @@
|
||||
package com.sap.sailing.selenium.test.raceboard;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
@@ -16,13 +18,16 @@ import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfig
|
||||
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardConfigurationPanelPO.LeaderboardEntryPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardDetailsPanelPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardDetailsPanelPO.RaceDescriptor;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.leaderboard.LeaderboardUrlConfigurationDialogPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListCompositePO.RegattaDescriptor;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesListPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesListPO.Status;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesListPO.TrackedRaceDescriptor;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.tractrac.TracTracEventManagementPanelPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.tractrac.TracTracEventManagementPanelPO.TrackableRaceDescriptor;
|
||||
import com.sap.sailing.selenium.pages.common.SettingsDialogPO;
|
||||
import com.sap.sailing.selenium.pages.leaderboard.DetailCheckboxInfo;
|
||||
import com.sap.sailing.selenium.pages.leaderboard.LeaderboardPage;
|
||||
import com.sap.sailing.selenium.pages.leaderboard.LeaderboardSettingsDialogPO;
|
||||
import com.sap.sailing.selenium.pages.raceboard.MapSettingsPO;
|
||||
import com.sap.sailing.selenium.pages.raceboard.RaceBoardPage;
|
||||
import com.sap.sailing.selenium.test.AbstractSeleniumTest;
|
||||
@@ -95,7 +100,7 @@ public class SettingsTest extends AbstractSeleniumTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // FIXME: Complete test implementation! NOTE: This is a test stub and therefore ignored.
|
||||
@Ignore
|
||||
public void testLeaderboardPageSettingsForwarding() {
|
||||
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
|
||||
EventConfigurationPanelPO events = adminConsole.goToEvents();
|
||||
@@ -105,7 +110,40 @@ public class SettingsTest extends AbstractSeleniumTest {
|
||||
|
||||
LeaderboardConfigurationPanelPO leaderboardConfiguration = adminConsole.goToLeaderboardConfiguration();
|
||||
LeaderboardEntryPO leaderboardEntry = leaderboardConfiguration.getLeaderboardTable().getEntry(BMW_CUP_REGATTA);
|
||||
SettingsDialogPO urlConfigurationDialog = leaderboardEntry.getLeaderboardPageUrlConfigurationDialog();
|
||||
urlConfigurationDialog.pressShareAnchor();
|
||||
LeaderboardUrlConfigurationDialogPO urlConfigurationDialog = leaderboardEntry.getLeaderboardPageUrlConfigurationDialog();
|
||||
LeaderboardSettingsDialogPO leaderboardSettingsPanel = urlConfigurationDialog.goToLeaderboardSettings();
|
||||
|
||||
leaderboardSettingsPanel.setCheckboxValue("R2CheckBox", false);
|
||||
DetailCheckboxInfo[] detailsSelected = { DetailCheckboxInfo.REGATTA_RANK, DetailCheckboxInfo.TOTAL_DISTANCE, DetailCheckboxInfo.TOTAL_AVERAGE_SPEED_OVER_GROUND, DetailCheckboxInfo.TIME_ON_TIME_FACTOR, DetailCheckboxInfo.TIME_ON_DISTANCE_ALLOWANCE };
|
||||
leaderboardSettingsPanel.setCheckboxValuesForDetails(true, detailsSelected);
|
||||
|
||||
DetailCheckboxInfo[] detailsUnselected = { DetailCheckboxInfo.TOTAL_TIME, DetailCheckboxInfo.MAXIMUM_SPEED_OVER_GROUND };
|
||||
leaderboardSettingsPanel.setCheckboxValuesForDetails(false, detailsUnselected);
|
||||
|
||||
LeaderboardPage leaderboardPage = urlConfigurationDialog.openLeaderboard();
|
||||
leaderboardSettingsPanel = leaderboardPage.getLeaderboardSettings();
|
||||
leaderboardSettingsPanel.assertCheckboxValuesForDetails(true, detailsSelected);
|
||||
leaderboardSettingsPanel.assertCheckboxValuesForDetails(false, detailsUnselected);
|
||||
Assert.assertTrue(leaderboardSettingsPanel.getCheckboxValue("R1CheckBox"));
|
||||
Assert.assertTrue(!leaderboardSettingsPanel.getCheckboxValue("R2CheckBox"));
|
||||
Assert.assertTrue(leaderboardSettingsPanel.getCheckboxValue("R3CheckBox"));
|
||||
|
||||
|
||||
adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
|
||||
leaderboardConfiguration = adminConsole.goToLeaderboardConfiguration();
|
||||
leaderboardEntry = leaderboardConfiguration.getLeaderboardTable().getEntry(BMW_CUP_REGATTA);
|
||||
urlConfigurationDialog = leaderboardEntry.getLeaderboardPageUrlConfigurationDialog();
|
||||
leaderboardSettingsPanel = urlConfigurationDialog.goToLeaderboardSettings();
|
||||
|
||||
detailsUnselected = Stream.concat(Arrays.stream(detailsSelected), Arrays.stream(detailsUnselected))
|
||||
.toArray(DetailCheckboxInfo[]::new);
|
||||
leaderboardSettingsPanel.setCheckboxValuesForDetails(false, detailsUnselected);
|
||||
|
||||
leaderboardPage = urlConfigurationDialog.openLeaderboard();
|
||||
leaderboardSettingsPanel = leaderboardPage.getLeaderboardSettings();
|
||||
leaderboardSettingsPanel.assertCheckboxValuesForDetails(false, detailsUnselected);
|
||||
Assert.assertTrue(leaderboardSettingsPanel.getCheckboxValue("R1CheckBox"));
|
||||
Assert.assertTrue(leaderboardSettingsPanel.getCheckboxValue("R2CheckBox"));
|
||||
Assert.assertTrue(leaderboardSettingsPanel.getCheckboxValue("R3CheckBox"));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user