Skip to content

Commit

Permalink
[TS SELENIUM] Fix the #13865 issue (Happy Path test is sometimes fail…
Browse files Browse the repository at this point in the history
…ing on "Error highlighting" step) (#13987)
  • Loading branch information
Ohrimenko1988 authored Jul 24, 2019
1 parent e598e22 commit a35bd99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions e2e/pageobjects/ide/Ide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/e2e_happy_path/HappyPath.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down

0 comments on commit a35bd99

Please sign in to comment.