Selenium tests in Node.js

Originally an-email sent on April 3 2017 to qa, engineering and wikitech-l mailing lists.

TL;DR

You can now write Selenium tests in Node.js! Learn more about it at https://www.mediawiki.org/wiki/Selenium/Node.js

Introduction

Five years ago we introduced browser tests using Selenium and a Ruby based stack. It has worked great for some teams, and not so great for others. Last year we talked to people from several teams and ran a survey. The outcome is a preference toward using a language developers are familiar with: JavaScript/Node.Js.

After several months of research and development, we are proud to announce support for writing tests in Node.js. We have decided to use WebdriverIO. It is already available in MediaWiki core and supports running tests for extensions.

You can give it a try in MediaWiki-Vagrant:

vagrant up
vagrant ssh
sudo apt-get install chromedriver
export PATH=$PATH:/usr/lib/chromium
cd /vagrant/mediawiki
xvfb-run npm run selenium

Documentation

Extensive details are available on the landing page: https://www.mediawiki.org/wiki/Selenium/Node.js

Future

We plan to replace the majority of Selenium tests written in Ruby with tests in Node.js in the next 6 months. We can not force anybody to rewrite existing tests, but we will offer documentation and pairing sessions for teams that need help. After 6 months, teams that want to continue using Ruby framework will be able to do so, but without support from Release Engineering team.

I have submitted a skill share session for Wikimedia Hackathon 2017 in Vienna. If you would like to pair on Selenium tests in person, that would be a great time.

The list of short term actions is in task T139740.

Thanks

I would like to thank several people for reviews, advice and code: Jean-Rene Branaa, Dan Duvall, Antoine Musso, Jon Robson, Timo Tijhof. (Names are sorted alphabetically by last name. Apologies to people I have forgot.)

Written by zeljkofilipin on Sep 25 2017, 2:57 PM.
Software Engineer (International contractor)
Projects
None
Subscribers
None
Tokens
"Like" token, awarded by thcipriani.