Skip to content

mw dev mediawiki fresh

Releasev0.35.0 · cfeceb67

Watch it in action

A recorded Fresh browser test
mw dev mediawiki fresh [flags] [fresh-commands]... -- [fresh-args]

Run Node.js and browser tools in a Fresh container with your MediaWiki checkout mounted at /var/www/html/w. Run commands from the checkout directory to preserve the matching working directory inside the container.

Fresh sets MW_SERVER=http://mediawiki-web:8080, MW_SCRIPT_PATH=/w, MEDIAWIKI_USER=Admin, and MEDIAWIKI_PASSWORD=mwddpassword. These are development defaults; override them for another wiki or account by passing NAME=value before the command. The server address is internal to Docker and does not follow the host’s HTTP port.

When forwarding npm test-runner flags, use -- --: the first separator passes flags through this CLI and the second forwards them through npm to WebdriverIO.

mw dev mediawiki fresh record [spec] runs npm run selenium-test with --recordVideo, --useBrowserHeadless=false, and --maxInstances=1, adding --spec when a path is provided. Omit the spec to record the full suite. It uses the same container, wiki settings, and working directory as other Fresh commands. Run mw dev mediawiki fresh npm ci first to install dependencies.

The bundled browser image supplies Xvfb and ffmpeg; the runner starts its virtual display and recorder automatically. Recording requires a non-headless browser inside that display. Normal test runs do not enable recording automatically.

Videos and reports normally appear in tests/selenium/log/ in the host checkout. A project’s WebdriverIO configuration can change the output directory; LOG_DIR sets the default runner’s log directory. Older checkouts may lack recording support or require their own setup; consult their Selenium README.

For a workflow installing dependencies, running tests, and checking a recording, see mw help guides dev fresh.

-u, --user <string>
User to run as, defaults to current OS user uid:gid Default: 1000:1000.
-c, --context <string>
Development context to use (overrides CONTEXT) Default: default.
--help
Help for this command
--no-interaction
Do not ask any interactive questions
-v, --verbose <count>
Increase output verbosity. Example: --verbose=2 or -vv
Terminal window
mw dev mediawiki fresh bash
mw dev mediawiki fresh npm ci
mw dev mediawiki fresh record tests/selenium/specs/recentchanges.js
Report an issue with this page

Report a documentation issue

The report includes this page’s link, section and documentation version.

Review and submit on Phabricator, or run the command using your saved CLI profile. The command asks before creating the task.