Skip to content

Commit b75d4b2

Browse files
committed
Add explorer and terminal smoke tests
1 parent 3e45b09 commit b75d4b2

File tree

8 files changed

+55
-15
lines changed

8 files changed

+55
-15
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"update-localization-extension": "node build/npm/update-localization-extension.js",
3737
"smoketest": "cd test/smoke && yarn compile && node test/index.js",
3838
"smoketest-no-compile": "cd test/smoke && node test/index.js",
39-
"smoketest-gitpod": "cd test/smoke && node test/index.js --web --verbose --test-repo /workspace/vscode-smoketest-express --headless --screenshots /workspace/screenshots --electronArgs=\"--disable-dev-shm-usage --use-gl=swiftshader\"",
4039
"download-builtin-extensions": "node build/lib/builtInExtensions.js",
4140
"download-builtin-extensions-cg": "node build/lib/builtInExtensionsCG.js",
4241
"monaco-compile-check": "tsc -p src/tsconfig.monaco.json --noEmit",

resources/server/web.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#!/usr/bin/env sh
22
ROOT=$(dirname $(dirname "$(dirname "$0")"))
33

4-
# APP_NAME="gitpodcode"
5-
# VERSION="1.59.1"
6-
# COMMIT="3866c3553be8b268c8a7f8c0482c0c0177aa8bfa"
7-
# EXEC_NAME="code"
8-
CLI_SCRIPT="$ROOT/out/server.js"
9-
#"node" "$CLI_SCRIPT" "$APP_NAME" "$VERSION" "$COMMIT" "$EXEC_NAME" "$@"
10-
"node" "$CLI_SCRIPT" "$@"
4+
SERVER_SCRIPT="$ROOT/out/server.js"
5+
node "$SERVER_SCRIPT" "$@"

src/vs/platform/driver/browser/baseDriver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ export abstract class BaseWindowDriver implements IWindowDriver {
140140

141141
const lines: string[] = [];
142142

143-
for (let i = 0; i < xterm.buffer.length; i++) {
144-
lines.push(xterm.buffer.getLine(i)!.translateToString(true));
143+
for (let i = 0; i < xterm.buffer.active.length; i++) {
144+
lines.push(xterm.buffer.active.getLine(i)!.translateToString(true));
145145
}
146146

147147
return lines;

test/automation/src/playwrightDriver.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ function buildDriver(browser: playwright.Browser, context: playwright.BrowserCon
7575
await page.mouse.click(x + (xoffset ? xoffset : 0), y + (yoffset ? yoffset : 0));
7676
},
7777
doubleClick: async (windowId, selector) => {
78-
await driver.click(windowId, selector, 0, 0);
79-
await timeout(60);
80-
await driver.click(windowId, selector, 0, 0);
81-
await timeout(100);
78+
await page.dblclick(selector, { delay: 70 });
8279
},
8380
setValue: async (windowId, selector, text) => page.evaluate(`window.driver.setValue('${selector}', '${text}')`).then(undefined),
8481
getTitle: (windowId) => page.evaluate(`window.driver.getTitle()`),

test/automation/src/terminal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { Code } from './code';
77
import { QuickAccess } from './quickaccess';
88

9-
const PANEL_SELECTOR = 'div[id="workbench.panel.terminal"]';
9+
const PANEL_SELECTOR = 'div[id="workbench.parts.panel"]';
1010
const XTERM_SELECTOR = `${PANEL_SELECTOR} .terminal-wrapper`;
1111
const XTERM_TEXTAREA = `${XTERM_SELECTOR} textarea.xterm-helper-textarea`;
1212

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import minimist = require('minimist');
7+
import { Application } from '../../../../automation';
8+
import { afterSuite, beforeSuite } from '../../utils';
9+
10+
export function setup(opts: minimist.ParsedArgs) {
11+
describe('Explorer', () => {
12+
beforeSuite(opts);
13+
14+
afterSuite(opts);
15+
16+
it('shows explorer and opens a file', async function () {
17+
const app = this.app as Application;
18+
await app.workbench.explorer.openExplorerView();
19+
await app.workbench.explorer.openFile('app.js');
20+
});
21+
});
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import minimist = require('minimist');
7+
import { Application } from '../../../../automation';
8+
import { afterSuite, beforeSuite } from '../../utils';
9+
10+
export function setup(opts: minimist.ParsedArgs) {
11+
describe('Terminal', () => {
12+
beforeSuite(opts);
13+
14+
afterSuite(opts);
15+
16+
it('shows terminal and runs command', async function () {
17+
const app = this.app as Application;
18+
await app.workbench.terminal.showTerminal();
19+
await app.workbench.terminal.runCommand('ls');
20+
await app.workbench.terminal.waitForTerminalText(lines => lines.some(l => l.includes('app.js')));
21+
});
22+
});
23+
}

test/smoke/src/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import { setup as setupDataExtensionTests } from './areas/extensions/extensions.
2828
import { setup as setupDataMultirootTests } from './areas/multiroot/multiroot.test';
2929
import { setup as setupDataLocalizationTests } from './areas/workbench/localization.test';
3030
import { setup as setupLaunchTests } from './areas/workbench/launch.test';
31+
import { setup as setupDataExplorerTests } from './areas/explorer/explorer.test';
32+
import { setup as setupDataTerminalTests } from './areas/terminal/terminal.test';
3133

3234
const tmpDir = tmp.dirSync({ name: 't' }) as { name: string; removeCallback: Function; };
3335
const testDataPath = tmpDir.name;
@@ -341,12 +343,14 @@ if (!opts.web && opts['build'] && !opts['remote']) {
341343
describe(`VSCode Smoke Tests (${opts.web ? 'Web' : 'Electron'})`, () => {
342344
if (!opts.web) { setupDataLossTests(opts); }
343345
if (!opts.web) { setupDataPreferencesTests(opts); }
346+
setupDataExplorerTests(opts);
344347
setupDataSearchTests(opts);
345348
setupDataNotebookTests(opts);
346349
setupDataLanguagesTests(opts);
347350
setupDataEditorTests(opts);
348351
setupDataStatusbarTests(opts);
349352
setupDataExtensionTests(opts);
353+
setupDataTerminalTests(opts);
350354
if (!opts.web) { setupDataMultirootTests(opts); }
351355
if (!opts.web) { setupDataLocalizationTests(opts); }
352356
if (!opts.web) { setupLaunchTests(); }

0 commit comments

Comments
 (0)