/** * Run icons in a Visual Basic project's `My Project/launchSettings.json`, where `dotnet run` reads * its profiles. The host is stubbed at the IPC layer; `crates/ide-run/tests/dotnet_cli.rs` runs the * real CLI. */ import { expect, ipcCalls, stubDesktop, test } from "./fixtures"; const SHOTS = process.env.E2E_SHOTS; const content = JSON.stringify({ profiles: { web: { commandName: "Project" } } }, null, 2); test("a profile in My Project runs the Visual Basic project's configuration", async ({ workbench: page }) => { await stubDesktop(page); await page.evaluate(async (text) => { const backendPath = "/src/editor/core/backend.ts"; const servicePath = "/src/workbench/contributions.ts"; const { docBackend } = await import(/* @vite-ignore */ backendPath); const { editorService } = await import(/* @vite-ignore */ servicePath); const path = "/dev/acme-api/Vb App/My Project/launchSettings.json"; docBackend().files.set(path, text); const params = { project: "Vb App/Vb App.vbproj", launchProfile: "web" }; const handlers = window.__ipc.handlers; handlers.fs_probe = () => ({ size: text.length, binary: false, tooLarge: false }); handlers.fs_read_text = ({ path }) => docBackend().files.get(String(path)) ?? ""; handlers.fs_read_dir = () => []; handlers.run_configs = () => [ { id: "dotnet:Vb App/Vb App.vbproj:run:web", name: "Vb App: web", kind: "dotnet", command: "dotnet", args: ["run", "--project", params.project, "--launch-profile", "web"], cwd: null, env: {}, detected: true, isTest: false, debugAdapter: "netcoredbg", params, }, ]; handlers.run_apply_settings = (args) => args.configs; await editorService().openFile(path); }, content); await page.locator(".cm-editor").getByTitle("Run 'web'", { exact: true }).click(); const run = page.getByRole("menuitem", { name: /Run 'Vb App: web'/ }); await expect(run).toBeVisible(); if (SHOTS) await page.screenshot({ path: `${SHOTS}/vb-launch-settings-gutter.png`, animations: "disabled" }); await expect(page.getByRole("menuitem", { name: /Debug 'Vb App: web'/ })).toBeVisible(); expect(await ipcCalls(page, "run_configs")).not.toHaveLength(0); });