Token导航 LogoToken导航

Agent Skill · 研究检索

playwright-e2e-tests(Playwright E2E tests 搜索)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

playwright-e2e-tests 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 40,251。

总安装 1,309周安装 54GitHub Stars 28,825下载 428核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:playwright-e2e-tests(Playwright E2E tests 搜索)
来源仓库:https://github.com/onyx-dot-app/onyx
仓库路径:skills/playwright-e2e-tests
安装命令:
npx skills add https://github.com/onyx-dot-app/onyx --skill playwright-e2e-tests
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/onyx-dot-app/onyx --skill playwright-e2e-tests

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助测试设计、自动化测试、用例整理和回归验证。适合编写单元测试、端到端测试或根据失败日志定位问题。使用时需确认项目测试框架、运行命令和夹具数据,避免误改逻辑。涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

playwright-e2e-tests 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/playwright-e2e-tests

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/onyx-dot-app/onyx --skill playwright-e2e-tests;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

playwright-e2e-tests 怎么安装?

在终端执行 npx skills add https://github.com/onyx-dot-app/onyx --skill playwright-e2e-tests。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

playwright-e2e-tests 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

playwright-e2e-tests 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

playwright-e2e-tests 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

playwright-e2e-tests 用的人多吗?

公开数据是累计安装 1,309 次,近一周安装 54 次,下载 428 次,GitHub 28,825 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

playwright-e2e-tests 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 28,825 星,维护活跃度相对可查。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
playwright-e2e-tests

Playwright E2E tests 搜索 · 本页

1,30928,825操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Playwright E2E Tests

Project Layout

  • Tests: web/tests/e2e/ — organized by feature (auth/, admin/, chat/, assistants/, connectors/, mcp/)
  • Config: web/playwright.config.ts
  • Utilities: web/tests/e2e/utils/
  • Constants: web/tests/e2e/constants.ts
  • Global setup: web/tests/e2e/global-setup.ts
  • Output: web/output/playwright/

Imports

Always use absolute imports with the @tests/e2e/ prefix — never relative paths (../, ../../). The alias is defined in web/tsconfig.json and resolves to web/tests/.

import { loginAs } from "@tests/e2e/utils/auth";
import { OnyxApiClient } from "@tests/e2e/utils/onyxApiClient";
import { TEST_ADMIN_CREDENTIALS } from "@tests/e2e/constants";

All new files should be .ts, not .js.

Running Tests

# Run a specific test file
npx playwright test web/tests/e2e/chat/default_assistant.spec.ts

# Run a specific project
npx playwright test --project admin
npx playwright test --project exclusive

Test Projects

ProjectDescriptionParallelism
adminStandard tests (excludes @exclusive)Parallel
exclusiveSerial, slower tests (tagged @exclusive)1 worker

All tests use admin_auth.json storage state by default (pre-authenticated admin session).

Authentication

Global setup (global-setup.ts) runs automatically before all tests and handles:

  • Server readiness check (polls health endpoint, 60s timeout)
  • Provisioning test users: admin, admin2, and a pool of worker users (worker0@example.com through worker7@example.com) (idempotent)
  • API login + saving storage states: admin_auth.json, admin2_auth.json, and worker{N}_auth.json for each worker user
  • Setting display name to "worker" for each worker user
  • Promoting admin2 to admin role
  • Ensuring a public LLM provider exists

Both test projects set storageState: "admin_auth.json", so every test starts pre-authenticated as admin with no login code needed.

When a test needs a different user, use API-based login — never drive the login UI:

import { loginAs } from "@tests/e2e/utils/auth";

await page.context().clearCookies();
await loginAs(page, "admin2");

// Log in as the worker-specific user (preferred for test isolation):
import { loginAsWorkerUser } from "@tests/e2e/utils/auth";
await page.context().clearCookies();
await loginAsWorkerUser(page, testInfo.workerIndex);

Test Structure

Tests start pre-authenticated as admin — navigate and test directly:

import { test, expect } from "@playwright/test";

test.describe("Feature Name", () => {
  test("should describe expected behavior clearly", async ({ page }) => {
    await page.goto("/app");
    await page.waitForLoadState("networkidle");
    // Already authenticated as admin — go straight to testing
  });
});

User isolation — tests that modify visible app state (creating assistants, sending chat messages, pinning items) should run as a worker-specific user and clean up resources in afterAll. Global setup provisions a pool of worker users (worker0@example.com through worker7@example.com). loginAsWorkerUser maps testInfo.workerIndex to a pool slot via modulo, so retry workers (which get incrementing indices beyond the pool size) safely reuse existing users. This ensures parallel workers never share user state, keeps usernames deterministic for screenshots, and avoids cross-contamination:

import { test } from "@playwright/test";
import { loginAsWorkerUser } from "@tests/e2e/utils/auth";

test.beforeEach(async ({ page }, testInfo) => {
  await page.context().clearCookies();
  await loginAsWorkerUser(page, testInfo.workerIndex);
});

If the test requires admin privileges *and* modifies visible state, use "admin2" instead — it's a pre-provisioned admin account that keeps the primary "admin" clean for other parallel tests. Switch to "admin" only for privileged setup (creating providers, configuring tools), then back to the worker user for the actual test. See chat/default_assistant.spec.ts for a full example.

loginAsRandomUser exists for the rare case where the test requires a brand-new user (e.g. onboarding flows). Avoid it elsewhere — it produces non-deterministic usernames that complicate screenshots.

API resource setup — only when tests need to create backend resources (image gen configs, web search providers, MCP servers). Use beforeAll/afterAll with OnyxApiClient to create and clean up. See chat/default_assistant.spec.ts or mcp/mcp_oauth_flow.spec.ts for examples. This is uncommon (~4 of 37 test files).

