Compare commits

...

6 Commits

Author SHA1 Message Date
abeatrix 689652e737 Do not open debugger 2025-09-16 16:47:43 -07:00
abeatrix 65e7546c4d feat(e2e): add interactive UI testing mode with improved script organization
- Add interactive e2e testing capability with `test:e2e:ui` script
- Split e2e scripts: separate build step (`test:e2e:build`) from test execution
- Implement conditional Playwright config for interactive vs automated testing
- Add `interactive.ui.ts` test file for manual extension interaction
- Enable configurable gRPC recording through test fixtures
- Support headed mode with pause functionality for manual testing sessions
2025-09-16 13:12:15 -07:00
jiclotus 8136d940af refactoring message 2025-09-16 19:24:37 +02:00
jiclotus 50113f4a8d adding changeset 2025-09-16 18:58:08 +02:00
jiclotus 416cfb3fb0 script updates 2025-09-15 16:43:05 +02:00
jiclotus 3de7132c60 adding script to do interactive playwright 2025-09-15 16:10:23 +02:00
5 changed files with 56 additions and 8 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Interactive playwright script
+5 -2
View File
@@ -360,8 +360,11 @@
"test:sca-server": "npx tsx watch scripts/test-standalone-core-api-server.ts",
"test:tp-orchestrator": "npx tsx scripts/testing-platform-orchestrator.ts",
"e2e": "playwright test -c playwright.config.ts",
"test:e2e": "playwright install && vsce package --allow-package-secrets sendgrid --out dist/e2e.vsix && node src/test/e2e/utils/build.mjs && playwright test",
"test:e2e:optimal": "vsce package --allow-package-secrets sendgrid --out dist/e2e.vsix && node src/test/e2e/utils/build.mjs && playwright test",
"install:e2e:extension": "vsce package --allow-package-secrets sendgrid --out dist/e2e.vsix",
"test:e2e": "playwright install && npm run install:e2e:extension && node src/test/e2e/utils/build.mjs && playwright test",
"test:e2e:build": "playwright install && npm run install:e2e:extension && node src/test/e2e/utils/build.mjs",
"test:e2e:optimal": "npm run install:e2e:extension && node src/test/e2e/utils/build.mjs && playwright test",
"test:e2e:ui": "INTERACTIVE_E2E=true playwright test",
"install:all": "npm install && cd webview-ui && npm install",
"dev:webview": "cd webview-ui && npm run dev",
"build:webview": "cd webview-ui && npm run build",
+24 -1
View File
@@ -2,8 +2,9 @@ import { defineConfig } from "@playwright/test"
const isCI = !!process?.env?.CI
const isWindow = process?.platform?.startsWith("win")
const isInteractive = process?.env?.INTERACTIVE_E2E === "true"
export default defineConfig({
const E2E_TEST_CONFIG = defineConfig({
workers: 1,
retries: 1,
forbidOnly: isCI,
@@ -29,3 +30,25 @@ export default defineConfig({
},
],
})
const INTERACTIVE_UI_CONFIG = defineConfig({
workers: 1,
testDir: "src/test/e2e",
testMatch: "interactive.ui.ts", // Different pattern to avoid running actual tests
timeout: 0, // No timeout for interactive sessions
fullyParallel: false,
reporter: [["list"]],
projects: [
{
name: "setup test environment",
testMatch: /global\.setup\.ts/,
},
{
name: "interactive-ui",
testMatch: "interactive.ui.ts",
dependencies: ["setup test environment"],
},
],
})
export default isInteractive ? INTERACTIVE_UI_CONFIG : E2E_TEST_CONFIG
+15
View File
@@ -0,0 +1,15 @@
import { E2ETestConfigs, e2e } from "./utils/helpers"
e2e.extend<E2ETestConfigs>({
grpcRecorderEnabled: true,
grpcRecorderTestsFiltersEnabled: true,
})("Interactive Playwright launcher for the Cline VS Code extension", async ({ page }) => {
console.log("VSCode with Cline extension is now running!")
console.log("The Cline sidebar is automatically opened and ready for interaction.")
console.log("gRPC recording is enabled - all calls will be recorded for inspection.")
console.log("You can manually interact with the extension.")
console.log("Close the VS Code window or press Ctrl+C to end the session.")
// Keep the session running for manual interaction
await page.waitForEvent("close")
})
+7 -5
View File
@@ -16,6 +16,8 @@ interface E2ETestDirectories {
export interface E2ETestConfigs {
workspaceType: "single" | "multi"
channel: "stable" | "insiders"
grpcRecorderEnabled?: boolean
grpcRecorderTestsFiltersEnabled?: boolean
}
export class E2ETestHelper {
@@ -234,9 +236,11 @@ export const e2e = test
.extend<E2ETestConfigs>({
workspaceType: "single",
channel: "stable",
grpcRecorderEnabled: false,
grpcRecorderTestsFiltersEnabled: false,
})
.extend<{ openVSCode: (workspacePath: string) => Promise<ElectronApplication> }>({
openVSCode: async ({ userDataDir, channel }, use, testInfo) => {
openVSCode: async ({ userDataDir, channel, grpcRecorderEnabled, grpcRecorderTestsFiltersEnabled }, use, testInfo) => {
const executablePath = await downloadAndUnzipVSCode(channel, undefined, new SilentReporter())
await use(async (workspacePath: string) => {
@@ -248,10 +252,8 @@ export const e2e = test
E2E_TEST: "true",
CLINE_ENVIRONMENT: "local",
GRPC_RECORDER_FILE_NAME: E2ETestHelper.generateTestFileName(testInfo.title, testInfo.project.name),
// GRPC_RECORDER_ENABLED: "true",
// GRPC_RECORDER_TESTS_FILTERS_ENABLED: "true"
// IS_DEV: "true",
// DEV_WORKSPACE_FOLDER: E2ETestHelper.CODEBASE_ROOT_DIR,
GRPC_RECORDER_ENABLED: grpcRecorderEnabled ? "true" : "false",
GRPC_RECORDER_TESTS_FILTERS_ENABLED: grpcRecorderTestsFiltersEnabled ? "true" : "false",
},
recordVideo: {
dir: E2ETestHelper.getResultsDir(testInfo.title, "recordings"),