Skip to content

Commit

Permalink
Add web worker extension test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 committed Sep 4, 2021
1 parent 9e8b013 commit 8b6e403
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
12 changes: 9 additions & 3 deletions resources/server/web.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env sh
ROOT=$(dirname $(dirname "$(dirname "$0")"))
#!/usr/bin/env bash

if [[ "$OSTYPE" == "darwin"* ]]; then
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
ROOT=$(dirname $(dirname $(dirname $(realpath "$0"))))
else
ROOT=$(dirname $(dirname $(dirname $(readlink -f $0))))
fi

SERVER_SCRIPT="$ROOT/out/server.js"
node "$SERVER_SCRIPT" "$@"
exec /usr/bin/env node "$SERVER_SCRIPT" "$@"
6 changes: 6 additions & 0 deletions test/automation/src/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export class Extensions extends Viewlet {
async searchForExtension(id: string): Promise<any> {
await this.code.waitAndClick(SEARCH_BOX);
await this.code.waitForActiveElement(SEARCH_BOX);
if (process.platform === 'darwin') {
await this.code.dispatchKeybinding('cmd+a');
} else {
await this.code.dispatchKeybinding('ctrl+a');
}
await this.code.dispatchKeybinding('delete');
await this.code.waitForTypeInEditor(SEARCH_BOX, `@id:${id}`);
await this.code.waitForElement(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[data-extension-id="${id}"]`);
}
Expand Down
3 changes: 2 additions & 1 deletion test/automation/src/playwrightDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const vscodeToPlaywrightKey: { [key: string]: string } = {
down: 'ArrowDown',
left: 'ArrowLeft',
home: 'Home',
esc: 'Escape'
esc: 'Escape',
delete: 'Delete'
};

let traceCounter = 1;
Expand Down
23 changes: 20 additions & 3 deletions test/smoke/src/areas/extensions/extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export function setup(opts: minimist.ParsedArgs) {
it(`install and enable vscode-smoketest-check extension`, async function () {
const app = this.app as Application;

if (app.quality === Quality.Dev) {
this.skip();
}
// if (app.quality === Quality.Dev) {
// this.skip();
// }

await app.workbench.extensions.openExtensionsViewlet();

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

it(`install and enable smoketest-check-web extension in web worker`, async function () {
const app = this.app as Application;

// if (app.quality === Quality.Dev) {
// this.skip();
// }

await app.workbench.extensions.openExtensionsViewlet();

await app.workbench.extensions.installExtension('jeanp413.smoketest-check-web', true);

// Close extension editor because keybindings dispatch is not working when web views are opened and focused
// https://github.com/microsoft/vscode/issues/110276
await app.workbench.extensions.closeExtension('smoketest-check-web');

await app.workbench.quickaccess.runCommand('Smoke Test Check Web');
});
});
}

0 comments on commit 8b6e403

Please sign in to comment.