script-to-bdd-converter

script-to-bdd-converter is a cursor rule for Cursor from azam-sdet/10xquality. It costs 16 tokens per session (1,529 once invoked), scanned A, original, MIT.

A converter that turns recorded, plain-language browser test steps into Playwright and Cucumber BDD tests. BDD (behavior-driven development) describes tests in readable Given/When/Then form.

In plain words
What is it for?
Converting files in scripts/ into page objects, feature files, and step definitions for Playwright and Cucumber tests.
Why use it?
It removes the need to manually rewrite recorded browser actions as automated test code. It also uses the recorded page and form details to organize tests around the pages they use.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import PlaywrightWrapper from '../../helper/wrapper/PlaywrightWrappers';.

Good fit Converting files in scripts/ into page objects, feature files, and step definitions for Playwright and Cucumber tests.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/azam-sdet/10xquality
agentmods
npx agentmods add rules/azam-sdet/10xquality/script-to-bdd-converter

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for script-to-bdd-converter

README.md
[![agentmods](https://agentmods.dev/badge/rules/azam-sdet/10xquality/script-to-bdd-converter.svg)](https://agentmods.dev/rules/azam-sdet/10xquality/script-to-bdd-converter)
Your own site
<a href="https://agentmods.dev/rules/azam-sdet/10xquality/script-to-bdd-converter"><img src="https://agentmods.dev/badge/rules/azam-sdet/10xquality/script-to-bdd-converter.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,529 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00016 $0.01529
Opus 5 $0.00008 $0.00764
Sonnet 5 $0.00003 $0.00306
Haiku 4.5 $0.00002 $0.00153

Measured 7d ago against content hash ae6bc5d7d994, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

script-to-bdd-converter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/script-to-bdd-converter.mdc · 170 lines

How it starts

The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Script-to-BDD Converter

When the user asks to convert a recorded script to Playwright + Cucumber tests, follow this protocol. The goal is to generate tests that pass on the first run by using the rich metadata captured during recording.

Conversion Workflow

Step 1: Read the Recorded Script

Read the scripts/<name>.md file. It contains:

  • Steps with (hint: ...) blocks that have locator metadata
  • A ## Form Fields Summary section with all form controls and their attributes
  • Auth credentials, base URL, and pre-requisites

Step 2: Identify Pages (Page Object Decomposition)

Group steps by the URL they operate on. Each distinct page/URL becomes a Page Object:

URL Pattern Page Object
/login LoginPage
/dashboard DashboardPage
/settings SettingsPage
/users UsersPage
/users/create CreateUserPage
/users/:id UserDetailsPage

Step 3: Generate Page Objects

For each page, create src/test/pages/<PageName>.ts:

import { Page } from '@playwright/test';
import PlaywrightWrapper from '../../helper/wrapper/PlaywrightWrappers';
import Assert from '../../helper/wrapper/assert';

export default class ExamplePage {
  private static instance: ExamplePage;
  private page: Page;
  base: PlaywrightWrapper;
  assert: Assert;

  private constructor(page: Page) {
    this.page = page;
    this.base = PlaywrightWrapper.getInstance(page);
    this.assert = Assert.getInstance(page);
  }

  public static getInstance(page: Page): ExamplePage {
    if (!ExamplePage.instance) {
      ExamplePage.instance = new ExamplePage(page);
    }
    return ExamplePage.instance;
  }
  // ... methods
}

Step 4: Build Locators from Recorded Hints

This is the most critical step. For each element interaction in the recorded script, choose the locator strategy using the hint metadata:

Decision tree for locator selection:
1. Does the hint have locators.name? → Use `input[name="..."]`
2. Does the hint have locators.id? → Use `#id`
3. Is the element a form dropdown with fieldLabel?
   → Use label-based ancestor navigation (see pattern below)
4. Does the hint have locators.dataTest and ambiguity.sameDataTest === 1?
   → Use `[data-test="..."]`
5. Is the text unique (ambiguity.sameText === 1)?
   → Use `text=...` or `button:has-text("...")`
6. Text is NOT unique (ambiguity.sameText > 1)?
   → MUST use fieldLabel + ancestor navigation to disambiguate

Read the full file on GitHub · 170 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 170 lines · 16 tokens per session scan A ae6bc5d7d994

Subscribe to this mod's changes

script-to-bdd-converter is a cursor rule published in the GitHub repository azam-sdet/10xquality (2 stars, last pushed 6mo ago), licensed MIT. It adds 16 tokens to every session and 1,529 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.