Agent skill

Bun Webview Test

by pa001024 in pa001024/dna-builder

使用 Bun 1.4 内置的 Bun.WebView 无头浏览器对前端页面(Vue/Vite 等)做端到端冒烟与交互测试。当需要加载页面、真实点击、读取 DOM/应用状态、做断言、截图归档,或对本地开发服务器/静态站点做零依赖的浏览器级验证、可视化巡检、交互回归测试时,应使用本技能。

MITAuto-check passedTesting & QA

Install Bun Webview Test

skills CLI
$ npx skills add pa001024/dna-builder --skill bun-webview-test -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pa001024/dna-builder bun-webview-test --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pa001024/dna-builder.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/bun-webview-test .claude/skills/bun-webview-test && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bun-webview-test
GitHub stars
136
Token cost
~1.2k tokens
SKILL.md length
320 words
Files
4 (incl. scripts, references)
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

使用 Bun 1.4 内置的 Bun.WebView 无头浏览器对前端页面(Vue/Vite 等)做端到端冒烟与交互测试。当需要加载页面、真实点击、读取 DOM/应用状态、做断言、截图归档,或对本地开发服务器/静态站点做零依赖的浏览器级验证、可视化巡检、交互回归测试时,应使用本技能。

  • Works in 3 steps: Bun >= 1.4:运行 bun --version 确认;低于此版本无… → 目标前端可访问:先用 pnpm dev 启动本项目开发服务器(或指向任意可访问… → Windows / Linux 需安装浏览器:Bun.WebView 在…
  • Testing & QA work in your project
  • SKILL.md covers Overview, When to use, Prerequisites and Workflow, plus 3 more sections
  • Runs TypeScript scripts from its folder; calls pnpm and bun

What it does

Bun Webview Test is an agent skill from pa001024/dna-builder. 使用 Bun 1.4 内置的 Bun.WebView 无头浏览器对前端页面(Vue/Vite 等)做端到端冒烟与交互测试。当需要加载页面、真实点击、读取 DOM/应用状态、做断言、截图归档,或对本地开发服务器/静态站点做零依赖的浏览器级验证、可视化巡检、交互回归测试时,应使用本技能。

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts and reference files (for example `references/webview-api.md`, `scripts/example.test.ts` and `scripts/webview-test.ts`).

It sits in Testing & QA. It works with Vite, Vue.js, pnpm and Playwright. The repository describes itself as: 二重螺旋构筑模拟器 Duet Night Abyss Builder. The licence is MIT.

When your agent uses it

  • Testing & QA work in your project

Example prompts

  • “/bun-webview-test”

Requirements

  • Node.js

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Bun >= 1.4:运行 bun --version 确认;低于此版本无 Bun.WebView。
  2. 目标前端可访问:先用 pnpm dev 启动本项目开发服务器(或指向任意可访问 URL)。
  3. Windows / Linux 需安装浏览器:Bun.WebView 在 Windows 默认走 Chrome 后端,需本机已装 Chrome/Chromium/Edge/Brave。找不到时设 BUN_CHROME_PATH 指向可执行文件,或装 Playwright 的…

What it can do on your machine

Read from SKILL.md and the folder at commit 0a808c9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (TypeScript), which the agent can run.

    Shell commands in SKILL.md call:

    • pnpm
    • bun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bun Webview Test loads about 1.2k tokens when it runs, and up to ~2.3k if it reads all its reference files. Until then it costs about 40 tokens; SKILL.md has 320 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~40
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from pa001024/dna-builder at commit 0a808c9, republished under its MIT licence (© pa001024). 320 words, ~1,198 tokens.

Download SKILL.mdSave it as .claude/skills/bun-webview-test/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
bun-webview-test
description
使用 Bun 1.4 内置的 Bun.WebView 无头浏览器对前端页面(Vue/Vite 等)做端到端冒烟与交互测试。当需要加载页面、真实点击、读取 DOM/应用状态、做断言、截图归档,或对本地开发服务器/静态站点做零依赖的浏览器级验证、可视化巡检、交互回归测试时,应使用本技能。

Bun.WebView 前端测试

Overview

本技能封装 Bun 1.4 新增的 Bun.WebView 无头浏览器能力,提供一套零依赖的前端端到端测试框架。它取代了 Puppeteer / Playwright 的安装开销,用单个 bun 命令即可驱动真实浏览器(macOS 用系统 WebKit,Windows/Linux 用已安装的 Chrome/Edge 经 CDP)完成:页面加载、真实用户输入、DOM/状态读取、断言与截图。

完整 API 细节见 references/webview-api.md,不要凭记忆猜测方法签名。

When to use

  • 对 pnpm dev 起的开发服务器(本项目默认 http://localhost:1420)做冒烟测试。
  • 验证某个路由/组件是否正确挂载、渲染、无控制台报错。
  • 模拟用户点击/输入/滚动,校验交互后的状态或路由变化。
  • 需要截图归档供人工查看(可视化巡检、回归基线)。
  • 任何"用浏览器跑一下确认没坏"的场景,且不想引入 Playwright 依赖。

Prerequisites

  1. Bun >= 1.4:运行 bun --version 确认;低于此版本无 Bun.WebView。
  2. 目标前端可访问:先用 pnpm dev 启动本项目开发服务器(或指向任意可访问 URL)。
  3. Windows / Linux 需安装浏览器:Bun.WebView 在 Windows 默认走 Chrome 后端,需本机已装 Chrome/Chromium/Edge/Brave。找不到时设 BUN_CHROME_PATH 指向可执行文件,或装 Playwright 的 chrome-headless-shell。macOS 用系统 WebKit,无需安装。

Workflow

Quick Start(复用框架跑测试)
  1. 确认开发服务器运行中:pnpm dev / pnpm dd2(保持 http://localhost:1420 可访问)。
  2. 务必带 ?hideUpdateInfo=1 打开页面(见下方「启动弹窗」),否则会被数据包弹窗挡住。
  3. 运行内置示例冒烟测试:
    bash
    bun .agents/skills/bun-webview-test/scripts/example.test.ts
    # 或指定地址
    bun .agents/skills/bun-webview-test/scripts/example.test.ts --url http://localhost:1420
  4. 失败用例会自动留图(见 Guidelines 的 .tmp 约定),通过 screenshots/home.png 查看首屏。

注意点:

  • 参数必须在首次导航的 URL 上;先打开无参数地址再 router.push 加参数不会生效。
  • 该参数只关弹窗,不会安装数据包:依赖游戏数据的页面(如 /char/:id 构筑页)依然会因为 charBuild.calculateWeaponAttributes is not a function 之类报错渲染失败。这类页面要在 已装数据包的浏览器里人工验证,或给 WebView 传 dataStore: "./profile" 复用已装数据包的 profile。
  • 判断弹窗是否还在:document.querySelector("dialog.modal.modal-open") 非空即被挡住。
编写新的测试文件

新建一个 *.test.ts,从框架导入能力,注册用例,末尾调用 run():

ts
import { test, expectVisible, expectEval, expectNoConsoleErrors, snapshot, run } from "./webview-test.ts"

test("标题区域可见", async ({ view }) => {
    await expectVisible(view, "header h1")
})

test("无控制台错误", async () => {
    await expectNoConsoleErrors()
})

run()

可用断言辅助(详见 scripts/webview-test.ts):expectText、expectContains、expectVisible、expectCount、expectCountAtLeast、expectEval、expectNoConsoleErrors、snapshot、evalExpr。

直接在用例内也能调用底层 view 方法:await view.click("button.submit")、await view.evaluate("app.store.xxx")、await view.scroll(0, 400)、await view.screenshot({ format: "png" })。

运行参数
  • --url <地址>:覆盖基准地址(默认 http://localhost:1420)。
  • 环境变量 FRONTEND_TEST_URL:同上,优先级低于 --url。
  • 退出码:0 全部通过;1 有用例失败;2 无法导航到目标(通常是服务器没起)。

Core Capabilities

  1. 零依赖无头浏览器:new WebView({ width, height, console, dataStore }),无需 npm 安装浏览器引擎。
  2. 真实用户交互:click/type/press/scroll 派发原生事件(isTrusted === true),选择器方法自动等待可操作。
  3. 页面求值与状态读取:evaluate(expr) 在页面上下文执行 JS 字符串并返回反序列化结果;evalExpr 封装了 undefined 安全处理。
  4. 声明式断言:文本 / 可见性 / 数量 / 任意表达式 / 控制台错误,断言失败即截图留证。
  5. 截图归档:snapshot(ctx, name, format) 保存到 screenshots/(相对 process.cwd(),建议以 .tmp 为工作目录),供人工或更严格的回归对比。

Guidelines

  • evaluate 接收字符串表达式;多语句用 (function(){ ... })() 包裹,顶层 const/let 会抛 SyntaxError。
  • console 选项必须是函数(console: (level, ...a) => {...}),传 true 会抛 ERR_INVALID_ARG_TYPE。
  • 断言失败不要靠"肉眼看截图"判断;优先用 evaluate 读取 DOM/状态做代码级断言,截图仅作人工辅助。
  • navigate 会重置页面:注入到 window 上的钩子/状态(含 localStorage 之外的临时全局量)会随整页加载丢失, 所以钩子只能在最后一次 navigate 之后装,且每个用例内自给自足,不要跨用例依赖注入态。
  • 要断言「某个功能被触发」就 hook 构造函数:例如确认「开关打开后立刻启动了索引 Worker」, 可在页面里替换 window.Worker 记录 URL 再触发交互(new Worker 的参数是 URL 对象,String() 后含 xxx.worker)。
  • 读模块内部状态:页面上下文 await import("/src/utils/xxx.ts") 可直接调纯前端模块(裸包名解析不了), 用来断言「语料/索引是否已建」这类不体现在 DOM 上的状态,比翻 UI 稳。
  • 无头 profile 默认深色主题且没有数据包:依赖游戏数据的异步流程会静默失败, 断言要挑不依赖数据的信号(DOM 结构、localStorage、Worker 计数),别把「数据没装」误判成功能坏了。
  • 需要登录态跨用例保留时,给 WebView 传 dataStore: "./profile"。
  • 导航 URL 一律追加 ?hideUpdateInfo=1,否则启动期的数据包弹窗会盖住页面(详见上方「启动弹窗」)。
  • 截图与临时脚本放 .tmp/:框架按 process.cwd() 写 screenshots/,所以以 .tmp 为工作目录运行 (workdir: <repo>/.tmp)即可让产物落在 .tmp/screenshots/,不要在仓库根留下 screenshots/。
  • 点 reka-ui Select 只能坐标点可见项:打开后全部 option 都在 DOM(本项目等级选择器有 240 个,不做虚拟化,[role=option] 可数),但当前选中项会对齐触发器,序号小于当前值的 option getBoundingClientRect().top 为负、点不到;view.type + Enter 的 typeahead 不生效。改值的做法:先 evaluate 取出一个可见(top > 0 && bottom < innerHeight)且 innerText 不等于当前值的 option,再用 view.click(x, y) 点它的中心。
  • 每次变更前端后,建议把关键路由的冒烟测试纳入验证(配合 pnpm lint / pnpm test)。

Resources

scripts/
  • webview-test.ts — 测试框架:注册器 test、断言辅助、截图、运行器 run。测试文件应 import 它。
  • example.test.ts — 可直接运行的冒烟示例,针对本项目 http://localhost:1420。
references/
  • webview-api.md — Bun.WebView 完整 API 精简参考(构造、方法、后端、事件、注意事项)。

© pa001024, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references) in .agents/skills/bun-webview-test of pa001024/dna-builder.

  • SKILL.md
  • references/webview-api.md
  • scripts/example.test.ts
  • scripts/webview-test.ts

Open the folder on GitHubat commit 0a808c9

Compare with similar skills

Bun Webview Test next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bun Webview Test compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bun Webview Test this skillpa001024/dna-builder136—~1.2kAutomated safety check: PassMIT
Playwright Component Testingmellowagain/gitarena1151 repos~2.6kAutomated safety check: PassMIT
Handsontable Visual Test Demoshandsontable/handsontable22k—~1.3kAutomated safety check: PassCustom licence
Validate BranchZenUml/web-sequence150—~1.1kAutomated safety check: PassMIT
Devinggo Project Inithuagelong/devinggo122—~1.1kAutomated safety check: NotesApache-2.0
Projectlin-97/gi-demo188—~1.4kAutomated safety check: NotesApache-2.0

Similar skills

  • Playwright Component Testing

    mellowagain/gitarena

    Set up component testing with Playwright using a story gallery — scaffold stories and a gallery dev page driven by the built-in mount fixture, no dedicated component-testing runtime.

    115 GitHub starsUsed in 1 repo~2.6k tokens
    Testing & QAAuto-check passed
  • Handsontable Visual Test Demos

    handsontable/handsontable

    Explains how to add or change the demo pages that Handsontable's visual regression suite photographs, including per-feature routes in the js demo and the shared grid.

    22k GitHub stars~1.3k tokensUpdated today
    Testing & QAAuto-check passed
  • Validate Branch

    ZenUml/web-sequence

    Run local validation checks for ZenUML web-sequence before pushing, opening a PR, or merging.

    150 GitHub stars~1.1k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Devinggo Project Init

    huagelong/devinggo

    DevingGo 项目初始化与本地开发环境配置流程。用于用户询问项目初始化、开发环境搭建、依赖检查、配置文件生成、数据库迁移、本地启动后端/前端/Worker 服务、或希望 AI 大模型一步步把 DevingGo 跑起来时。适用于基于本项目 CLI、Makefile、manifest/config、hack/config、admin-ui 前端工作区的初始化排障与启动验证。

    122 GitHub stars~1.1k tokensUpdated 3 mo ago
    DatabasesAuto-check: notes
  • Project

    lin-97/gi-demo

    后台管理模板的项目总览与前端强制规范。涵盖 Vue 3 + Arco Design + Gi 组件库、目录结构、自动导入、CRUD/API 约定与代码风格。在当前仓库内开发、新增页面、查阅架构或不确定项目规范时使用。

    188 GitHub stars~1.4k tokensUpdated 3 mo ago
    Backend & APIsAuto-check: notes
  • Vuetify Playground

    vuetifyjs/vuetify

    Maintains the Vuetify repo's local Playground.vue so contributors get a realistic reproduction and a short demo they can paste into a pull request description.

    41k GitHub stars~730 tokensUpdated today
    Frontend & DesignAuto-check passed

More from pa001024/dna-builder

All 14 skills in this repo
  • Fmodel Unpack

    pa001024/dna-builder

    This skill documents how to use the fmodel-mcp toolkit (a CUE4Parse-based .NET CLI plus a thin Python MCP server) to inspect and export Unreal Engine game assets — pak files, textures, meshes…

    136 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed
  • Ue4 Pak Mod

    pa001024/dna-builder

    制作与调试 Unreal Engine 4.27 游戏的 pak 模组(模型/网格/资产换皮,如《二重螺旋》Duet Night Abyss)。两条路线:编辑器烘焙(Blender 自由改模型 → UE4.27 cook → pak)与二进制替换(改写已烘焙 .uasset 的导出名/载荷)。当需要「把 A 的模型换成 B 的模型」「让模型能自由导入 Blender…

    136 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Build Creator

    pa001024/dna-builder

    给 dna-builder 里任意角色从零推一套「最优构筑」(BD)的通用方法论:读角色机制 → 辅助候选排列组合 → buff 组(含光环型海妖 / 角色专属如大冲击)→ 定计算方向 → 魔灵与潜质 → 必带 MOD → 用 autoBuild 跑一遍并剔除不合理件 → 消融实验。当需要「给某个角色配一套最优 BD」「这个角色带什么辅助/队友最强」「跑一下 XX…

    136 GitHub stars~3.6k tokensUpdated yesterday
    Auto-check passed
  • Perf Hotspot Profiling

    pa001024/dna-builder

    用 V8 CPU profile 定位 JS/TS 热点函数,并用「同进程交替 A/B + best(min) 统计量 + checksum 锚点」的微基准方法安全地做性能优化。当需要优化计算热点、怀疑某函数耗时占比高、想评估某个优化(含 Wasm/SIMD 等加速路径)是否真有收益、或要建立可回归的性能基准时使用。

    136 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • For Beginer

    pa001024/dna-builder

    《二重螺旋》新手开荒指南(校对至 1.6 版本)。含分阶段开荒流程(历练 35 前 / 35~45 / 45~60 / 60 后)、前期角色与武器获取清单、角色获取循环(深渊→周本→密函商店)、魔之楔六大系列与金 Mod 升级口径、减负活动、灾厄武器四把(棘刺绝响 / 无止无休 / 权火将熄 / 血染织羽)的两条刷取路线与 1.6 配队(暗队 /…

    136 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Admin Management Page

    pa001024/dna-builder

    在 dna-builder 里新增一个 /admin 后台管理页(侧边栏菜单 + 路由 + REST 封装 + 统计卡/筛选卡/表格/分页 + 详情弹窗),并在本地实测验证。当需要给后台加新的管理页面、或改动 src/admin/ 下的页面结构时使用。

    136 GitHub stars~890 tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Bun Webview Test

What does Bun Webview Test do?

使用 Bun 1.4 内置的 Bun.WebView 无头浏览器对前端页面(Vue/Vite 等)做端到端冒烟与交互测试。当需要加载页面、真实点击、读取 DOM/应用状态、做断言、截图归档,或对本地开发服务器/静态站点做零依赖的浏览器级验证、可视化巡检、交互回归测试时,应使用本技能。. Bun Webview Test is an agent skill from pa001024/dna-builder.

When should I use Bun Webview Test?

Bun Webview Test fits situations like: testing & QA work in your project.

How do I install Bun Webview Test in Claude Code?

Run `npx skills add pa001024/dna-builder --skill bun-webview-test -a claude-code`. Or copy the skill folder (.agents/skills/bun-webview-test in pa001024/dna-builder) into .claude/skills/bun-webview-test in your project. Claude Code loads it when a task matches its description.

How do I install Bun Webview Test in Codex?

Run `npx skills add pa001024/dna-builder --skill bun-webview-test -a codex`. Or copy the skill folder (.agents/skills/bun-webview-test in pa001024/dna-builder) into .agents/skills/bun-webview-test in your project. Codex loads it when a task matches its description.

Can I use Bun Webview Test in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pa001024/dna-builder --skill bun-webview-test -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bun-webview-test, .gemini/skills/bun-webview-test, .github/skills/bun-webview-test and .opencode/skills/bun-webview-test in your project.

What does Bun Webview Test need to run?

Going by SKILL.md and its folder, Bun Webview Test needs TypeScript for the scripts in its folder and the command-line tools its instructions call (pnpm and bun). Our summary lists: Node.js.

Does Bun Webview Test access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bun Webview Test safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Bun Webview Test use?

Bun Webview Test is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bun Webview Test use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Bun Webview Test?

Skills that share tags, products or a category with Bun Webview Test: Playwright Component Testing (mellowagain/gitarena, 115 stars), Handsontable Visual Test Demos (handsontable/handsontable, 22k stars), Validate Branch (ZenUml/web-sequence, 150 stars) and Devinggo Project Init (huagelong/devinggo, 122 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bun Webview Test?

pa001024 (a GitHub user) maintains it in pa001024/dna-builder, which has 136 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 8, 2026.

Source: pa001024/dna-builder on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.