MCPcopy Create free account
hub / github.com/abi/screenshot-to-code / importFromCode

Method importFromCode

frontend/src/tests/qa.test.ts:302–319  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

300 }
301
302 async importFromCode(code: string) {
303 await this.switchToTab("tab-import");
304 await this.page.type('[data-testid="import-input"]', code);
305 await this.page.click('[data-testid="stack-select"]');
306 await this.page.waitForSelector('[role="option"]', { timeout: 5000 });
307 await this.page.evaluate(() => {
308 const options = Array.from(
309 document.querySelectorAll('[role="option"]')
310 ) as HTMLElement[];
311 const target = options.find((option) =>
312 option.textContent?.includes("HTML + Tailwind")
313 );
314 target?.click();
315 });
316 await this.takeScreenshot("typed_code");
317 await this.page.click('[data-testid="import-submit"]');
318 await this.waitUntilVersionIsReady("v1");
319 }
320
321 async edit(edit: string, version: string) {
322 await this.page.type('[data-testid="update-input"]', edit);

Callers 1

qa.test.tsFile · 0.80

Calls 3

switchToTabMethod · 0.95
takeScreenshotMethod · 0.95

Tested by

no test coverage detected