diff --git a/test/smoke/src/areas/common.ts b/test/smoke/src/areas/common.ts index 96515d7ca49f53288b8c9a6f28f4b8ded71d6b49..aaf753bbfda3467a1863546eb828ba938876b447 100644 --- a/test/smoke/src/areas/common.ts +++ b/test/smoke/src/areas/common.ts @@ -45,7 +45,7 @@ export class CommonActions { } public async getTab(tabName: string, active?: boolean): Promise { - 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 { + public async selectTab(tabName: string): Promise { + 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 { + return this.spectron.command('workbench.action.closeMessages'); + } } \ No newline at end of file