mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-19 03:21:36 -04:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
53
test/smoke/src/areas/problems/problems.ts
Normal file
53
test/smoke/src/areas/problems/problems.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { SpectronApplication } from '../../spectron/application';
|
||||
|
||||
export enum ProblemSeverity {
|
||||
WARNING = 0,
|
||||
ERROR = 1
|
||||
};
|
||||
|
||||
export class Problems {
|
||||
|
||||
static PROBLEMS_VIEW_SELECTOR = '.panel.markers-panel';
|
||||
|
||||
constructor(private spectron: SpectronApplication) {
|
||||
// noop
|
||||
}
|
||||
|
||||
public async showProblemsView(): Promise<any> {
|
||||
if (!await this.isVisible()) {
|
||||
await this.spectron.runCommand('workbench.actions.view.problems');
|
||||
await this.waitForProblemsView();
|
||||
}
|
||||
}
|
||||
|
||||
public async hideProblemsView(): Promise<any> {
|
||||
if (await this.isVisible()) {
|
||||
await this.spectron.runCommand('workbench.actions.view.problems');
|
||||
await this.spectron.client.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR, el => !el);
|
||||
}
|
||||
}
|
||||
|
||||
public async isVisible(): Promise<boolean> {
|
||||
const element = await this.spectron.client.element(Problems.PROBLEMS_VIEW_SELECTOR);
|
||||
return !!element;
|
||||
}
|
||||
|
||||
public async waitForProblemsView(): Promise<void> {
|
||||
await this.spectron.client.waitForElement(Problems.PROBLEMS_VIEW_SELECTOR);
|
||||
}
|
||||
|
||||
public static getSelectorInProblemsView(problemType: ProblemSeverity): string {
|
||||
let selector = problemType === ProblemSeverity.WARNING ? 'warning' : 'error';
|
||||
return `div[aria-label="Problems grouped by files"] .icon.${selector}`;
|
||||
}
|
||||
|
||||
public static getSelectorInEditor(problemType: ProblemSeverity): string {
|
||||
let selector = problemType === ProblemSeverity.WARNING ? 'warningsquiggly' : 'errorsquiggly';
|
||||
return `.view-overlays .cdr.${selector}`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user