From 6a2535e0ab9734a7fd8b46776a859abea5c48186 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 28 Oct 2020 19:49:03 +0100 Subject: [PATCH] Fix #107965 --- test/automation/src/problems.ts | 15 ++++----------- test/automation/src/workbench.ts | 2 +- test/smoke/src/areas/languages/languages.test.ts | 5 ++--- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/test/automation/src/problems.ts b/test/automation/src/problems.ts index 2e20731f76b..c1d48e34ef3 100644 --- a/test/automation/src/problems.ts +++ b/test/automation/src/problems.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Code } from './code'; +import { QuickAccess } from './quickaccess'; export const enum ProblemSeverity { WARNING = 0, @@ -14,26 +15,18 @@ export class Problems { static PROBLEMS_VIEW_SELECTOR = '.panel .markers-panel'; - constructor(private code: Code) { } + constructor(private code: Code, private quickAccess: QuickAccess) { } public async showProblemsView(): Promise { - await this.toggleProblemsView(); + await this.quickAccess.runCommand('workbench.panel.markers.view.focus'); await this.waitForProblemsView(); } public async hideProblemsView(): Promise { - await this.toggleProblemsView(); + await this.quickAccess.runCommand('workbench.actions.view.problems'); await this.code.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR, el => !el); } - private async toggleProblemsView(): Promise { - if (process.platform === 'darwin') { - await this.code.dispatchKeybinding('cmd+shift+m'); - } else { - await this.code.dispatchKeybinding('ctrl+shift+m'); - } - } - public async waitForProblemsView(): Promise { await this.code.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR); } diff --git a/test/automation/src/workbench.ts b/test/automation/src/workbench.ts index 9b46d78f8fe..eaceaa7c09b 100644 --- a/test/automation/src/workbench.ts +++ b/test/automation/src/workbench.ts @@ -56,7 +56,7 @@ export class Workbench { this.scm = new SCM(code); this.debug = new Debug(code, this.quickaccess, this.editors, this.editor); this.statusbar = new StatusBar(code); - this.problems = new Problems(code); + this.problems = new Problems(code, this.quickaccess); this.settingsEditor = new SettingsEditor(code, userDataPath, this.editors, this.editor, this.quickaccess); this.keybindingsEditor = new KeybindingsEditor(code); this.terminal = new Terminal(code, this.quickaccess); diff --git a/test/smoke/src/areas/languages/languages.test.ts b/test/smoke/src/areas/languages/languages.test.ts index 6d7a7d1f039..ef1bf9455cf 100644 --- a/test/smoke/src/areas/languages/languages.test.ts +++ b/test/smoke/src/areas/languages/languages.test.ts @@ -34,10 +34,9 @@ export function setup() { await app.code.waitForElement(Problems.getSelectorInEditor(ProblemSeverity.ERROR)); - const problems = new Problems(app.code); - await problems.showProblemsView(); + await app.workbench.problems.showProblemsView(); await app.code.waitForElement(Problems.getSelectorInProblemsView(ProblemSeverity.ERROR)); - await problems.hideProblemsView(); + await app.workbench.problems.hideProblemsView(); }); }); }