mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 01:25:38 -05:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
50
test/automation/src/problems.ts
Normal file
50
test/automation/src/problems.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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';
|
||||
|
||||
export const enum ProblemSeverity {
|
||||
WARNING = 0,
|
||||
ERROR = 1
|
||||
}
|
||||
|
||||
export class Problems {
|
||||
|
||||
static PROBLEMS_VIEW_SELECTOR = '.panel.markers-panel';
|
||||
|
||||
constructor(private code: Code) { }
|
||||
|
||||
public async showProblemsView(): Promise<any> {
|
||||
await this.toggleProblemsView();
|
||||
await this.waitForProblemsView();
|
||||
}
|
||||
|
||||
public async hideProblemsView(): Promise<any> {
|
||||
await this.toggleProblemsView();
|
||||
await this.code.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR, el => !el);
|
||||
}
|
||||
|
||||
private async toggleProblemsView(): Promise<void> {
|
||||
if (process.platform === 'darwin') {
|
||||
await this.code.dispatchKeybinding('cmd+shift+m');
|
||||
} else {
|
||||
await this.code.dispatchKeybinding('ctrl+shift+m');
|
||||
}
|
||||
}
|
||||
|
||||
public async waitForProblemsView(): Promise<void> {
|
||||
await this.code.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR);
|
||||
}
|
||||
|
||||
public static getSelectorInProblemsView(problemType: ProblemSeverity): string {
|
||||
let selector = problemType === ProblemSeverity.WARNING ? 'severity-warning' : 'severity-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}`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user