Manual Test Case to Playwright Spec

    1

    Turns a manual test case into a Playwright spec, then runs it to prove it matches what was actually observed in the app.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Manual Test Case to Playwright Spec

    Example session with this skill installed

    Convert this manual test case into a Playwright spec:

    Title: Remove a product from the cart
    Precondition: logged in as "standard_user", "Sauce Labs Backpack" is in the cart.

    1. Open the cart | Cart page lists "Sauce Labs Backpack"
    2. Click "Remove" on "Sauce Labs Backpack" | The item disappears from the cart
    3. Look at the cart icon in the header | No cart badge is shown
    • Read your context and instructions
    • Compiled the manual test case

    Summary

    The agent walked through the case in a real browser first, wrote one spec, ran it, and the run matched what it had observed. This is the output of a real session against the public SauceDemo app.

    Observed in the app

    1. Open the cart: the cart page listed "Sauce Labs Backpack".
    2. Click "Remove": the item disappeared from the cart.
    3. Look at the cart icon: no badge was shown.

    Generated spec (tests/generated/remove-a-product-from-the-cart.spec.ts)

    import { test, expect, type Page } from '@playwright/test';
    import { qase } from 'playwright-qase-reporter';
    
    async function stepEvidence(page: Page, name: string) {
      qase.attach({ name: `${name}.png`, content: await page.screenshot(), contentType: 'image/png' });
    }
    
    test('Remove a product from the cart', async ({ page }) => {
      // Precondition: logged in as "standard_user", "Sauce Labs Backpack" is in the cart.
      await page.goto('/');
      await page.getByRole('textbox', { name: 'Username' }).fill('standard_user');
      await page.getByRole('textbox', { name: 'Password' }).fill(process.env.SAUCE_PASSWORD ?? '');
      await page.getByRole('button', { name: 'Login' }).click();
      await expect(page).toHaveURL(/\/inventory\.html$/);
      await page
        .getByTestId('inventory-item')
        .filter({ hasText: 'Sauce Labs Backpack' })
        .getByRole('button', { name: 'Add to cart' })
        .click();
      await expect(page.getByTestId('shopping-cart-badge')).toHaveText('1');
    
      const cartItems = page.getByTestId('inventory-item');
      const backpack = cartItems.filter({ hasText: 'Sauce Labs Backpack' });
    
      await test.step('Open the cart', async () => {
        await page.getByTestId('shopping-cart-link').click();
        await expect(page).toHaveURL(/\/cart\.html$/);
        // Expected result: cart page lists "Sauce Labs Backpack".
        await expect(backpack).toHaveCount(1);
        await stepEvidence(page, 'step-1');
      });
    
      await test.step('Click "Remove" on "Sauce Labs Backpack"', async () => {
        await backpack.getByRole('button', { name: 'Remove' }).click();
        // Expected result: the item disappears from the cart.
        await expect(backpack).toHaveCount(0);
        await stepEvidence(page, 'step-2');
      });
    
      await test.step('Look at the cart icon in the header', async () => {
        // Expected result: no cart badge is shown.
        await expect(page.getByTestId('shopping-cart-badge')).toHaveCount(0);
        await stepEvidence(page, 'step-3');
      });
    });
    

    Note: the project used in this session attaches a screenshot per step through its own reporter, so the agent followed that convention (stepEvidence). The skill itself does not require any reporter.

    Summary table

    CaseSpec fileObservedSpec runVerified
    Remove a product from the carttests/generated/remove-a-product-from-the-cart.spec.tspassedpassed (6.1s)yes

    Notes from the agent

    • Environment variable needed: SAUCE_PASSWORD.
    • Proposed case edits: none.
    • While checking the case, the first "Add to cart" click in the browser tool did not register, so the cart stayed empty. The agent retried from a fresh state and reported it instead of hiding it.

    Next steps

    • Review the spec in a pull request like any other test.
    • Add it to your regression run.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Give your agent a manual test case (steps + expected results) and get back a Playwright Test spec a reviewer can map to the case line by line.

    What it does

    • Observes the real app first, then writes the spec. Selectors come from the page, never invented.
    • One test.step() per manual step, using the same step text, so a failure points at the exact manual step.
    • Asserts every expected result with web-first assertions. No waitForTimeout, no hard-coded secrets, relative URLs.
    • Runs the spec and checks it against the observed outcome: a pass must pass, and a real bug must fail on the same expected result.
    • Never weakens an assertion to get a green run. A case that fails because of an app bug stays red and is tagged @known-bug.
    • If a spec for the case already exists, it stops and asks: review it or rewrite it.
    • If the app cannot be observed, the spec is labelled "unverified" instead of being presented as working.
    • Ends with a summary table: case, spec file, observed outcome, spec run, verified.

    What you need

    • An existing Playwright Test project (TypeScript).
    • A way for the agent to see the app, for example the Playwright MCP server.

    What's inside

    • SKILL.md: workflow and rules.
    • templates/spec-template.ts: the structure every generated spec follows.
    • references/worked-example.md: two cases converted end to end, one passing and one failing on a real bug.

    The skill is instructions and a template only: no scripts, no network calls of its own, no credentials.

    Tested with Claude Code and the Playwright MCP server.

    Needs an existing Playwright Test project (TypeScript) with a playwright config. Cannot verify a spec without a way to see the app (browser tool, reachable app, or page snapshots); such specs are labelled unverified. Converts one case at a time. Tested only with Claude Code and the Playwright MCP server.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 2 days ago

    • Free with an Agensi account

    Requires

    Playwright
    Node.js

    Permissions

    Terminal / Shell
    Browser
    Environment Variables
    Read Files
    Write Files

    Terminal: runs `npx playwright test <file>` to verify the spec. Browser: observes the app under test before writing the spec. Read/Write Files: reads playwright.config and writes one spec file. Environment Variables: generated specs read test credentials from process.env instead of hard-coding them. The skill ships no scripts.

    Listed2 days ago

    What's inside

    Frequently Asked Questions

    The skill generates TypeScript-based Playwright specs that wrap every manual step in a `test.step()` block. This ensures your code exactly matches your test management documentation, making audits and maintenance much simpler.

    The agent uses a Playwright MCP to interact with your live application, prioritizing accessible roles, labels, and test IDs. It then runs the generated spec to verify that the selectors work in your specific environment before finalizing the file.

    The skill is written for Playwright Test with TypeScript and reads your existing `playwright.config` for `baseURL`, `testDir` and `testIdAttribute`. The agent also needs a way to see the app, for example the Playwright MCP server. Without that it can still write a spec, but labels it unverified.

    If a step runs but the app behaves differently from the expected result, the case is recorded as failed and the spec is written to fail on that same expected result. It stays red until the app is fixed and is tagged `@known-bug` so you can exclude it from CI. The agent does not weaken the assertion. If the spec and the observation disagree, it fixes locators up to three times, then marks the test `test.fixme()` and flags it for a human.

    Three files: `SKILL.md` with the workflow and rules, a spec template, and a worked example with one passing case and one case that fails on a real bug. There are no scripts and nothing to install beyond your own Playwright project. The skill is free.

    New in Testing & Debugging