mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-22 21:55:39 +00:00
fixed Selenium tests after modifying where error dialog shows which part of the messages
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
-->
|
||||
<system-property>
|
||||
<name>webdriver.chrome.driver</name>
|
||||
<value>C:\apps\ChromeSeleniumDriver\chromedriver.exe</value>
|
||||
<value>/usr/bin/chromedriver</value>
|
||||
<!-- value>~/Documents/chromedriver/chromedriver</value-->
|
||||
</system-property>
|
||||
<!--
|
||||
|
||||
+17
-1
@@ -12,6 +12,9 @@ public class ErrorDialogPO extends PageArea {
|
||||
@FindBy(how = BySeleniumId.class, using = "ErrorDialogTitle")
|
||||
private WebElement title;
|
||||
|
||||
@FindBy(how = BySeleniumId.class, using = "ErrorDialogServerResponse")
|
||||
private WebElement serverResponse;
|
||||
|
||||
@FindBy(how = BySeleniumId.class, using = "ErrorDialogCloseButton")
|
||||
private WebElement close;
|
||||
|
||||
@@ -22,14 +25,27 @@ public class ErrorDialogPO extends PageArea {
|
||||
public String getTitle() {
|
||||
return title.getText();
|
||||
}
|
||||
|
||||
public String getServerResponse() {
|
||||
return serverResponse.getText();
|
||||
}
|
||||
|
||||
public void assertTitleContainsTextAndClose(String titlePart) {
|
||||
final String titleText = getTitle();
|
||||
if (!titleText.contains(titlePart)) {
|
||||
throw new RuntimeException("The expected title '" + titlePart + "' does not math the actual title '"
|
||||
throw new RuntimeException("The expected title '" + titlePart + "' does not match the actual title '"
|
||||
+ titleText + "' in the error box.");
|
||||
}
|
||||
close.click();
|
||||
}
|
||||
|
||||
public void assertServerResponseContainsTextAndClose(String serverResponsePart) {
|
||||
final String serverResponseText = getServerResponse();
|
||||
if (!serverResponseText.contains(serverResponsePart)) {
|
||||
throw new RuntimeException("The expected server response '" + serverResponsePart + "' does not match the actual server response '"
|
||||
+ serverResponseText + "' in the error box.");
|
||||
}
|
||||
close.click();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -45,6 +45,6 @@ public class RoleDefinitionCreationAndUpdateDialogPO extends DataEntryDialogPO {
|
||||
|
||||
public void clickOkButtonAndExpectPermissionError() {
|
||||
clickOkButtonOrThrow();
|
||||
waitForPO(ErrorDialogPO::new, "ErrorDialog", 10).assertTitleContainsTextAndClose("Not permitted");
|
||||
waitForPO(ErrorDialogPO::new, "ErrorDialog", 10).assertServerResponseContainsTextAndClose("Not permitted");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ public class DefaultErrorReporter<S extends StringMessages> implements ErrorRepo
|
||||
dialogCloseButton.getElement().setAttribute(DebugConstants.DEBUG_ID_ATTRIBUTE, "ErrorDialogCloseButton"); //$NON-NLS-1$
|
||||
final Label textToServerLabel = new Label();
|
||||
serverResponseLabel = new HTML();
|
||||
serverResponseLabel.getElement().setAttribute(DebugConstants.DEBUG_ID_ATTRIBUTE, "ErrorDialogServerResponse");
|
||||
VerticalPanel dialogVPanel = new VerticalPanel();
|
||||
if (showCommunicationErrorText) {
|
||||
dialogVPanel.add(new HTML("<b>" + stringMessages.errorCommunicatingWithServer() + "</b>")); //$NON-NLS-1$
|
||||
|
||||
Reference in New Issue
Block a user