vscode/test/integration/browser
Matt Bierner 17c75e1180
Allow reusing webview origins across reloads (#149950)
* Allow reusing webview origins across reloads

Currently webviews are always loaded into a unique origin. This keeps them isolated but also means that we can't benefit from caching across window reloads

This change adds a new `origin` option that you can pass to webviews which controls the origin they use. If this origin is not provided, we use a random one instead

We then save off this origin for webview panels and restore it on window reloads. Webviews restore a little faster on window reload

* Update webview fallback version
2022-05-19 16:07:14 -07:00
..
src Allow reusing webview origins across reloads (#149950) 2022-05-19 16:07:14 -07:00
.gitignore test - convert web integration to TS 2020-02-07 12:41:12 +01:00
package.json chore: update to electron 17 (#143223) 2022-03-11 00:51:37 +09:00
README.md move remote and web tests to scripts folder 2022-01-21 14:33:34 +01:00
tsconfig.json test - convert web integration to TS 2020-02-07 12:41:12 +01:00
yarn.lock chore: update to electron 17 (#143223) 2022-03-11 00:51:37 +09:00

Integration test

Compile

Make sure to run the following commands to compile and install dependencies:

yarn --cwd test/integration/browser
yarn --cwd test/integration/browser compile

Run (inside Electron)

scripts/test-integration.[sh|bat]

All integration tests run in an Electron instance. You can specify to run the tests against a real build by setting the environment variables INTEGRATION_TEST_ELECTRON_PATH and VSCODE_REMOTE_SERVER_PATH (if you want to include remote tests).

Run (inside browser)

scripts/test-web-integration.[sh|bat] --browser [chromium|webkit] [--debug]

All integration tests run in a browser instance as specified by the command line arguments.

Add the --debug flag to see a browser window with the tests running.

Note: you can enable verbose logging of playwright library by setting a DEBUG environment variable before running the tests (https://playwright.dev/docs/debug#verbose-api-logs)

Debug

All integration tests can be run and debugged from within VSCode (both Electron and Web) simply by selecting the related launch configuration and running them.