From jx-qa
Reads an xlsx test plan and generates Playwright TypeScript spec files by live-exploring the site with playwright-cli. Use this skill whenever the user wants to generate, create, or write Playwright tests from a test plan, spreadsheet, or structured test cases — even if they just say "write the tests" or "generate the specs" without mentioning the xlsx. Also triggers on /jx-qa:generate, "write playwright tests", "generate tests from test plan", "generate playwright tests from test cases", or any request to automate test case generation from a plan file.
How this skill is triggered — by the user, by Claude, or both
Slash command
/jx-qa:generateThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill turns a structured xlsx test plan into runnable Playwright TypeScript spec files. It works by:
This skill turns a structured xlsx test plan into runnable Playwright TypeScript spec files. It works by:
Heads up: Each test case takes a few minutes — the skill opens a real browser and explores the live site to find the right locators.
First, find the xlsx file using a two-stage approach:
Stage A — glob:
ls test-plans/*.xlsx 2>/dev/null
Stage B — parse from user's message:
.xlsx filename in what the user typedOnce you have the xlsx path, parse it:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/xlsx-writer.py" read <path-to-xlsx>
Output is a JSON array of arrays. First element is the header row (column names),
remaining elements are data rows. Map each data row to an object using headers
as keys to reconstruct {Title, "Test Step", "Step Action", "Step Expected", ...}.
The xlsx uses a hierarchical row structure:
Title value (e.g., "Check Logo in Homepage") — this is a test case headerTest Step number plus Step Action and Step Expected — these are the steps for the preceding parentGroup child rows under their most recent parent to reconstruct each test case with its ordered steps.
ls tests/
For each test case, derive its target filename using this rule:
title.toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '') + '.spec.ts'
Example: "Check Logo in Homepage" → check-logo-in-homepage.spec.ts
If the derived filename already exists in tests/, skip that test case and tell the user it was skipped. This makes the skill idempotent — safe to re-run without overwriting existing specs.
For each test case without an existing spec:
playwright-cli open
playwright-cli goto <URL from the first step's Step Action>
playwright-cli snapshot
For each step in Step Action:
Building assertions — there are two patterns:
Generic step ("Verify step completes successfully"): Find the element most relevant to what the step was doing. Run playwright-cli generate-locator <ref> and use it with toBeVisible().
Specific text assertion (e.g., "This text should be visible 'Casa Colina Care LLC. All rights reserved.'"): Take a snapshot of the containing region (like the footer). Find the ref whose visible text matches the expected string. Run playwright-cli generate-locator <ref> and use it with toHaveText('...').
The reason to use generate-locator rather than copying refs directly is that it produces semantic, stable locators like page.getByRole('contentinfo') instead of fragile positional refs. Semantic locators survive minor DOM changes.
playwright-cli close
Write tests/<derived-filename>.spec.ts:
Line 3 MUST be
// Test Case TBD - <Title>exactly. The wordTBDcannot be omitted — it is the placeholder that ADO Work Item linking replaces later. A comment like// Test Case - Title(missingTBD) will silently break the linking pipeline.
import { test, expect } from '@playwright/test';
// Test Case TBD - <Title>
test('<short lowercase description of what the test checks>', async ({ page }) => {
await page.goto('<URL>');
// assertions derived from steps
});
Format is always // Test Case TBD - <exact title from xlsx>.
Keep the test description concise and readable — something like 'footer shows copyright notice' rather than restating the full test case title.
Run the new spec to confirm it passes:
npx playwright test tests/<new-spec>.spec.ts
Report pass/fail. If it fails, inspect the error, fix the locators or assertions, and re-run.
Use tests/check-logo-in-homepage.spec.ts as the style reference:
import { test, expect } from '@playwright/test';
// Test Case 203397 - Check Logo in Homepage
test('logo renders in homepage header', async ({ page }) => {
await page.goto('https://casacolinacare-com.vercel.app');
const header = page.getByRole('banner');
await expect(header).toBeVisible();
const logo = header.getByRole('link', { name: 'Casa Colina Care' });
await expect(logo).toBeVisible();
});
Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub jairosoft-com/jodex-plugins --plugin jx-qa