Selenium/How-to/Run tests targeting Quibble

This page describes how to run Selenium tests locally against your own Quibble MediaWiki install.

AdvantagesEdit

  • It will be fast, since the target machine is local. MediaWiki core Selenium test run takes about 3 minutes on my machine. (As of March 2020.)
  • Works without an internet connection.
  • Doesn't require installing ChromeDriver or FFmpeg (compared to bare installs).
  • Doesn't require executing npm packages directly on your machine (which is scary).

DisadvantagesEdit

  • You need to have Docker installed.

PrerequisitesEdit

Setup QuibbleEdit

docker pull docker-registry.wikimedia.org/releng/quibble-stretch-php72:latest
git clone "https://gerrit.wikimedia.org/r/integration/quibble"
cd quibble
mkdir -p ref/mediawiki/skins
git clone --bare https://gerrit.wikimedia.org/r/mediawiki/core ref/mediawiki/core.git
git clone --bare https://gerrit.wikimedia.org/r/mediawiki/vendor ref/mediawiki/vendor.git
git clone --bare https://gerrit.wikimedia.org/r/mediawiki/skins/Vector ref/mediawiki/skins/Vector.git
mkdir cache
chmod 777 cache
mkdir -p log
chmod 777 log
mkdir -p src
chmod 777 src
docker run -it --rm \
  -v "$(pwd)"/cache:/cache \
  -v "$(pwd)"/log:/workspace/log \
  -v "$(pwd)"/ref:/srv/git:ro \
  -v "$(pwd)"/src:/workspace/src \
  docker-registry.wikimedia.org/releng/quibble-stretch-php72:latest

Run Selenium testsEdit

docker run -it --rm \
  -v "$(pwd)"/cache:/cache \
  -v "$(pwd)"/log:/workspace/log \
  -v "$(pwd)"/ref:/srv/git:ro \
  -v "$(pwd)"/src:/workspace/src \
  docker-registry.wikimedia.org/releng/quibble-stretch-php72:latest \
  --skip-zuul \
  --skip-deps \
  --run selenium

Log files are located in log folder, including videos of all tests.

ls -1 log/*.mp4

log/BlankPage-should-have-its-title-%40daily.mp4
log/Page-should-be-creatable.mp4
log/Page-should-be-deletable.mp4
log/Page-should-be-editable-%40daily.mp4
log/Page-should-be-previewable.mp4
log/Page-should-be-re-creatable.mp4
log/Page-should-be-restorable.mp4
log/Page-should-be-undoable.mp4
log/Page-should-have-history-%40daily.mp4
log/Special%3ARecentChanges-shows-page-creation.mp4
log/Special%3AWatchlist-should-show-page-with-new-edit.mp4
log/User-should-be-able-to-create-account.mp4
log/User-should-be-able-to-log-in-%40daily.mp4