Skip to main content
skill CX Codex

codeception-skill — Claude Code skill: how to install

Generates PHP Codeception acceptance, functional, and unit tests using BDD actor workflows. Useful for web interface validation and browser automation.

MIT 243 installs ★ 393 updated 2026-10-13

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

What codeception-skill does

This skill instructs the agent to structure PHP Codeception suites using the Actor pattern. It provides templates for Cest test classes, field inputs, form submissions, and element assertions via $I methods.

It covers Page Object patterns with static selectors to keep test logic maintainable. The reference configuration includes WebDriver settings for running browser tests against LambdaTest infrastructure.

Executing the generated tests requires codeception/codeception and codeception/module-webdriver installed in your project via Composer. Test suites run through php vendor/bin/codecept run acceptance.

What it helps with

  • generate Cest acceptance tests for user authentication and form submissions
  • organize page selectors and reusable actions into Page Object classes
  • configure WebDriver test runs for LambdaTest cloud browsers
  • verify page elements, URLs, and text content with Actor methods

Example prompts for the agent

  • Create a LoginCest Codeception test covering both valid and invalid login attempts
  • Generate a Page Object class for the checkout page with fill and submit methods
  • Prepare an acceptance.suite.yml configuration using the WebDriver module for Chrome

How to install codeception-skill

1Skills CLI (Vercel)

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

2Manually: put the files in place

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

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

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

Questions about codeception-skill

How to install codeception-skill in Claude Code?

Run npx skills add LambdaTest/agent-skills --skill codeception-skill -a claude-code.

What does codeception-skill do?

It guides coding agents to generate PHP Codeception test suites, including Cest classes, Page Objects, and Actor-based assertions.

What dependencies are required to run the tests?

You need codeception/codeception and codeception/module-webdriver installed as development dependencies in Composer.

Source text

SKILL.md · MIT
---
name: codeception-skill
description: >
  Generates Codeception tests in PHP covering acceptance, functional, and unit
  testing. BDD-style with Actor pattern. Use when user mentions "Codeception",
  "$I->amOnPage", "$I->see", "Cest". Triggers on: "Codeception", "$I->amOnPage",
  "AcceptanceTester", "Codeception PHP", "Cest".
languages:
  - PHP
category: e2e-testing
license: MIT
metadata:
  author: TestMu AI
  version: "1.0"
---

# Codeception Testing Skill

## Core Patterns

### Acceptance Test (Cest)

```php
<?php
// tests/Acceptance/LoginCest.php

class LoginCest
{
    public function _before(AcceptanceTester $I)
    {
        $I->amOnPage('/login');
    }

    public function loginWithValidCredentials(AcceptanceTester $I)
    {
        $I->fillField('email', '[email protected]');
        $I->fillField('password', 'password123');
        $I->click('Login');
        $I->see('Dashboard');
        $I->seeInCurrentUrl('/dashboard');
        $I->seeElement('.welcome-message');
    }

    public function loginWithInvalidCredentials(AcceptanceTester $I)
    {
        $I->fillField('email', '[email protected]');
        $I->fillField('password', 'wrong');
        $I->click('Login');
        $I->see('Invalid credentials');
        $I->seeInCurrentUrl('/login');
    }
}
```

### Actor Methods (AcceptanceTester $I)

```php
// Navigation
$I->amOnPage('/path');
$I->click('Button Text');
$I->click('#id');
$I->click(['xpath' => '//button']);

// Forms
$I->fillField('Name or Label', 'value');
$I->selectOption('Select', 'Option');
$I->checkOption('Checkbox');
$I->uncheckOption('Checkbox');
$I->attachFile('Upload', 'file.txt');
$I->submitForm('#form', ['email' => '[email protected]']);

// Assertions
$I->see('Text');
$I->dontSee('Text');
$I->seeElement('#id');
$I->dontSeeElement('.error');
$I->seeInField('email', '[email protected]');
$I->seeInCurrentUrl('/dashboard');
$I->seeInTitle('Page Title');
$I->seeCheckboxIsChecked('#agree');
$I->seeNumberOfElements('li', 5);

// Grabbers
$text = $I->grabTextFrom('.element');
$attr = $I->grabAttributeFrom('#link', 'href');
$value = $I->grabValueFrom('#input');
```

