Files
azuredatastudio/test/automation/src/problems.ts
Karl Burtram ce612a3d96 Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79 (#14050)
* Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79

* Fix breaks

* Extension management fixes

* Fix breaks in windows bundling

* Fix/skip failing tests

* Update distro

* Add clear to nuget.config

* Add hygiene task

* Bump distro

* Fix hygiene issue

* Add build to hygiene exclusion

* Update distro

* Update hygiene

* Hygiene exclusions

* Update tsconfig

* Bump distro for server breaks

* Update build config

* Update darwin path

* Add done calls to notebook tests

* Skip failing tests

* Disable smoke tests
2021-02-09 16:15:05 -08:00

44 lines
1.6 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from './code';
import { QuickAccess } from './quickaccess';
export const enum ProblemSeverity {
WARNING = 0,
ERROR = 1
}
export class Problems {
static PROBLEMS_VIEW_SELECTOR = '.panel .markers-panel';
constructor(private code: Code, private quickAccess: QuickAccess) { }
public async showProblemsView(): Promise<any> {
await this.quickAccess.runCommand('workbench.panel.markers.view.focus');
await this.waitForProblemsView();
}
public async hideProblemsView(): Promise<any> {
await this.quickAccess.runCommand('workbench.actions.view.problems');
await this.code.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR, el => !el);
}
public async waitForProblemsView(): Promise<void> {
await this.code.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR);
}
public static getSelectorInProblemsView(problemType: ProblemSeverity): string {
let selector = problemType === ProblemSeverity.WARNING ? 'codicon-warning' : 'codicon-error';
return `div[id="workbench.panel.markers"] .monaco-tl-contents .marker-icon.${selector}`;
}
public static getSelectorInEditor(problemType: ProblemSeverity): string {
let selector = problemType === ProblemSeverity.WARNING ? 'squiggly-warning' : 'squiggly-error';
return `.view-overlays .cdr.${selector}`;
}
}