
Moodle behat testing
Guides writing and running Behat acceptance tests for Moodle plugins
Moodle behat testing is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 44
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Moodle behat testing
This skill walks the agent through end-to-end acceptance testing for Moodle plugins with Behat. It covers feature file structure, Background data generators, tags such as @javascript, and custom step definition classes that extend Moodle's base Behat class. It also includes the setup steps for a dedicated Moodle test site, a Selenium or Chromedriver browser driver, and the commands for running tests by tag, file, or scenario line.
The guide includes a selector reference for Mink-based steps, a list of useful built-in Moodle steps, a table of common mistakes, and debugging options such as failure dumps. It also shows a CI job that initializes the test site and runs tagged scenarios. Unit tests for business logic are out of scope and are directed to a separate PHPUnit skill.
Expected inputs are a Moodle codebase with a plugin component, a PHP environment with Composer dependencies, and a browser driver for JavaScript scenarios.
When your agent uses it
Use when writing or running Behat acceptance tests for Moodle plugins. Covers feature files, custom step definitions, tags, data generators in Background, JavaScript scenarios, and Selenium/Chromedriver setup.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (7 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the moodle-dev plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add SaadRahman01/claude-moodle-dev
/plugin install moodle-dev@moodle-devOr copy only this skill to ~/.claude/skills/moodle-behat-testing:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/moodle-behat-testing &&
cp -R "$tmp/skills/moodle-behat-testing" ~/.claude/skills/moodle-behat-testing &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/moodle-behat-testing inside it instead.
Copy the skill folder to ~/.agents/skills/moodle-behat-testing to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/moodle-behat-testing &&
cp -R "$tmp/skills/moodle-behat-testing" ~/.agents/skills/moodle-behat-testing &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/moodle-behat-testing inside it instead.
Copy the skill folder to ~/.cursor/skills/moodle-behat-testing to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/moodle-behat-testing &&
cp -R "$tmp/skills/moodle-behat-testing" ~/.cursor/skills/moodle-behat-testing &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/moodle-behat-testing inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/SaadRahman01/claude-moodle-dev.git --path skills/moodle-behat-testingOr copy the folder to ~/.gemini/skills/moodle-behat-testing yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/moodle-behat-testing:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/moodle-behat-testing &&
cp -R "$tmp/skills/moodle-behat-testing" ~/.copilot/skills/moodle-behat-testing &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/moodle-behat-testing inside it instead.
Get the folder:
git clone --depth 1 https://github.com/SaadRahman01/claude-moodle-dev.gitThen copy claude-moodle-dev/skills/moodle-behat-testing into your agent's skills folder as moodle-behat-testing. Agents that support SKILL.md read one folder per skill.
What it does
- Feature file structure
- Shows how to write Gherkin feature files with scenarios, backgrounds and tags for a Moodle plugin.
- Custom step definitions
- Explains how to add plugin-specific Behat steps in a class extending the Moodle base class.
- Data generator setup
- Describes registering plugin generators so test data can be created directly in Background sections.
- Browser driver configuration
- Covers the test site config values and Selenium or Chromedriver setup for JavaScript scenarios.
- Selector and step reference
- Lists Mink selector types and commonly used built-in Moodle steps for test writing.
- Running and debugging tests
- Gives commands for filtering runs by tag, file or line, plus failure dumps and CI usage.
Good for
- Write a Behat scenario for a plugin's attendance page
- Add a custom step that checks a plugin database count
- Set up a Behat test site with Selenium for JavaScript tests
- Run a single Behat scenario by its line number
- Create test data for a plugin using a generator in a Background
Moodle behat testing FAQ
When should I use Moodle behat testing instead of unit tests?
The skill is meant for end-to-end and acceptance tests, such as JavaScript-driven UI, bug reproduction needing cookies and sessions, and regression scenarios. It points business logic unit tests to a separate PHPUnit skill.
Does Moodle behat testing need a browser?
Scenarios tagged @javascript use a real browser through Selenium or Chromedriver. Without that tag, scenarios run headless without JavaScript.
Do I need to re-run anything after changing step definitions?
Yes, the guide says to re-run the Behat init script after adding or changing PHP step definitions so the steps are rescanned.
How do I install Moodle behat testing in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/moodle-behat-testing to use it in all your projects, or to .claude/skills/moodle-behat-testing in one project. Or install the moodle-dev plugin, which includes it: /plugin marketplace add SaadRahman01/claude-moodle-dev, then /plugin install moodle-dev@moodle-dev.
Does Moodle behat testing run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Moodle behat testing?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Moodle behat testing?
The closest alternatives to Moodle behat testing are Moodle phpunit testing, Behat skill, Moodle plugin development, Moodle accessibility and Behave skill.
Where this comes from
- Description: from the skill's own SKILL.md.
More from SaadRahman01/claude-moodle-dev

Guides building and calling Moodle web services: external functions, tokens and schemas
- Open source
- 44 GitHub stars
- Developer tools

Guides agents to build Moodle plugin UI that meets WCAG 2.1 AA accessibility rules
- Open source
- 44 GitHub stars
- Developer tools

Guides writing Moodle browser JavaScript as AMD modules with grunt builds and tests
- Open source
- 44 GitHub stars
- Developer tools

Guides building and migrating Moodle 4.4+ hook classes, listeners and tests
- Open source
- 44 GitHub stars
- Developer tools

Guides building Moodle plugin UI that renders inside the Moodle Mobile app
- Open source
- 44 GitHub stars
- Developer tools

Guides an agent through performance tuning for Moodle plugins: caching, queries, tasks
- Open source
- 44 GitHub stars
- Developer tools


