Conversation
Resolves conflicts in bin/mcp-server.js by combining:
- origin/4.x: shell session lifecycle (startShellSession/endShellSession),
per-test plugin overrides, ensureBootstrap caching, TraceReader/ariaDiff
in run_code, currentAiTraceDir tracking from event.test.before.
- fix/mcp-fixes: rich tool descriptions, expanded run_code scope (locate,
within, session, secret, inject, pause, tryTo, retryTo, hopeThat, step,
els, WebElement), grep arg on run_test/run_step_by_step, settleMs on
snapshot/run_code, aiTraceHint, browser:{show:false} default,
installShutdownHooks, formatReturnValue for WebElement results.
ensureSession() now auto-starts a shell session for snapshot/run_code so
the previous auto-init UX is preserved on top of the new lifecycle.
The new dry-run no longer disables every plugin (only the interactive
and external-I/O ones), so the customLocator test now sees `Plugins:
screenshot, customLocator` and the strict `toContain('Plugins:
customLocator')` assertion fails. Match the plugin list with a regex
instead — what we care about is that customLocator was activated.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Update mcp.md to match the current tool surface (cancel, polymorphic pauseAt, settleMs, plugins-only-on-start_browser, availableObjects, WebElement auto-describe, traceFile per scenario) and warn against running the MCP server from a global codeceptjs install. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
DenysKuchma
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cluster of fixes around the MCP server,
init,dryRun, workers, and a few core export tweaks. Most changes are about making the MCP loop usable in real projects (rich tool descriptions, headless default, agent-friendly return values) plus paying down a few quality-of-life issues.What's in here
MCP server (
bin/mcp-server.js)traceFile,aiTraceHint, andpauseAt/continueso an agent picking up the tool list knows when to do what.run_coderuns in a scope that mirrors the Mocha environment:I, helpers,locate,within,session,secret,inject,pause,tryTo,retryTo,hopeThat,step,element,eachElement,expectElement, plus every support object. Response advertises every symbol viaavailableObjects.grepargument onrun_test/run_step_by_step, mirroring the CLI--grepflag.settleMsargument onsnapshot/run_code(default 300ms) so animations / re-renders don't race the capture.browser: { show: false }) — opt into headed withplugins={ browser: { show: true } }.aiTraceHintsurfaces in tool responses when aiTrace is disabled, telling the agent how to re-enable it for richer per-step capture.installShutdownHooksensures the container is torn down on SIGTERM/SIGINT/beforeExit.formatReturnValueplusWebElement.describe()/toJSONso returning an element fromrun_codeproduces a usable plain-object snapshot instead of{}.Init (
lib/command/init.js)-y, --yesflag — skip prompts and use sensible defaults (Playwright + chromium,BASE_URLenv for url)../tests/*_test.jsfor new projects.Dry run (
lib/command/dryRun.js)pause,pauseOnFail) and external-I/O ones (analyze,aiTrace,pageInfo,heal). Plugins that register support objects (e.g.auth → I.login) keep working — helper calls inside are already no-op'd byHelperStepwhenstore.dryRunis true.Core
lib/config.js: populateglobalThis.codeceptjsat config-import time so@codeceptjs/configureproxies don't throw beforeinitCodeceptGlobalsruns.lib/globals.js:pause,inject,sharestay global even undernoGlobals: true. They're the everyday debugging / wiring entry points and have no useful import alternative for page-object code that runs before the container is available.lib/index.js: addsession,inject,locateto named/default exports.lib/mocha/factory.js: defaultcleanReferencesAfterRun: false. Mocha 10+ disposes the instance after.run(), which broke every subsequent MCPrun_testcall.lib/parser.js+lib/mocha/inject.js: only warn on the legacy(I)parameter format when explicitly asked. Stops noisy errors during normal injection.lib/plugin/browser.js: merge plugin config with_argsso options set incodecept.conf.jsaren't lost when passing CLI flags.lib/workers.js: drop the hardcoded 10-minute overall timeout and make per-worker timeout configurable viaCODECEPT_WORKER_TIMEOUT.Docs
docs/continuous-integration.md: rewritten end-to-end (GitHub Actions / GitLab / Bitbucket / Jenkins / CircleCI examples,@testomatio/reporterintegration via the GitHub + HTML pipe combo).docs/migration-4.md: small touch-ups.Type of change
Test plan
npm test(existing unit suites — trace_test passes; pre-existing REST suite needs the local fixture server)start_browser→run_code→snapshot→run_testwith and withoutpauseAtcodeceptjs init -yproduces a working configcodeceptjs dry-runkeepsauthand similar support-object plugins functional