Update the "DialogWindow.waitDialog" method (#16831)

Update the "DialogWindow.waitDialog" method 

Signed-off-by: Ihor Okhrimenko <iokhrime@redhat.com>
7.20.x
Igor Ohrimenko 2020-05-04 19:31:08 +03:00 committed by GitHub
parent dcf67014c7
commit 3a31ab8f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 8 deletions

View File

@ -53,19 +53,19 @@ commands:
actions:
- type: exec
component: maven-container
command: java -jar spring-petclinic-2.2.0.BUILD-SNAPSHOT.jar --spring.profiles.active=mysql
command: java -jar spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar --spring.profiles.active=mysql
workdir: /projects/petclinic/target
- name: run-with-changes
actions:
- type: exec
component: maven-container
command: java -jar spring-petclinic-2.2.0.BUILD-SNAPSHOT.jar --spring.profiles.active=mysql
command: java -jar spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar --spring.profiles.active=mysql
workdir: /projects/petclinic/target
- name: run-debug
actions:
- type: exec
component: maven-container
command: java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 spring-petclinic-2.2.0.BUILD-SNAPSHOT.jar --spring.profiles.active=mysql
command: java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar --spring.profiles.active=mysql
workdir: /projects/petclinic/target
- name: Debug remote java application
actions:

View File

@ -60,13 +60,13 @@ export class DialogWindow {
await this.clickToButton('Open Link');
}
async waitDialog(timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT, dialogTest: string = '') {
async waitDialog(timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT, dialogText: string = '') {
Logger.debug('DialogWindow.waitDialog');
// if dialog text is provided uses xpath with this text
// if not uses window body xpath
const dialogWithTextXpathLocator: string = `${DialogWindow.DIALOG_BODY_XPATH_LOCATOR}//pre[contains(text(), '${dialogTest}')]`;
const dialogXpathLocator: string = (dialogTest ? dialogWithTextXpathLocator : DialogWindow.DIALOG_BODY_XPATH_LOCATOR);
const dialogWithTextXpathLocator: string = `${DialogWindow.DIALOG_BODY_XPATH_LOCATOR}//*[contains(text(), '${dialogText}')]`;
const dialogXpathLocator: string = (dialogText ? dialogWithTextXpathLocator : DialogWindow.DIALOG_BODY_XPATH_LOCATOR);
await this.driverHelper.waitVisibility(By.xpath(dialogXpathLocator), timeout);
}

View File

@ -58,8 +58,7 @@ const SpringAppLocators = {
springMenuButtonLocator: By.css('button[data-target=\'#main-navbar\']'),
springErrorButtonLocator: By.xpath('//div[@id=\'main-navbar\']//span[text()=\'Error\']'),
springHomeButtonLocator: By.className('navbar-brand'),
springErrorMessageLocator: By.xpath('//p[text()=\'Expected: controller used to ' +
`showcase what happens when an exception is thrown${textForErrorMessageChange}\']`)
springErrorMessageLocator: By.xpath(`//h2[text()='Something happened...']`)
};