Sahilgrewalhere
4 min readAug 16, 2021

--

GSoC’21 Wikimedia Foundation 💖

The offboarding:

Project Summary :

Since we all know that testing of software is important since it discovers defects/bugs before the delivery to the client, which guarantees the quality of the software. It makes the software more reliable and easy to use. Thoroughly tested software ensures reliable and high-performance software operation. Now to ease regression testing time and for better efficiency to validate complex scenarios automation is preferred.

Beauty of automation💖

🏁The Destination:

Currently Mediawiki is using WebdriverIO as a browser driver for our test automation framework which is at version 6 (exception: 2 are at V4). The goal of this project was to migrate them to version 7 (Latest) Which was released recently on Feb 9 , 2021. Also I had to perform cleanup and refactoring of the existing WebdriverIO code across all repositories. (Additional goals below).

🏁The Additional Goals:

  • Enabling of video recording in all selenium test
  • Sanitizing Page Object Imports across all repos.
  • Extending the wdio.conf.js file so that the same file can be used/extended across all repositories.

🏁Features in new updates

  • Stricter Protocol Compliance
  • Test Coverage Reporting
  • Dropped Node v10 support
  • Improved google lighthouse Integration

The implementation :

So at Mediawiki the developers uses Phabricator to track the task on and gerrit for code review. I started my work from the second week of community bonding period. My project was mainly tracked at two task tickets i.e T274579 and T283597.

T274579:

This was the major goal of the project i.e Upgrading WebdriverIO to v7 across all repositories and upgrading all the necessary packages along with it.

T283597:

This was the sub-task of my project and the most interesting one as it adds an basic wdio.conf.js to wdio-mediawiki. Due to which this basic wdio.conf.js can be used in all the repositories after release of wdio-mediawiki v1.1.1, additionally it enables video-recording across all the repositories. Moreover, it removes chromedriver dependency. Hence, to maintain code reusability we proposed this task.

🏋🏾‍♂️The work Approach:

Basically, I started with setting up the repo at local environment on which I had to work. This was the most important part of the project, also it is sometimes can be time consuming as every repo has different steps for setting it up at local environment. To get comfortable with work flow, I started with the repos falling under Group-A. refer here : Grouping.

I was able to complete the work for Group-A during the community bonding period only. So I was ready to move on Group-B but still I was feeling tensed as Group-B have some advance spec files. So I waited for the official coding period but till then I take over on T283597 . I started working on adding the basic wdio.conf.js to all the repositories of Group-A and upgrading wdio-mediawiki to v 1.1.1. So yes ! I followed this pattern across the all the upgrades till now. i.e first upgrade webdriverIO and then move on to adding basic wdio.conf.js.

🚧The problems encountered:

Since WebdriverIO v7 needs at least Node version greater than 14 to work properly. But at mediawiki the node version was 10 during my coding period.

Due to this I have to read the change logs and decide a most stable as well as latest version of WebdriverIO. Earlier I decided to use v7.5.1 as it worked with one of my group-A repo. But soon it started failing with Error : yargs supports a minimum node.js version of 12.

And the reason for this was the node version which was outdated for webdriverIO v7 to work properly. So after having hands on upgrading various repositories, webdriverIO v7.4 comes out to be stable in most of the repositories. So most of the upgrades are on v7.4 . Also some even fails at v7.4 and needs lower or may be upper version than that, based on the changelogs refer : CHANGELOG.md

Some unexpected test failing repositories are mentioned below :

  1. extension/Popups (refer : T286846)(under review)
  2. extension/WikibaseLexeme (refer : T289174 )(under review)
  3. extension/CirrusSearch(refer :T289168)(under review)
  4. extension/Echo (refer : T271281)(under review)
  5. portals/deploy(refer : T289181)(under review)
  6. extension/MobileFrontend(refer : T289184)(under review)

👍🏻The Result:

  1. 82 % of the repositories are now on v7
  2. 82 % of the repositories are now having a basic wdio.conf.js, video reporting enabled, and removed chromedriver dependency.
  3. Dismissed Chrome’s `Save password?` popup during running tests across all the repositories.
  4. Updated README.md across all the above repositories with an basic and simple template. Refer task : T282237

NOTE: The above statistics are subject to change as some of the repositories are still in review. For current status please refer the task (phabricator) instead.

👩🏻‍💻Future work:

  1. Will be working on the repositories which have unexpected failures mentioned above.
  2. Since the node version is now moved to v10 to v12 , I will be working on upgrading the repositories to the latest version i.e 7.9 currently.
  3. Will be testing Allure reporter(refer here) as a replacement of current reporter across all the repositories.

A Short Way to my work :

  1. Upgrade WebdriverIO to v7 : T274579
  2. Update wdio-mediawiki to 1.1.1 in all repositories : T283597
  3. Upgrade README.md for Selenium tests across all the repositories : T282237
  4. My patches : (Gerrit)
  5. Phabricator Profile : (Profile)
  6. Mediawiki userpage : (Profile)

The Experience :

I am really thankful to my mentors Mr. Soham Parekh and Miss. Vidhi Mody for considering me for this opportunity. I used to be a very introvert, but due to this opportunity I realized how the process of communication and collaboration leads to great things. A special shoutout to Mr Željko Filipin for some cool debugging sessions. It’s a pride moment for me to work with talents like them.

--

--