← 返回 Skills 市场
qiliwei411-cloud

投放Agent自动化体验测试

作者 qiliwei411-cloud · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
57
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ad-agent-test
功能描述
投放Agent(ad.qq.com/atlas/{account_id}/agent)自动化体验测试技能。 通过Cookie注入+Playwright浏览器自动化,对投放Agent的对话功能、快捷指令、常用指令面板、自由对话、妙招功能进行完整体验测试,并生成UX体验报告。
使用说明 (SKILL.md)

投放Agent自动化体验测试

通过 Playwright 浏览器自动化 + Cookie注入 对 ad.qq.com 投放Agent功能进行完整UX测试。

前置条件

  1. 中文字体:服务器需安装中文字体(否则截图中文为方块)
  2. Cookie:需要用户提供有效的 adhome 免登录 Cookie
  3. Playwright:需要 Node.js + playwright 已安装

安装中文字体

yum install -y google-noto-sans-cjk-sc-fonts

检查Playwright

npx playwright --version

Cookie 获取流程

引导用户操作:

  1. 打开 adhome 免登录页面,选择目标账户
  2. 点击免登录进入 ad.qq.com/atlas/{account_id}/agent
  3. 在浏览器 F12 控制台执行 document.cookie
  4. 将结果发给 Agent

Cookie 解析要点

  • 必需Cookie:gdt_mlogingdt_ownertap_free_login_tokentap_free_login_userid
  • .woa.com 域Cookie(RIO_TOKEN等)用于内网认证
  • .qq.com 域Cookie(ptczRK等)用于QQ登录态
  • Cookie有效期约2小时(会话级),过期会跳转登录页

Cookie 注入代码模板

参见 scripts/inject_cookies.js — 解析用户提供的 cookie 字符串并注入到 Playwright context。

测试流程

第一阶段:环境验证

  1. 注入Cookie
  2. 访问 https://ad.qq.com/atlas/{account_id}/agent
  3. 等待8秒页面加载
  4. 验证是否进入Agent页面(非登录页)— 检查页面是否包含"对话"/"妙招"等文字

第二阶段:对话功能测试

2.1 首页快捷指令

遍历首页展示的快捷指令卡片(通常4个),依次:

  1. 点击指令
  2. 等待3秒
  3. 截图记录模板展示
  4. 提取输入框中的模板文案(含slot类型)
  5. 新开会话测试下一个

