Use Vishot With Input File use-vishot-with-input-file

Drive a local file-input or file-chooser workflow inside a Vishot browser or Electron scenario, then capture the resulting deterministic UI state.

Use it when screenshot readiness depends on uploading, importing, opening, or selecting a local file rather than the application's default startup data.

Works in Claude, ChatGPT, Codex and more
Our test
—
not tested yet
GitHub stars
52k
moeru-ai/airi
Added by
0
members
Updated
Dec 6
commit f28d10e
Content
2 files
no scripts · 2 KB
License
MIT
free to use

What our test found

Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.

View on GitHub ↗
name: use-vishot-with-input-file
description: Drive a local file-input or file-chooser workflow inside a Vishot browser or Electron scenario, then capture the resulting deterministic UI state. Use when screenshot readiness depends on uploading, importing, opening, or selecting a local file rather than the application's default startup data.

Use Vishot with an Input File

Invoke $use-vishot and its runtime variant first. Put file interaction in a product-owned or disposable defineScenario module; Vishot performs the final capture.

File chooser pattern

Pass the absolute input path through an environment variable. Do not embed a contributor-specific path in tests or reusable scenario source.

const inputFile = process.env.VISHOT_INPUT_FILE
if (!inputFile)
  throw new Error('VISHOT_INPUT_FILE is required')

const [fileChooser] = await Promise.all([
  page.waitForEvent('filechooser'),
  page.getByRole('menuitem', { name: 'Import' }).click(),
])

await fileChooser.setFiles(inputFile)
await page.getByText(inputFile.replaceAll('\\', '/').split('/').at(-1)!, { exact: true })
  .waitFor({ state: 'visible' })
await capture('imported-file', page)

Use locator.setInputFiles(inputFile) when a stable <input type="file"> already exists. Prefer waitForEvent('filechooser') when the application creates the input lazily or hides it behind a menu.

Readiness

  1. Verify the absolute file exists before launching the scenario.
  2. Start waiting for filechooser before clicking the control that opens it.
  3. Wait for a file-specific postcondition such as its displayed name, imported record ID, parsed preview, or selected renderer.
  4. Select the imported item if upload alone does not activate it.
  5. Wait for the destination surface, not merely for the chooser to close.
  6. Capture with Vishot and inspect the image. A default model or unchanged startup view is a failed upload scenario.

Keep secrets and private filenames out of scenario IDs, screenshot names, test names, and comments. Supply private local paths only through environment variables or command arguments.