Key Utilities

OnyxApiClient (@tests/e2e/utils/onyxApiClient)

Backend API client for test setup/teardown. Key methods:

  • Connectors: createFileConnector(), deleteCCPair(), pauseConnector()
  • LLM Providers: ensurePublicProvider(), createRestrictedProvider(), setProviderAsDefault()
  • Assistants: createAssistant(), deleteAssistant(), findAssistantByName()
  • User Groups: createUserGroup(), deleteUserGroup(), setUserRole()
  • Tools: createWebSearchProvider(), createImageGenerationConfig()
  • Chat: createChatSession(), deleteChatSession()

chatActions (@tests/e2e/utils/chatActions)

  • sendMessage(page, message) — sends a message and waits for AI response
  • startNewChat(page) — clicks new-chat button and waits for intro
  • verifyDefaultAssistantIsChosen(page) — checks Onyx logo is visible
  • verifyAssistantIsChosen(page, name) — checks assistant name display
  • switchModel(page, modelName) — switches LLM model via popover

visualRegression (@tests/e2e/utils/visualRegression)

  • expectScreenshot(page, {name, mask?, hide?, fullPage?})
  • expectElementScreenshot(locator, {name, mask?, hide?})
  • Controlled by VISUAL_REGRESSION=true env var

theme (@tests/e2e/utils/theme)

  • THEMES — ["light", "dark"] as const array for iterating over both themes
  • setThemeBeforeNavigation(page, theme) — sets next-themes theme via localStorage before navigation

When tests need light/dark screenshots, loop over THEMES at the test.describe level and call setThemeBeforeNavigation in beforeEach before any page.goto(). Include the theme in screenshot names. See admin/admin_pages.spec.ts or chat/chat_message_rendering.spec.ts for examples:

import { THEMES, setThemeBeforeNavigation } from "@tests/e2e/utils/theme";

for (const theme of THEMES) {
  test.describe(`Feature (${theme} mode)`, () => {
    test.beforeEach(async ({ page }) => {
      await setThemeBeforeNavigation(page, theme);
    });

    test("renders correctly", async ({ page }) => {
      await page.goto("/app");
      await expectScreenshot(page, { name: `feature-${theme}` });
    });
  });
}

tools (@tests/e2e/utils/tools)

  • TOOL_IDS — centralized data-testid selectors for tool options
  • openActionManagement(page) — opens the tool management popover

Locator Strategy

Use locators in this priority order:

  1. data-testid / aria-label — preferred for Onyx components page.getByTestId("AppSidebar/new-session") page.getByLabel("admin-page-title")
  2. Role-based — for standard HTML elements page.getByRole("button", {name: "Create"}) page.getByRole("dialog")
  3. Text/Label — for visible text content page.getByText("Custom Assistant") page.getByLabel("Email")
  4. CSS selectors — last resort, only when above won't work page.locator('input[name="name"]') page.locator("#onyx-chat-input-textarea")

Never use page.locator with complex CSS/XPath when a built-in locator works.

Assertions

Use web-first assertions — they auto-retry until the condition is met:

// Visibility
await expect(page.getByTestId("onyx-logo")).toBeVisible({ timeout: 5000 });

// Text content
await expect(page.getByTestId("assistant-name-display")).toHaveText("My Assistant");

// Count
await expect(page.locator('[data-testid="onyx-ai-message"]')).toHaveCount(2, { timeout: 30000 });

// URL
await expect(page).toHaveURL(/chatId=/);

// Element state
await expect(toggle).toBeChecked();
await expect(button).toBeEnabled();

Never use assert statements or hardcoded page.waitForTimeout().

Waiting Strategy

// Wait for load state after navigation
await page.goto("/app");
await page.waitForLoadState("networkidle");

// Wait for specific element
await page.getByTestId("chat-intro").waitFor({ state: "visible", timeout: 10000 });

// Wait for URL change
await page.waitForFunction(() => window.location.href.includes("chatId="), null, { timeout: 10000 });

// Wait for network response
await page.waitForResponse(resp => resp.url().includes("/api/chat") && resp.status() === 200);

Best Practices

  1. Descriptive test names — clearly state expected behavior: "should display greeting message when opening new chat"
  2. API-first setup — use OnyxApiClient for backend state; reserve UI interactions for the behavior under test
  3. User isolation — tests that modify visible app state (sidebar, chat history) should run as the worker-specific user via loginAsWorkerUser(page, testInfo.workerIndex) (not admin) and clean up resources in afterAll. Each parallel worker gets its own user, preventing cross-contamination. Reserve loginAsRandomUser for flows that require a brand-new user (e.g. onboarding)
  4. DRY helpers — extract reusable logic into utils/ with JSDoc comments
  5. No hardcoded waits — use waitFor, waitForLoadState, or web-first assertions
  6. Parallel-safe — no shared mutable state between tests. Prefer static, human-readable names (e.g. "E2E-CMD Chat 1") and clean up resources by ID in afterAll. This keeps screenshots deterministic and avoids needing to mask/hide dynamic text. Only fall back to timestamps (\test-${Date.now()}``) when resources cannot be reliably cleaned up or when name collisions across parallel workers would cause functional failures
  7. Error context — catch and re-throw with useful debug info (page text, URL, etc.)
  8. Tag slow tests — mark serial/slow tests with @exclusive in the test title
  9. Visual regression — use expectScreenshot() for UI consistency checks
  10. Minimal comments — only comment to clarify non-obvious intent; never restate what the next line of code does

平台分布

Codex

37.64%
按下载量换算161

Claude

29.47%
按下载量换算126

Cursor

16.59%
按下载量换算71

Gemini CLI

9.66%
按下载量换算41

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills