Skip to content

Commit 8b6e403

Browse files
committed
Add web worker extension test
1 parent 9e8b013 commit 8b6e403

File tree

4 files changed

+37
-7
lines changed

4 files changed

+37
-7
lines changed

resources/server/web.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
#!/usr/bin/env sh
2-
ROOT=$(dirname $(dirname "$(dirname "$0")"))
1+
#!/usr/bin/env bash
2+
3+
if [[ "$OSTYPE" == "darwin"* ]]; then
4+
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
5+
ROOT=$(dirname $(dirname $(dirname $(realpath "$0"))))
6+
else
7+
ROOT=$(dirname $(dirname $(dirname $(readlink -f $0))))
8+
fi
39

410
SERVER_SCRIPT="$ROOT/out/server.js"
5-
node "$SERVER_SCRIPT" "$@"
11+
exec /usr/bin/env node "$SERVER_SCRIPT" "$@"

test/automation/src/extensions.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ export class Extensions extends Viewlet {
2727
async searchForExtension(id: string): Promise<any> {
2828
await this.code.waitAndClick(SEARCH_BOX);
2929
await this.code.waitForActiveElement(SEARCH_BOX);
30+
if (process.platform === 'darwin') {
31+
await this.code.dispatchKeybinding('cmd+a');
32+
} else {
33+
await this.code.dispatchKeybinding('ctrl+a');
34+
}
35+
await this.code.dispatchKeybinding('delete');
3036
await this.code.waitForTypeInEditor(SEARCH_BOX, `@id:${id}`);
3137
await this.code.waitForElement(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[data-extension-id="${id}"]`);
3238
}

test/automation/src/playwrightDriver.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ const vscodeToPlaywrightKey: { [key: string]: string } = {
2929
down: 'ArrowDown',
3030
left: 'ArrowLeft',
3131
home: 'Home',
32-
esc: 'Escape'
32+
esc: 'Escape',
33+
delete: 'Delete'
3334
};
3435

3536
let traceCounter = 1;

test/smoke/src/areas/extensions/extensions.test.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export function setup(opts: minimist.ParsedArgs) {
1515
it(`install and enable vscode-smoketest-check extension`, async function () {
1616
const app = this.app as Application;
1717

18-
if (app.quality === Quality.Dev) {
19-
this.skip();
20-
}
18+
// if (app.quality === Quality.Dev) {
19+
// this.skip();
20+
// }
2121

2222
await app.workbench.extensions.openExtensionsViewlet();
2323

@@ -30,5 +30,22 @@ export function setup(opts: minimist.ParsedArgs) {
3030
await app.workbench.quickaccess.runCommand('Smoke Test Check');
3131
});
3232

33+
it(`install and enable smoketest-check-web extension in web worker`, async function () {
34+
const app = this.app as Application;
35+
36+
// if (app.quality === Quality.Dev) {
37+
// this.skip();
38+
// }
39+
40+
await app.workbench.extensions.openExtensionsViewlet();
41+
42+
await app.workbench.extensions.installExtension('jeanp413.smoketest-check-web', true);
43+
44+
// Close extension editor because keybindings dispatch is not working when web views are opened and focused
45+
// https://github.com/microsoft/vscode/issues/110276
46+
await app.workbench.extensions.closeExtension('smoketest-check-web');
47+
48+
await app.workbench.quickaccess.runCommand('Smoke Test Check Web');
49+
});
3350
});
3451
}

0 commit comments

Comments
 (0)