### Page Objects (Step Objects)

```php
<?php
// tests/_support/Page/Login.php
namespace Page;

class Login
{
    public static $url = '/login';
    public static $emailField = '#email';
    public static $passwordField = '#password';
    public static $loginButton = 'button[type="submit"]';

    protected $I;
    public function __construct(\AcceptanceTester $I) { $this->I = $I; }

    public function login(string $email, string $password): void
    {
        $this->I->amOnPage(self::$url);
        $this->I->fillField(self::$emailField, $email);
        $this->I->fillField(self::$passwordField, $password);
        $this->I->click(self::$loginButton);
    }
}
```

### Cloud (TestMu AI)

Full setup: [reference/cloud-integration.md](reference/cloud-integration.md). Capabilities reference: [shared/testmu-cloud-reference.md](../shared/testmu-cloud-reference.md).

### Cloud Config (acceptance.suite.yml)

```yaml
actor: AcceptanceTester
modules:
  enabled:
    - WebDriver:
        url: 'http://localhost:3000'
        host: 'hub.lambdatest.com'
        port: 80
        browser: chrome
        capabilities:
          'LT:Options':
            user: '%LT_USERNAME%'
            accessKey: '%LT_ACCESS_KEY%'
            build: 'Codeception Build'
            video: true
```

## Setup: `composer require --dev codeception/codeception codeception/module-webdriver`
## Init: `php vendor/bin/codecept bootstrap`
## Run: `php vendor/bin/codecept run acceptance`

## Deep Patterns

See `reference/playbook.md` for production-grade patterns:

| Section | What You Get |
|---------|-------------|
| §1 Project Setup | Installation, codeception.yml, suite configurations |
| §2 Acceptance Tests | Cest pattern, @dataProvider, WebDriver interactions |
| §3 API Tests | REST module, CRUD operations, @depends, HttpCode |
| §4 Page Objects | Page class with static selectors, reusable methods |
| §5 Database Testing | haveInDatabase, seeInDatabase, updateInDatabase |
| §6 Custom Helpers | Custom module extending Codeception Module |
| §7 CI/CD Integration | GitHub Actions with MySQL, Selenium, coverage |
| §8 Debugging Table | 12 common problems with causes and fixes |
| §9 Best Practices | 14-item Codeception testing checklist |

© TestMu AI · MIT · LambdaTest/agent-skills

Similar skills

All skills for Testing and QA →

From the same set47

The whole set →
hyperexecute-skill This skill prepares and runs HyperExecute test jobs, checks YAML locally, connects CI, and helps investigate failed cloud runs. CX Codex +1 250installs xcuitest-skill Generates XCUITest UI tests for iOS and iPadOS apps. Detects whether to use local Xcode simulators or TestMu AI cloud devices, then builds test code accordingly. CX Codex +1 248installs puppeteer-skill Generates Puppeteer scripts for browser automation, scraping, and PDF output. Activates when you mention Puppeteer, headless Chrome, page.goto, or PDF generation. CX Codex +1 247installs testng-skill Generates Java TestNG tests with groups, data providers, parallel execution, suite XML, and listeners. Use it when building or organising TestNG coverage. CX Codex +1 243installs flutter-testing-skill flutter-testing-skill generates widget tests, integration tests, and golden tests for Flutter in Dart. Runs locally or on real devices via TestMu AI cloud. CX Codex +1 242installs smartui-skill This skill prepares SmartUI visual regression tests for screenshot comparison. Use it to check pages and components across browsers and viewports. CX Codex +1 237installs jasmine-skill Generates test specs in Jasmine for JavaScript and TypeScript. Includes BDD patterns, spy and mock syntax, async support — the code editor writes describe, it, expect, and spy calls automatically. CX Codex +1 237installs mocha-skill Creates Mocha tests for JavaScript and TypeScript with Chai assertions and Sinon mocks. Useful when a project needs unit-test scaffolding. CX Codex +1 235installs

Project sponsors

Companies that keep this analytics open