2.2 常用指令面板

  1. 点击底部"常用指令"按钮([title="常用指令"]
  2. 截图完整指令面板
  3. 提取所有指令分类和名称

2.3 模板Slot交互

  1. 点击快捷指令后,在模板中点击 asset slot
  2. 记录下拉列表内容
  3. 点击 select slot,记录选项

2.4 自由对话

测试覆盖投放全链路:

投放前

  • 预算规划:"我有5000元预算,想推广一个教育类小程序,应该怎么设置投放计划?"
  • 选品定向:"我是做电商的,卖女装,适合选择什么投放版位和定向人群?"

投放中

  • 数据查询:"帮我查一下今天的广告消耗和转化数据"
  • 优化建议:"我的广告点击率很低只有0.5%,有什么优化建议?"
  • 调预算:"帮我把所有在投的广告日预算统一调整到200元"

投放后

  • 复盘分析:"帮我分析一下上周的投放效果,哪些广告ROI最高?"
  • 批量关停:"帮我把转化成本超过50元的广告全部暂停"

每轮对话:输入 → 等待25秒 → 截图 → 提取回复文本

第三阶段:妙招功能测试

  1. 切换到妙招页面(点击侧边栏"妙招"或首页"探索投放妙招"卡片)
  2. 逐一点击每个妙招卡片,截图配置面板
  3. 测试"一键执行":
    • 验证按钮默认disabled状态(title="请先完成必要配置"
    • 通过规则选择广告
    • 验证按钮变为enabled
    • 点击执行,观察结果反馈

输出物

截图命名规范

{序号}_{场景}.png

示例:01_home.png05_chat_fashion.png07_miaozahao.png

报告结构

参见 references/report-template.md — 完整报告 Markdown 模板。

报告核心章节:

  1. 功能全景(对话 + 妙招)
  2. 对话功能体验(快捷指令 + 自由对话)
  3. 妙招功能体验(配置面板 + 一键执行)
  4. 信息架构与体验一致性
  5. 优化建议(按P0/P1/P2分级)
  6. 体验亮点

报告输出

  • 本地Markdown文件:output/agent-test/体验报告_投放Agent_{date}.md
  • 企微文档(通过 wecom_mcpsmartpage_create 上传)

关键选择器参考

元素 选择器
快捷指令卡片 [class*="guideCard"]text=模仿优质广告新建
常用指令按钮 [title="常用指令"][class*="commandButton"]
输入框 [contenteditable="true"]
发送按钮 [class*="sendButton"]
妙招侧边栏 [class*="menuItem"] 含文字"妙招"
一键执行按钮 button 含文字"一键执行"
广告选择规则 [class*="ruleSelect"] 或含"规则"文字的tab

注意事项

  • Cookie约2小时过期,过期后自动跳转登录页
  • 如截图中文显示为方块,先安装 google-noto-sans-cjk-sc-fonts
  • Agent回复需要10-25秒,部分场景会卡在"分析中"状态
  • 使用DOM文本提取(page.evaluate)比截图更可靠,确保内容被记录
  • 首次进入Agent页面需等8秒完成SPA加载
  • 每次发送对话后建议新开会话(避免上下文串扰测试结果)
安全使用建议
Only use this skill with a dedicated test/sandbox advertising account. Set ACCOUNT_ID explicitly, avoid real budget/pause/delete actions unless you intentionally approve them, treat cookies.json as a live login secret, delete it after testing, and review any report before uploading it to WeCom.
功能分析
Type: OpenClaw Skill Name: ad-agent-test Version: 1.0.0 The skill bundle automates UX testing of the Tencent Advertising platform (ad.qq.com) by requiring users to manually extract and provide full session cookies, including sensitive internal tokens (RIO_TOKEN for .woa.com) and login credentials (gdt_mlogin). While the scripts (inject_cookies.js and run_test.js) use these cookies locally for Playwright automation as described, the practice of manual cookie injection is a high-risk pattern. Furthermore, the test script (run_test.js) sends active commands to the advertising agent that could modify live campaign budgets or pause ads (e.g., 'adjust all daily budgets to 200 yuan'), which may lead to unintended financial impact during a 'test' run.
能力评估
Purpose & Capability
The stated purpose matches Playwright-based testing of ad.qq.com, but the workflow uses live ad-account sessions and includes tests that may mutate campaign budgets or pause ads.
Instruction Scope
The instructions are not limited to a sandbox/test account, do not require per-action confirmation for high-impact mutations, and ask the user to provide full browser cookies.
Install Mechanism
The registry declares no install spec, binaries, env vars, or credential requirements, while the artifacts require Node.js, Playwright, cookies, account IDs, and optionally a privileged font package install.
Credentials
The environment access is broad for UX testing: it uses ad.qq.com, QQ, and internal .woa.com session cookies, captures screenshots, and may upload reports.
Persistence & Privilege
The helper stores session cookies in a local cookies.json file, the test script has a hardcoded default advertiser account ID, and no cleanup or retention guidance is provided.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ad-agent-test
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ad-agent-test 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
ad-agent-test v1.0.0 - Initial release for automated UX testing of 腾讯广告投放Agent via Playwright and cookie injection. - Covers full experience testing: quick commands, command panel, free conversation, and "妙招" features. - Includes user guidance for cookie acquisition, detailed test steps, and screenshot requirements. - Generates structured UX reports in Markdown and uploads to WeCom smartpage. - Notes environment prerequisites, element selectors, and handling of expiring cookies.
元数据
Slug ad-agent-test
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

投放Agent自动化体验测试 是什么?

投放Agent(ad.qq.com/atlas/{account_id}/agent)自动化体验测试技能。 通过Cookie注入+Playwright浏览器自动化,对投放Agent的对话功能、快捷指令、常用指令面板、自由对话、妙招功能进行完整体验测试,并生成UX体验报告。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 57 次。

如何安装 投放Agent自动化体验测试?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ad-agent-test」即可一键安装,无需额外配置。

投放Agent自动化体验测试 是免费的吗?

是的,投放Agent自动化体验测试 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

投放Agent自动化体验测试 支持哪些平台?

投放Agent自动化体验测试 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 投放Agent自动化体验测试?

由 qiliwei411-cloud(@qiliwei411-cloud)开发并维护,当前版本 v1.0.0。

💬 留言讨论