diff --git a/e2e/pageobjects/ide/Ide.ts b/e2e/pageobjects/ide/Ide.ts index a3d5706c710..c460687ef9f 100644 --- a/e2e/pageobjects/ide/Ide.ts +++ b/e2e/pageobjects/ide/Ide.ts @@ -182,13 +182,16 @@ export class Ide { for (let i = 1; i <= notificationsCapacity; i++) { const notificationLocator: By = By.xpath('//div[@class=\'theia-Notification\']//button[text()=\'Close\']'); - const isElementVisible: boolean = await this.driverHelper.isVisible(notificationLocator); + try { + await this.driverHelper.waitAndClick(notificationLocator); + } catch (err) { + if (err instanceof error.TimeoutError) { + console.log(`The '${notificationLocator}' element is not visible and can't be clicked`); + continue; + } - if (!isElementVisible) { - continue; + throw err; } - - await this.driverHelper.waitAndClick(notificationLocator); } } diff --git a/e2e/tests/e2e_happy_path/HappyPath.spec.ts b/e2e/tests/e2e_happy_path/HappyPath.spec.ts index ead1fd97f88..c1e063fe213 100644 --- a/e2e/tests/e2e_happy_path/HappyPath.spec.ts +++ b/e2e/tests/e2e_happy_path/HappyPath.spec.ts @@ -118,9 +118,9 @@ suite('Language server validation', async () => { }); test('Error highlighting', async () => { - await editor.type(javaFileName, 'textForErrorHighlighting', 30); + await editor.type(javaFileName, 'error', 30); await editor.waitErrorInLine(30); - await editor.performKeyCombination(javaFileName, Key.chord(Key.CONTROL, 'z')); + await editor.performKeyCombination(javaFileName, Key.chord(Key.BACK_SPACE, Key.BACK_SPACE, Key.BACK_SPACE, Key.BACK_SPACE, Key.BACK_SPACE)); await editor.waitErrorInLineDisappearance(30); });