Skip to content

Commit cbf8c36

Browse files
committed
Add explorer and terminal smoke tests
1 parent 84ef06f commit cbf8c36

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
@@ -81,10 +81,7 @@ function buildDriver(browser: playwright.Browser, context: playwright.BrowserCon
8181
await page.mouse.click(x + (xoffset ? xoffset : 0), y + (yoffset ? yoffset : 0));
8282
},
8383
doubleClick: async (windowId, selector) => {
84-
await driver.click(windowId, selector, 0, 0);
85-
await timeout(60);
86-
await driver.click(windowId, selector, 0, 0);
87-
await timeout(100);
84+
await page.dblclick(selector, { delay: 70 });
8885
},
8986
setValue: async (windowId, selector, text) => page.evaluate(`window.driver.setValue('${selector}', '${text}')`).then(undefined),
9087
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
@@ -27,6 +27,8 @@ import { setup as setupDataExtensionTests } from './areas/extensions/extensions.
2727
import { setup as setupDataMultirootTests } from './areas/multiroot/multiroot.test';
2828
import { setup as setupDataLocalizationTests } from './areas/workbench/localization.test';
2929
import { setup as setupLaunchTests } from './areas/workbench/launch.test';
30+
import { setup as setupDataExplorerTests } from './areas/explorer/explorer.test';
31+
import { setup as setupDataTerminalTests } from './areas/terminal/terminal.test';
3032

3133
const testDataPath = path.join(os.tmpdir(), 'vscsmoke');
3234
if (fs.existsSync(testDataPath)) {
@@ -343,12 +345,14 @@ if (!opts.web && opts['build'] && !opts['remote']) {
343345
describe(`VSCode Smoke Tests (${opts.web ? 'Web' : 'Electron'})`, () => {
344346
if (!opts.web) { setupDataLossTests(opts); }
345347
if (!opts.web) { setupDataPreferencesTests(opts); }
348+
setupDataExplorerTests(opts);
346349
setupDataSearchTests(opts);
347350
setupDataNotebookTests(opts);
348351
setupDataLanguagesTests(opts);
349352
setupDataEditorTests(opts);
350353
setupDataStatusbarTests(opts);
351354
setupDataExtensionTests(opts);
355+
setupDataTerminalTests(opts);
352356
if (!opts.web) { setupDataMultirootTests(opts); }
353357
if (!opts.web) { setupDataLocalizationTests(opts); }
354358
if (!opts.web) { setupLaunchTests(); }

0 commit comments

Comments
 (0)