Selenium/Getting Started/Run tests using Fresh

EnvironmentsEdit

When using Fresh, you can target several wikis.

AdvantagesEdit

  • It will be fast, if the target is local. MediaWiki core Selenium test run takes about 2 minutes on my machine. (As of October 2019.)
  • Works without an internet connection, if the target is local.
  • Doesn't require installing Vagrant.
  • Doesn't require executing npm packages directly on your machine (which is dangerous).

DisadvantagesEdit

  • You need to have Docker installed.

PrerequisitesEdit

Go to MediaWiki Core folderEdit

cd core

Environment variablesEdit

If you're targeting MediaWiki-Docker, you don't have to do anything. If you're targeting another setup, see Selenium/How-to/Set environment variables.

Start a Fresh sessionEdit

you:core$ fresh-node -env -net

...

# env: MW_*, MEDIAWIKI_*
# net: expose host

🌱  Fresh!

nobody@docker-desktop:/core$

Install dependenciesEdit

nobody@docker-desktop:/core$ npm ci

Run Selenium testsEdit

nobody@docker-desktop:/core$ npm run selenium-test