Skip to main content
skill CX Codex

testcafe-skill — Claude Code skill: tests and installation

Generate TestCafe end-to-end tests in JavaScript or TypeScript, from login flows to selector checks. The skill covers local runs and TestMu AI Cloud.

MIT 212 installs ★ 393 updated 2026-10-13

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add LambdaTest/agent-skills --skill testcafe-skill -a claude-code
Open on GitHub

What testcafe-skill does

The skill helps write TestCafe tests using chained actions, selectors, and page models. Ask for a login flow, a check that an element exists, or a class that keeps form fields and actions together. Its run examples use npx testcafe.

Run tests locally in Chrome, in headless mode, or across multiple browsers. For TestMu AI Cloud, the example sets LT_USERNAME and LT_ACCESS_KEY before starting Chrome on Windows 11. The cloud command depends on those credentials.

It also recommends smart assertions instead of fixed waits and taking a screenshot when a test fails. More debugging and CI/CD guidance lives in reference/playbook.md.

What it helps with

  • write a website login test
  • choose selectors for page elements
  • move form interactions into a page model
  • run tests in Chrome or several browsers
  • configure TestCafe tests for TestMu AI Cloud

Example prompts for the agent

  • Write a TestCafe test for signing in through the login page form.
  • Check the text of a list element using a TestCafe selector.
  • Set up a TestMu AI Cloud run for the tests/ directory.

How to install testcafe-skill

1Skills CLI (Vercel)

npx skills add LambdaTest/agent-skills --skill testcafe-skill -a claude-code

2Manually: put the files in place

~/.claude/skills/testcafe-skill/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/testcafe-skill/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about testcafe-skill

How do I install testcafe-skill in Claude Code?

Run npx skills add LambdaTest/agent-skills --skill testcafe-skill -a claude-code. The skill file is at ~/.claude/skills/testcafe-skill/SKILL.md.

What does testcafe-skill do?

It helps create TestCafe end-to-end tests in JavaScript or TypeScript, work with selectors and page models, and run tests locally or on TestMu AI Cloud.

What do I need to run tests on TestMu AI Cloud?

Set LT_USERNAME and LT_ACCESS_KEY, then run npx testcafe "lambdatest:Chrome@latest:Windows 11" tests/.

Source text

SKILL.md · MIT
---
name: testcafe-skill
description: >
  Generates TestCafe automation tests in JavaScript or TypeScript. Supports local
  and TestMu AI cloud. Triggers on: "TestCafe", "test cafe", "fixture/test".
languages:
  - JavaScript
  - TypeScript
category: e2e-testing
license: MIT
metadata:
  author: TestMu AI
  version: "1.0"
---

# TestCafe Automation Skill

## Core Patterns

### Basic Test

```javascript
import { Selector } from 'testcafe';

fixture('Login').page('https://example.com/login');

test('Login with valid credentials', async t => {
    await t
        .typeText('#username', '[email protected]')
        .typeText('#password', 'password123')
        .click('button[type="submit"]')
        .expect(Selector('.dashboard').exists).ok();
});
```

### Selectors

```javascript
const submitBtn = Selector('button').withText('Submit');
const listItems = Selector('.item').count;
const nthItem = Selector('.item').nth(2);
const filtered = Selector('.item').withAttribute('data-status', 'active');
```

### Page Model

```javascript
import { Selector, t } from 'testcafe';

class LoginPage {
    constructor() {
        this.usernameInput = Selector('#username');
        this.passwordInput = Selector('#password');
        this.submitButton = Selector('button[type="submit"]');
    }
    async login(username, password) {
        await t
            .typeText(this.usernameInput, username)
            .typeText(this.passwordInput, password)
            .click(this.submitButton);
    }
}
export default new LoginPage();
```

### TestMu AI Cloud

See [reference/cloud-integration.md](reference/cloud-integration.md) for full cloud setup and [shared/testmu-cloud-reference.md](../shared/testmu-cloud-reference.md) for capabilities.

```bash
export LT_USERNAME=your_username
export LT_ACCESS_KEY=your_key
npx testcafe "lambdatest:Chrome@latest:Windows 11" tests/
```

### Anti-Patterns

| Bad | Good | Why |
|-----|------|-----|
| `await t.wait(5000)` | Smart assertions with timeout | Arbitrary delays |
| Deep CSS selectors | `Selector().withText()` | Fragile |
| No error screenshots | `t.takeScreenshot()` on failure | Missing debug info |

## Quick Reference

| Task | Command |
|------|---------|
| Run all | `npx testcafe chrome tests/` |
| Run headless | `npx testcafe chrome:headless tests/` |
| Run specific | `npx testcafe chrome tests/login.js` |
| Multiple browsers | `npx testcafe chrome,firefox tests/` |
| Live mode | `npx testcafe chrome tests/ --live` |
| Screenshot | `await t.takeScreenshot()` |
| Resize | `await t.resizeWindow(1280, 720)` |

## Deep Patterns

For advanced patterns, debugging guides, CI/CD integration, and best practices,
see `reference/playbook.md`.

© TestMu AI · MIT · LambdaTest/agent-skills

Similar skills

All skills for Testing and QA →

From the same set47

The whole set →

Project sponsors

Companies that keep this analytics open