MCPcopy
hub / github.com/coder/mux / openWorkspace

Function openWorkspace

scripts/reproWorkspaceSwitchTearWeb.ts:157–173  ·  view source on GitHub ↗
(
  page: Page,
  workspaceId: string,
  expectedMarker: string
)

Source from the content-addressed store, hash-verified

155}
156
157async function openWorkspace(
158 page: Page,
159 workspaceId: string,
160 expectedMarker: string
161): Promise<void> {
162 const row = page.locator(`[data-workspace-id="${workspaceId}"][data-workspace-path]`);
163 await row.waitFor({ state: "visible", timeout: 60_000 });
164 await row.scrollIntoViewIfNeeded();
165 await row.dispatchEvent("click");
166 if (expectedMarker.length > 0) {
167 await page.waitForFunction(
168 (marker: string) => document.body.textContent?.includes(marker) ?? false,
169 expectedMarker,
170 { timeout: 60_000 }
171 );
172 }
173}
174
175async function sendMessage(page: Page, text: string): Promise<void> {
176 const input = page.getByRole("textbox", {

Callers 1

mainFunction · 0.70

Calls 2

waitForMethod · 0.80
dispatchEventMethod · 0.80

Tested by

no test coverage detected