phoenix-pxi-playwright
БесплатноБез исполняемых скриптовНе проверенWrite, extend, and debug PXI Playwright E2E tests for Phoenix. Use when adding PXI agent frontend specs, authoring LLM-as-judge rubrics, asserting PXI tool…
от Arize-ai★ 12 510 звёзд на GitHubОб этом скилле
Phoenix PXI Playwright Tests
Use this skill when authoring or maintaining Playwright specs for PXI, Phoenix's built-in AI assistant. The concrete harness lives in js/app/tests/pxi/; this skill is the authoring guide for using and extending that harness.
Start Here
- Read the existing example spec first:
js/app/tests/pxi/docs-smoke.spec.ts. - Reuse the shared fixture and driver from
js/app/tests/pxi/fixtures.ts. - Reuse shared constants from
js/app/tests/pxi/constants.tsand shared types fromjs/app/tests/pxi/types.ts. - Put pure parsing/API helpers in
js/app/tests/pxi/utils.tsrather than in specs or fixture classes. - Reuse the generic AI SDK judge from
js/app/tests/pxi/judge.ts. - Reuse experiment persistence from
js/app/tests/pxi/experimentPersistence.ts. - Add one entry to
PXI_EXPERIMENT_EXAMPLESinjs/app/tests/pxi/experimentPersistence.tsfor every new PXI spec scenario. All specs share the same dataset, and the update upload treats that registry as the complete desired set of examples. - Do not create a bespoke PXI driver, duplicate experiment client, or duplicate PXI tool schemas in a spec.
Current Harness
The current harness provides these abstractions:
testandexpectfrom./fixtures: PXI-aware Playwright fixture exports.constants.ts: default assistant and judge model/project constants.types.ts: shared PXI harness types such asPxiTurn.utils.ts: pure utilities for API response validation and span/tool parsing.pxi.open(): opens PXI for the test session.pxi.acknowledgeConsent(): accepts PXI consent for the test session.pxi.askAndWait(prompt): sends a user prompt and waits for the assistant turn. It does not require a backend TOOL span; add explicit tool assertions in the spec.pxi.expectNoAgentError(): asserts the visible PXI session did not surface an agent error.pxi.expectBackendToolSpanCalled(turn): asserts the PXI turn produced at least one persisted backend TOOL span and merges those backend tool names intoturn.calledTools. Use this for server/MCP-backed tools such as docs tools, not for purely client-executed external tools.pxi.expectDocsToolCalled(turn): asserts the PXI turn used runtime docs tooling via Phoenix-observed tool spans.pxi.getMetadata(): collects PXI metadata for persistence.judge({ model, system, prompt, assistantText, rubric }): evaluates an assistant answer with AI SDKgenerateTextand structuredOutput.object.evaluatePxiOutcome({ assertions, judgeInput }): runs deterministic assertions and LLM judging while preserving failed post-turn outcomes for experiment persistence.assertPxiOutcome(outcome): fails the Playwright test after persistence, preferring the original deterministic assertion failure when one exists.persistPxiExperiment({ request, record }): stores the PXI interaction, judge result, and metadata as a Phoenix experiment.
Authoring Workflow
- Add the scenario prompt and expected output to
PXI_EXPERIMENT_EXAMPLESso the shared PXI E2E dataset gets one example per test scenario. - Put the scenario prompt, PXI user instructions, and judge rubric in the spec file so the test is readable top-to-bottom. Import the scenario from
PXI_EXPERIMENT_EXAMPLESrather than duplicating prompt strings. - Drive PXI through the real UI with
pxi.open,pxi.acknowledgeConsent, andpxi.askAndWait. - Add deterministic assertions before judge assertions, such as expected text, no agent error, or expected tool use.
- Put all post-turn deterministic assertions inside
evaluatePxiOutcome, includingpxi.expectBackendToolSpanCalled(turn), so failures after PXI returns an answer still get persisted. - After
pxi.askAndWaitreturns a turn, persist both passing and failing outcomes. Do not let deterministic assertion failures skip experiment persistence. - Use
evaluatePxiOutcomeinstead of writing per-spectry/catchblocks. It runsjudgeeven when deterministic Playwright assertions fail, then combines the judge explanation with a sanitized, truncated Playwright assertion message in the persisted failed evaluation. - Run the targeted spec with isolated ports before reporting success.
Spec Pattern
import {
persistPxiExperiment,
PXI_EXPERIMENT_EXAMPLES,
} from "./experimentPersistence";
import { expect, test } from "./fixtures";
import { getRequiredJudgeApiKeyEnv } from "./judge";
import { assertPxiOutcome, evaluatePxiOutcome } from "./outcome";
const EXPERIMENT_EXAMPLE = PXI_EXPERIMENT_EXAMPLES.someScenario;
const USER_PROMPT = EXPERIMENT_EXAMPLE.prompt;
const JUDGE_RUBRIC = [
"The answer satisfies the user request.",
"The answer is grounded in the expected Phoenix context.",
"The answer does not invent unsupported facts.",
];
const JUDGE_API_KEY_ENV = getRequiredJudgeApiKeyEnv();
test.describe("PXI scenario", () => {
test("handles the scenario", async ({
browserName,
page,
pxi,
request,
}, testInfo) => {
Установить phoenix-pxi-playwright в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл phoenix-pxi-playwright?
Write, extend, and debug PXI Playwright E2E tests for Phoenix. Use when adding PXI agent frontend specs, authoring LLM-as-judge rubrics, asserting PXI tool use, persisting PXI test runs as Phoenix experiments, or debugging PXI E2E failures.
Как установить скилл phoenix-pxi-playwright?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл phoenix-pxi-playwright запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic