diff --git a/extensions/ql-vscode/test/e2e/README.md b/extensions/ql-vscode/test/e2e/README.md index c62724bb7..cbfd3337e 100644 --- a/extensions/ql-vscode/test/e2e/README.md +++ b/extensions/ql-vscode/test/e2e/README.md @@ -1,17 +1,18 @@ ## VS Code CodeQL E2E Tests -When running the tests locally on a mac a different processor has to be emulated, which makes everythign VERY slow. Hence many timeouts in the test. +When running the tests locally on a mac a different processor has to be emulated, which makes everythign VERY slow. Therefore we need to add higher timeouts in the test, so that they pass locally. ### How to use locally Setup -- run `docker-compose build` from the e2e test folder `vscode-codeql/extensions/ql-vscode/test/e2e` -- run `docker-compose up` from the e2e test folder `vscode-codeql/extensions/ql-vscode/test/e2e` +- go to the e2e test folder on your terminal +- run `docker-compose build` +- run `docker-compose up` Run tests -- run `npx playwright test --ui` from the vscode-codeql folder `vscode-codeql/extensions/ql-vscode` to follow the test while it's running. This UI has a 'locator' tool with which elements on the test screen can be +- run `npx playwright test --ui` from the e2e test folder to follow the test while it's running. This UI has a 'locator' tool with which elements on the test screen can be found - use `npx playwright test --debug` to follow the test in real time and interact with the interface, e.g. press enter or input into fields, stop and start -If you get failures after the first test run you can try to remove the volume data, e.g. by running `docker-compose down -v`. Sometimes already existing queries from former runs change the input the extension needs. +During the test elements are created in the docker volume, e.g. the downloaded database or query data. This might interfer with other tests or when running a test twice. If that happens restart your docker volume by using `docker-compose down -v` and `docker-compose up`. Sometimes already existing queries from former runs change the input the extension needs. diff --git a/extensions/ql-vscode/playwright.config.ts b/extensions/ql-vscode/test/e2e/playwright.config.ts similarity index 98% rename from extensions/ql-vscode/playwright.config.ts rename to extensions/ql-vscode/test/e2e/playwright.config.ts index bdd47ce3d..c1e68c0a4 100644 --- a/extensions/ql-vscode/playwright.config.ts +++ b/extensions/ql-vscode/test/e2e/playwright.config.ts @@ -10,7 +10,7 @@ import { defineConfig, devices } from "@playwright/test"; * See https://playwright.dev/docs/test-configuration. */ export default defineConfig({ - testDir: "./test/e2e", + testDir: ".", timeout: 5 * 60 * 1000, /* Run tests in files in parallel */ diff --git a/extensions/ql-vscode/tsconfig.json b/extensions/ql-vscode/tsconfig.json index 19759b3dc..93f7cb0f2 100644 --- a/extensions/ql-vscode/tsconfig.json +++ b/extensions/ql-vscode/tsconfig.json @@ -24,5 +24,5 @@ "noEmit": true }, "include": ["src/**/*.ts"], - "exclude": ["node_modules", "test", "**/view"] + "exclude": ["node_modules", "*.config.ts", "test", "**/view"] }