Skip to content

Commit

Permalink
Update smoke test to Quick Input (#49340)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmarti committed May 9, 2018
1 parent 9bc399d commit c249ac2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
28 changes: 28 additions & 0 deletions test/smoke/src/areas/quickinput/quickinput.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { Code } from '../../vscode/code';

export class QuickInput {

static QUICK_INPUT = '.quick-input-widget';
static QUICK_INPUT_INPUT = `${QuickInput.QUICK_INPUT} .quick-input-box input`;
static QUICK_INPUT_FOCUSED_ELEMENT = `${QuickInput.QUICK_INPUT} .quick-open-tree .monaco-tree-row.focused .monaco-highlighted-label`;

constructor(private code: Code) { }

async closeQuickInput(): Promise<void> {
await this.code.dispatchKeybinding('escape');
await this.waitForQuickInputClosed();
}

async waitForQuickInputOpened(retryCount?: number): Promise<void> {
await this.code.waitForActiveElement(QuickInput.QUICK_INPUT_INPUT, retryCount);
}

private async waitForQuickInputClosed(): Promise<void> {
await this.code.waitForElement(QuickInput.QUICK_INPUT, r => !!r && r.attributes.style.indexOf('display: none;') !== -1);
}
}
4 changes: 2 additions & 2 deletions test/smoke/src/areas/statusbar/statusbar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export function setup() {
const app = this.app as Application;

await app.workbench.statusbar.clickOn(StatusBarElement.BRANCH_STATUS);
await app.workbench.quickopen.waitForQuickOpenOpened();
await app.workbench.quickopen.closeQuickOpen();
await app.workbench.quickinput.waitForQuickInputOpened();
await app.workbench.quickinput.closeQuickInput();

await app.workbench.quickopen.openFile('app.js');
await app.workbench.statusbar.clickOn(StatusBarElement.INDENTATION_STATUS);
Expand Down
3 changes: 3 additions & 0 deletions test/smoke/src/areas/workbench/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { Explorer } from '../explorer/explorer';
import { ActivityBar } from '../activitybar/activityBar';
import { QuickOpen } from '../quickopen/quickopen';
import { QuickInput } from '../quickinput/quickinput';
import { Extensions } from '../extensions/extensions';
import { Search } from '../search/search';
import { Editor } from '../editor/editor';
Expand All @@ -26,6 +27,7 @@ export interface Commands {
export class Workbench {

readonly quickopen: QuickOpen;
readonly quickinput: QuickInput;
readonly editors: Editors;
readonly explorer: Explorer;
readonly activitybar: ActivityBar;
Expand All @@ -43,6 +45,7 @@ export class Workbench {
constructor(code: Code, userDataPath: string) {
this.editors = new Editors(code);
this.quickopen = new QuickOpen(code, this.editors);
this.quickinput = new QuickInput(code);
this.explorer = new Explorer(code, this.editors);
this.activitybar = new ActivityBar(code);
this.search = new Search(code);
Expand Down

0 comments on commit c249ac2

Please sign in to comment.