From c1d3334fc2eb70b3dd61954561806a890b76ffc4 Mon Sep 17 00:00:00 2001 From: Michel Kaporin Date: Wed, 31 May 2017 09:35:07 +0200 Subject: [PATCH] Close any notifications before clicking on the tab. Fixes #27606. --- test/smoke/src/areas/common.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/smoke/src/areas/common.ts b/test/smoke/src/areas/common.ts index 96515d7ca49..aaf753bbfda 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