Skip to content

Commit

Permalink
Fixing error messages (#19252)
Browse files Browse the repository at this point in the history
* Fixing error messages

* Applying review
  • Loading branch information
Katka92 authored Mar 10, 2021
1 parent 5922a08 commit 5edc91e
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions tests/e2e/pageobjects/ide/Ide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@ export class Ide {
Logger.warn('StaleElementException occured during waiting for IDE. Sleeping for 2 secs and retrying.');
this.driverHelper.wait(2000);
await this.driverHelper.waitAndSwitchToFrame(By.css(Ide.IDE_IFRAME_CSS), timeout);
} else {
return;
}

if (err instanceof error.TimeoutError) {
Logger.error(`Switching to IDE frame failed after ${timeout} timeout.`)
throw err;
}
}

Logger.error(`Switching to IDE frame failed.`)
throw err;
}
}

Expand All @@ -74,11 +80,11 @@ export class Ide {
await this.driverHelper.waitVisibility(exitCodeNotificationLocator, timeout);
} catch (err) {
if (err instanceof error.TimeoutError) {
Logger.error(`Ide.waitTaskExitCodeNotificationBoolean wait for notification timed out.`);
} else {
Logger.error(`Waiting for task notification failed after ${timeout} timeout.`)
Logger.error(`Ide.waitTaskExitCodeNotificationBoolean wait for notification timed out after ${timeout}.`);
throw err;
}
Logger.error(`Waiting for task notification failed.`)
throw err;
}
Logger.info(`Ide.waitTaskExitCodeNotification checking for correct exit core:${exitCode}`);
return await this.driverHelper.waitVisibilityBoolean(notificationLocator, 1, 1000);
Expand Down Expand Up @@ -165,8 +171,15 @@ export class Ide {
} catch (err) {
if (err instanceof error.NoSuchWindowError) {
await this.driverHelper.waitVisibility(idePartLocator, timeout);
return;
}

if (err instanceof error.TimeoutError) {
Logger.error(`Waiting for ${idePartLocator} timeouted after ${timeout} timeout.`)
throw err;
}
Logger.error(`Waiting for ${idePartLocator} timeouted after ${timeout} timeout.`)

Logger.error(`Waiting for ${idePartLocator} failed.`)
throw err;
}
}
Expand Down

0 comments on commit 5edc91e

Please sign in to comment.