Skip to content

Commit

Permalink
[TS_SELENIUM] Resolve problem with notifications interaction (bug #13864
Browse files Browse the repository at this point in the history
) (#14019)


Signed-off-by: Ihor Okhrimenko <iokhrime@redhat.com>
  • Loading branch information
Ohrimenko1988 authored Jul 25, 2019
1 parent 1b4cc73 commit 0bebced
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions e2e/pageobjects/ide/Ide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,35 @@ export class Ide {
async waitNotificationAndConfirm(notificationText: string, timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT) {
await this.waitNotification(notificationText, timeout);
await this.clickOnNotificationButton(notificationText, 'yes');

try {
await this.waitNotificationDisappearance(notificationText);
} catch (err) {
if (err instanceof error.TimeoutError) {
await this.clickOnNotificationButton(notificationText, 'yes');
await this.waitNotificationDisappearance(notificationText);
return;
}

throw err;
}
}

async waitNotificationAndOpenLink(notificationText: string, timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT) {
await this.waitNotification(notificationText, timeout);
await this.clickOnNotificationButton(notificationText, 'Open Link');

try {
await this.waitNotificationDisappearance(notificationText);
} catch (err) {
if (err instanceof error.TimeoutError) {
await this.clickOnNotificationButton(notificationText, 'Open Link');
await this.waitNotificationDisappearance(notificationText);
return;
}

throw err;
}
}

async isNotificationPresent(notificationText: string): Promise<boolean> {
Expand Down

0 comments on commit 0bebced

Please sign in to comment.