/quality-skills:testcafefrom quality-skills
Designs, implements, debugs, and migrates TestCafe tests using its Node-based proxy instead of WebDriver. Covers fixtures, selectors, assertions, and runner options.
Ships in quality-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in TestCafe. Your goal is to help engineers write and maintain TestCafe tests, and to be honest about TestCafe's position in 2026: it is a working, mature tool, but its market share has shrunk significantly versus Playwright and Cypress. Do not fabricate selector methods, runner options, or CLI flags. When uncertain, point the reader to the official TestCafe docs.
Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:
If the file does not exist, ask: existing suite or new project, languages, target browsers, and what attracted them to TestCafe.
t.expect(selector.innerText).eql(...) retries until it passes or times out.--concurrency N runs N browser instances in parallel on one machine.When not to use TestCafe:
import { Selector } from 'testcafe';
fixture`Login`
.page`https://staging.example.com/login`;
test('signs in with valid credentials', async t => {
await t
.typeText(Selector('[data-test="email"]'), '[email protected]')
.typeText(Selector('[data-test="password"]'), 'Pa$$w0rd-fake')
.click(Selector('[data-test="sign-in"]'))
.expect(Selector('[data-test="welcome"]').exists).ok();
});
A fixture groups tests with a shared starting URL, hooks, and metadata. The test block is a single test. The t test controller is the API surface.
Selector(...) is the unit of element location. Selectors are lazy, chainable, and auto-retry.
const signIn = Selector('[data-test="sign-in"]');
const errorBanner = Selector('.error').withText('Invalid credentials');
const thirdProduct = Selector('.product-card').nth(2);
Selectors support .withText, .withAttribute, .find, .parent, .nth, .filter for compositional queries.
t.expect(...) returns a chain that retries until match or timeout:
await t.expect(Selector('[data-test="cart-count"]').innerText).eql('3');
await t.expect(Selector('.error').exists).notOk();
Assertion timeout is configurable per assertion ({ timeout: 5000 }) or in .testcaferc.json.
Role captures a logged-in state once and reuses it across tests:
import { Role, Selector } from 'testcafe';
const qaUser = Role('https://staging.example.com/login', async t => {
await t
.typeText('[data-test="email"]', '[email protected]')
.typeText('[data-test="password"]', 'Pa$$w0rd-fake')
.click('[data-test="sign-in"]');
});
test('shows dashboard', async t => {
await t.useRole(qaUser);
await t.expect(Selector('[data-test="welcome"]').exists).ok();
});
Roles cache cookies/storage internally; subsequent useRole calls restore state without re-running the setup.
ClientFunction runs code in the browser. Use for state that isn't easily expressed as a DOM query.
const getUrl = ClientFunction(() => window.location.href);
await t.expect(getUrl()).contains('/dashboard');
RequestLogger and RequestMock provide request observation and stubbing.
.testcaferc.json)Real fields. Verify against your installed version.
{
"browsers": ["chrome:headless"],
"src": ["./tests/**/*.test.ts"],
"concurrency": 3,
"screenshots": {
"path": "./screenshots",
"takeOnFails": true,
"fullPage": true
},
"videoPath": "./videos",
"selectorTimeout": 10000,
"assertionTimeout": 5000,
"pageLoadTimeout": 30000,
"reporter": [
{ "name": "spec" },
{ "name": "xunit", "output": "report.xml" }
]
}
Alternative: .testcaferc.js (programmatic) or .testcaferc.cjs.
| Command | Purpose |
|---|---|
npx testcafe chrome tests/ | Run all tests in Chrome. |
npx testcafe chrome:headless tests/login.test.ts | Headless, one file. |
npx testcafe "chrome,firefox" tests/ | Multiple browsers sequentially. |
npx testcafe chrome tests/ --concurrency 3 | Three Chrome instances in parallel. |
npx testcafe all tests/ | All installed browsers TestCafe can detect. |
npx testcafe -L | List the browsers TestCafe sees. |
npx testcafe chrome tests/ -e | Stop on first failure. |
npx testcafe chrome tests/ -t "test name" | Filter by test name. |
Verify flags with npx testcafe --help against your installed version.
chrome:headless, firefox:headless use the browser's native headless mode.chrome:emulation:device=iPhone 13 for device emulation.chrome:headless --no-sandbox (note: actual flag passing differs from Selenium — refer to docs for browser argument syntax).testcafe/testcafe Docker image works for CI but verify it's still maintained at your time of use.await — every t.* and Selector().* returning a promise must be awaited.Selector objects across navigations — selectors are lazy and usually fine, but if you stored a resolved DOM snapshot via .with(...), re-query after navigation.ClientFunction — pass them via dependencies ({ dependencies: { x } }).t.switchToIframe(...) is the API; t.switchToMainWindow() to leave. For cross-origin frames, behavior can be inconsistent — verify in your target environment.t.wait(ms) — replace with selector-based polling or assertion retries.selectorTimeout and assertionTimeout — defaults are aggressive (10s / 3s respectively, depending on version). If real network calls take longer, raise these explicitly rather than masking with retries.Selector ≈ locator, Role ≈ storageState), but the APIs differ. Don't paste Playwright code into TestCafe.When helping with TestCafe, ask:
--concurrency locally and matrix in CI?Role for auth reuse, or logging in per test?--concurrency is per-machine only).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub aks-builds/quality-skills --plugin quality-skills56 skills in this plugin
/accessibility-testingWhen the user wants to design, implement, or operate accessibility (a11y) testing — automated scans, manual audits, screen-reader testing, WCAG conformance, Section 508 / EAA compliance. Use when the user mentions "accessibility," "a11y," "WCAG," "Section 508," "EAA," "ADA compliance," "axe," "axe-core," "pa11y," "Lighthouse," "aXe DevTools," "screen reader," "NVDA," "JAWS," "VoiceOver," "TalkBack," "WAVE," or "AT testing." For visual diff see visual-regression. For overall test strategy see test-strategy./ai-augmented-testingWhen the user wants to evaluate, adopt, or operate AI-augmented testing tools and approaches — autonomous test generation, self-healing locators, AI-assisted authoring, vision-based testing, agentic test runners. Use when the user mentions "AI testing," "AI-augmented testing," "Testim," "Mabl," "Functionize," "Reflect," "TestRigor," "Tricentis Copilot," "Cypress AI," "Playwright codegen with AI," "AI test generation," "self-healing tests," or "vision-based test automation." For LLM-product evals see llm-eval-testing. For overall strategy see test-strategy./appiumWhen the user wants to design, implement, debug, or scale Appium tests for iOS and Android mobile automation. Use when the user mentions "Appium," "Appium 2," "UiAutomator2," "XCUITest driver," "appium:capabilities," "AppiumServer," "accessibility id," "TouchAction," "W3C Actions," "Appium inspector," "real device cloud," or "App Center / BrowserStack / Sauce mobile." For Android-native frameworks see espresso. For iOS-native see xcuitest. For React Native specifically see detox. For YAML-driven mobile flows see maestro. For desktop web automation see selenium / playwright / webdriverio.