Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS SELENIUM] Fix the #13865 issue (Happy Path test is sometimes failing on "Error highlighting" step) #13987

Merged
merged 7 commits into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't Ctrl+Backspace be nicer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about the stability of this approach (key combinations)

await editor.waitErrorInLineDisappearance(30);
});

Expand Down