Close any notifications before clicking on the tab. Fixes #27606.

This commit is contained in:
Michel Kaporin 2017-05-31 09:35:07 +02:00
parent 26d85e8ac7
commit c1d3334fc2

View file

@ -45,7 +45,7 @@ export class CommonActions {
}
public async getTab(tabName: string, active?: boolean): Promise<any> {
await this.spectron.command('workbench.action.closeMessages'); // close any notification messages that could overlap tabs
await this.closeCurrentNotification(); // close any notification messages that could overlap tabs
let tabSelector = active ? '.tab.active' : 'div';
let el = await this.spectron.client.element(`.tabs-container ${tabSelector}[aria-label="${tabName}, tab"]`);
@ -56,7 +56,8 @@ export class CommonActions {
return undefined;
}
public selectTab(tabName: string): Promise<any> {
public async selectTab(tabName: string): Promise<any> {
await this.closeCurrentNotification(); // close any notification messages that could overlap tabs
return this.spectron.client.click(`.tabs-container div[aria-label="${tabName}, tab"]`);
}
@ -162,4 +163,8 @@ export class CommonActions {
throw new Error(`Failed to remove ${directory} with an error: ${e}`);
}
}
private closeCurrentNotification(): Promise<any> {
return this.spectron.command('workbench.action.closeMessages');
}
}