Update the "DialogWindow.waitDialog" method (#16831)
Update the "DialogWindow.waitDialog" method Signed-off-by: Ihor Okhrimenko <iokhrime@redhat.com>7.20.x
parent
dcf67014c7
commit
3a31ab8f59
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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...']`)
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue