mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-19 04:05:36 +00:00
bug5905: Added next test of checking Race Manager App QR-Code generation.
This commit is contained in:
+1
@@ -57,6 +57,7 @@ public abstract class BaseQRIdentifierWidget implements IsWidget {
|
||||
error = new Label();
|
||||
error.setStyleName("errorLabel");
|
||||
url = new Label();
|
||||
url.ensureDebugId("QRIdentifierURL");
|
||||
VerticalPanel panel = new VerticalPanel();
|
||||
panel.add(inputGrid);
|
||||
panel.add(qrCodeComposite);
|
||||
|
||||
+2
@@ -111,6 +111,7 @@ public class DeviceConfigurationDetailComposite extends Composite {
|
||||
fillCourseAreaListBox(eventsById.get(selectedValue==null||selectedValue.isEmpty() ? null : UUID.fromString(selectedValue)));
|
||||
});
|
||||
captionPanel = new CaptionPanel(stringMessages.configuration());
|
||||
captionPanel.ensureDebugId("DeviceConfigurationDetailComposite");
|
||||
VerticalPanel verticalPanel = new VerticalPanel();
|
||||
contentPanel = new VerticalPanel();
|
||||
cloneButton = new Button(stringMessages.save() + " + " + stringMessages.clone());
|
||||
@@ -426,6 +427,7 @@ public class DeviceConfigurationDetailComposite extends Composite {
|
||||
|
||||
private Button createQrCodeButton() {
|
||||
Button qrCodeButton = new Button(stringMessages.qrSync());
|
||||
qrCodeButton.ensureDebugId("DeviceConfigurationDetailsQrCodeButton");
|
||||
qrCodeButton.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
+1
@@ -120,6 +120,7 @@ public class DeviceConfigurationListComposite extends Composite {
|
||||
CellTable<DeviceConfigurationWithSecurityDTO> table = new BaseCelltable<DeviceConfigurationWithSecurityDTO>(
|
||||
/* pageSize */10000, tableResource);
|
||||
configurationsDataProvider.addDataDisplay(table);
|
||||
table.ensureDebugId("DeviceConfigurationList");
|
||||
table.setWidth("100%");
|
||||
ListHandler<DeviceConfigurationWithSecurityDTO> columnSortHandler = new ListHandler<DeviceConfigurationWithSecurityDTO>(
|
||||
configurationsDataProvider.getList());
|
||||
|
||||
+1
@@ -79,6 +79,7 @@ public class DeviceConfigurationPanel extends SimplePanel implements DeviceConfi
|
||||
HorizontalPanel deviceManagementControlPanel = new HorizontalPanel();
|
||||
deviceManagementControlPanel.setSpacing(5);
|
||||
addConfigurationButton = new Button(stringMessages.addConfiguration());
|
||||
addConfigurationButton.ensureDebugId("addDeviceConfigurationButton");
|
||||
addConfigurationButton.addClickHandler(new ClickHandler() {
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
+1
@@ -90,6 +90,7 @@ public class DeviceConfigurationQRIdentifierDialog extends DialogBox {
|
||||
panel.add(widget);
|
||||
panel.add(actionPanel);
|
||||
setWidget(panel);
|
||||
this.ensureDebugId("DeviceConfigurationQRIdentifierDialog");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
@@ -42,8 +42,10 @@ public class SelectNameForNewDeviceConfigurationDialog extends DataEntryDialog<S
|
||||
Validator<String> validator, com.sap.sse.gwt.client.dialog.DataEntryDialog.DialogCallback<String> callback) {
|
||||
super(stringMessages.createDeviceConfiguration(), stringMessages.forWhichDeviceShouldConfigurationApply(),
|
||||
stringMessages.create(), stringMessages.cancel(), validator, callback);
|
||||
this.ensureDebugId("SelectNameForNewDeviceConfigurationDialog");
|
||||
this.stringMessages = stringMessages;
|
||||
this.identifierBox = createTextBox("");
|
||||
this.identifierBox.ensureDebugId("raceManagerDeviceName");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+8
@@ -22,6 +22,7 @@ import com.sap.sailing.selenium.pages.adminconsole.event.EventConfigurationPanel
|
||||
import com.sap.sailing.selenium.pages.adminconsole.igtimi.IgtimiAccountsManagementPanelPO;
|
||||
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.racemanagementapp.RaceManagementAppPanelPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaStructureManagementPanelPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.roles.RoleDefinitionsPanelPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.tracking.TrackedRacesBoatsPanelPO;
|
||||
@@ -49,6 +50,9 @@ public class AdminConsolePage extends HostPageWithAuthentication {
|
||||
private static final String EVENTS_TAB_LABEL = "Events"; //$NON-NLS-1$
|
||||
private static final String EVENTS_TAB_IDENTIFIER = "EventManagement"; //$NON-NLS-1$
|
||||
|
||||
private static final String RACE_MANAGER_APP_TAB_LABEL = "Race Manager App"; //$NON-NLS-1$
|
||||
private static final String RACE_MANAGER_APP_TAB_IDENTIFIER = "RaceCommiteeAppPanel"; //$NON-NLS-1$
|
||||
|
||||
private static final String REGATTA_STRUCTURE_TAB_LABEL = "Regattas"; //$NON-NLS-1$
|
||||
private static final String REGATTA_STRUCTURE_TAB_IDENTIFIER = "RegattaStructureManagement"; //$NON-NLS-1$
|
||||
|
||||
@@ -160,6 +164,10 @@ public class AdminConsolePage extends HostPageWithAuthentication {
|
||||
return new EventConfigurationPanelPO(this.driver, goToTab(EVENTS_TAB_LABEL, EVENTS_TAB_IDENTIFIER, true));
|
||||
}
|
||||
|
||||
public RaceManagementAppPanelPO goToRaceManagerApp() {
|
||||
return new RaceManagementAppPanelPO(this.driver, goToTab(RACE_MANAGER_APP_TAB_LABEL, RACE_MANAGER_APP_TAB_IDENTIFIER, true));
|
||||
}
|
||||
|
||||
public UserManagementPanelPO goToUserManagement() {
|
||||
goToTab(ADVANCED_PARENT_LABEL, ADVANCED_TAB_PARENT_IDENTIFIER, true);
|
||||
return new UserManagementPanelPO(this.driver,
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.sap.sailing.selenium.pages.adminconsole.racemanagementapp;
|
||||
|
||||
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.DataEntryDialogPO;
|
||||
|
||||
public class DeviceConfigurationCreateDialogPO extends DataEntryDialogPO {
|
||||
|
||||
@FindBy(how = BySeleniumId.class, using = "raceManagerDeviceName")
|
||||
private WebElement nameField;
|
||||
|
||||
protected DeviceConfigurationCreateDialogPO(WebDriver driver, WebElement element) {
|
||||
super(driver, element);
|
||||
}
|
||||
|
||||
public void setDeviceName(String name) {
|
||||
nameField.sendKeys(name);
|
||||
}
|
||||
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.sap.sailing.selenium.pages.adminconsole.racemanagementapp;
|
||||
|
||||
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.PageArea;
|
||||
|
||||
public class DeviceConfigurationDetailsAreaPO extends PageArea {
|
||||
|
||||
public static final String DEVICE_CONFIGURATION_QR_CODE_DIALOG_ID = "DeviceConfigurationQRIdentifierDialog";
|
||||
|
||||
@FindBy(how = BySeleniumId.class, using = "DeviceConfigurationDetailsQrCodeButton")
|
||||
private WebElement deviceConfigurationDetailsQrCodeButton;
|
||||
|
||||
public DeviceConfigurationDetailsAreaPO(WebDriver driver, WebElement element) {
|
||||
super(driver, element);
|
||||
}
|
||||
|
||||
public DeviceConfigurationQRCodeDialogPO openQRCodeDialog() {
|
||||
deviceConfigurationDetailsQrCodeButton.click();
|
||||
return getPO(DeviceConfigurationQRCodeDialogPO::new, DEVICE_CONFIGURATION_QR_CODE_DIALOG_ID);
|
||||
}
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.sap.sailing.selenium.pages.adminconsole.racemanagementapp;
|
||||
|
||||
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.DataEntryDialogPO;
|
||||
|
||||
public class DeviceConfigurationQRCodeDialogPO extends DataEntryDialogPO {
|
||||
|
||||
@FindBy(how = BySeleniumId.class, using = "QRIdentifierURL")
|
||||
private WebElement url;
|
||||
|
||||
protected DeviceConfigurationQRCodeDialogPO(WebDriver driver, WebElement element) {
|
||||
super(driver, element);
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url.getText();
|
||||
}
|
||||
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.sap.sailing.selenium.pages.adminconsole.racemanagementapp;
|
||||
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
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 DeviceConfigurationsTablePO extends GenericCellTablePO<DeviceConfigurationsTablePO.DeviceConfigurationEntryPO> {
|
||||
|
||||
public static class DeviceConfigurationEntryPO extends DataEntryPO {
|
||||
|
||||
public DeviceConfigurationEntryPO(CellTablePO<?> table, WebElement element) {
|
||||
super(table, element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getIdentifier() {
|
||||
return getColumnContent("Device");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public DeviceConfigurationsTablePO(WebDriver driver, WebElement element) {
|
||||
super(driver, element, DeviceConfigurationEntryPO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DeviceConfigurationEntryPO createDataEntry(WebElement element) {
|
||||
return new DeviceConfigurationEntryPO(this, element);
|
||||
}
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.sap.sailing.selenium.pages.adminconsole.racemanagementapp;
|
||||
|
||||
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.PageArea;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.racemanagementapp.DeviceConfigurationsTablePO.DeviceConfigurationEntryPO;
|
||||
import com.sap.sailing.selenium.pages.gwt.CellTablePO;
|
||||
import com.sap.sailing.selenium.pages.gwt.GenericCellTablePO;
|
||||
|
||||
public class RaceManagementAppPanelPO extends PageArea {
|
||||
|
||||
private static final String DEVICE_CONGIGURATION_DETAILS_AREA_ID = "DeviceConfigurationDetailComposite";
|
||||
private static final String NEW_DEVICE_CONFIGURATION_DIALOG_ID = "SelectNameForNewDeviceConfigurationDialog";
|
||||
|
||||
@FindBy(how = BySeleniumId.class, using = "addDeviceConfigurationButton")
|
||||
private WebElement addDeviceConfigurationButton;
|
||||
|
||||
@FindBy(how = BySeleniumId.class, using = "DeviceConfigurationList")
|
||||
private WebElement deviceConfigurationListTable;
|
||||
|
||||
public RaceManagementAppPanelPO(WebDriver driver, WebElement element) {
|
||||
super(driver, element);
|
||||
}
|
||||
|
||||
public DeviceConfigurationCreateDialogPO createDeviceConfiguration() {
|
||||
addDeviceConfigurationButton.click();
|
||||
return getPO(DeviceConfigurationCreateDialogPO::new, NEW_DEVICE_CONFIGURATION_DIALOG_ID);
|
||||
}
|
||||
|
||||
public DeviceConfigurationDetailsAreaPO getDeviceConfigurationDetails() {
|
||||
DeviceConfigurationEntryPO deviceConfiguration = getLeaderboardTable().getEntries().get(0);
|
||||
deviceConfiguration.select();
|
||||
return getPO(DeviceConfigurationDetailsAreaPO::new, DEVICE_CONGIGURATION_DETAILS_AREA_ID);
|
||||
}
|
||||
|
||||
|
||||
public CellTablePO<DeviceConfigurationEntryPO> getLeaderboardTable() {
|
||||
return new GenericCellTablePO<>(this.driver, this.deviceConfigurationListTable, DeviceConfigurationEntryPO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+32
-3
@@ -4,6 +4,9 @@ import java.util.Date;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.MatcherAssert;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -16,6 +19,10 @@ import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
|
||||
import com.sap.sailing.selenium.pages.adminconsole.AdminConsolePage;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.event.EventConfigurationPanelPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.racemanagementapp.DeviceConfigurationCreateDialogPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.racemanagementapp.DeviceConfigurationDetailsAreaPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.racemanagementapp.DeviceConfigurationQRCodeDialogPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.racemanagementapp.RaceManagementAppPanelPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaDetailsCompositePO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaEditDialogPO;
|
||||
import com.sap.sailing.selenium.pages.adminconsole.regatta.RegattaListCompositePO.RegattaDescriptor;
|
||||
@@ -29,6 +36,7 @@ import com.sap.sailing.selenium.test.AbstractSeleniumTest;
|
||||
*/
|
||||
public class TestLinkCreation extends AbstractSeleniumTest {
|
||||
|
||||
private static final String DEVICE_CONFIG_NAME = "Test";
|
||||
private static final String BMW_CUP_EVENT = "BMW Cup";
|
||||
private static final String BMW_CUP_BOAT_CLASS = "J80";
|
||||
private static final String AUDI_CUP_BOAT_CLASS = "J70";
|
||||
@@ -46,6 +54,11 @@ public class TestLinkCreation extends AbstractSeleniumTest {
|
||||
private static final String EXPECTED_QR_CODE_TITLE = "Welcome to the public regatta Audi Business Cup (J70) (J70)!";
|
||||
private static final String EXPECTED_QR_CODE_LINK_TEXT = "Please scan this QR Code with your mobile device to proceed with the registration";
|
||||
|
||||
private static final String CHECK_RACE_APP_URL_REGEX = "^https:\\/\\/racemanager-app.sapsailing.com\\/invite\\"
|
||||
+ "?server_url=http:\\/\\/localhost(:\\d{0,5})?"
|
||||
+ "&device_config_identifier=" + DEVICE_CONFIG_NAME
|
||||
+ "&device_config_uuid=(\\w|\\d|-)*";
|
||||
|
||||
@Override
|
||||
@Before
|
||||
public void setUp() {
|
||||
@@ -56,9 +69,9 @@ public class TestLinkCreation extends AbstractSeleniumTest {
|
||||
/**
|
||||
* Test the creation of an invitation link.
|
||||
* <p>
|
||||
* Please notice, that the test checks the created invitation link by calling it and checking over the
|
||||
* redirects from branch.io over production environment (my.sapsailing.com) back to localhost. The link back
|
||||
* to localhost need an additional confirmation on production server.
|
||||
* Please notice, that the test checks the created invitation link by calling it and checking over the redirects
|
||||
* from branch.io over production environment (my.sapsailing.com) back to localhost. The link back to localhost need
|
||||
* an additional confirmation on production server.
|
||||
*/
|
||||
@Test
|
||||
public void testRegattaOverviewInvitationLinkCreation() {
|
||||
@@ -101,4 +114,20 @@ public class TestLinkCreation extends AbstractSeleniumTest {
|
||||
Assert.assertTrue(qrCodeLink.getAttribute("href").contains("secret=" + secret));
|
||||
Assert.assertTrue(qrCodeLink.getAttribute("href").contains("server=http%3A%2F%2Flocalhost%3A"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Testing the generation of an invitation QR code for the Race Manager App.
|
||||
*/
|
||||
@Test
|
||||
public void testRaceManagerAppInvitationLink() {
|
||||
AdminConsolePage adminConsole = AdminConsolePage.goToPage(getWebDriver(), getContextRoot());
|
||||
RaceManagementAppPanelPO raceManagerApp = adminConsole.goToRaceManagerApp();
|
||||
DeviceConfigurationCreateDialogPO createDeviceConfiguration = raceManagerApp.createDeviceConfiguration();
|
||||
createDeviceConfiguration.setDeviceName(DEVICE_CONFIG_NAME);
|
||||
createDeviceConfiguration.clickOkButtonOrThrow();
|
||||
DeviceConfigurationDetailsAreaPO deviceConfigurationDetails = raceManagerApp.getDeviceConfigurationDetails();
|
||||
DeviceConfigurationQRCodeDialogPO qrCodeDialog = deviceConfigurationDetails.openQRCodeDialog();
|
||||
Matcher<String> matcher = Matchers.matchesRegex(CHECK_RACE_APP_URL_REGEX);
|
||||
MatcherAssert.assertThat("Check URL", matcher.matches(qrCodeDialog.getUrl()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user