Page MenuHomePhabricator

A simple automated test with puppeteer
Closed, InvalidPublic


The goal of this task is to replicate one of the tests on MediaWiki/core using puppeteer T248219
This task is a part of a series of tasks to be completed in other to create an evaluation of puppeteer as a replacement for WebdriverIO.

The task currently being replicated is the account creation task on the MediaWiki/core repository.

Test flow

  • Open the browser
  • Navigate to the account creation page
  • Fill in the account creation form
  • Click submit
  • Assert that the welcome message is of the format Welcome {username}!
  • Click the logout button and logout
  • Click login
  • Fill in the just registered username and password
  • Click submit
  • Assert that the user was logged in

When a user visit's the web page, we have to ensure that the user is able to navigate to the account creation page.
The user has to get a successful welcome message. Now we want to be exactly sure that this account has indeed been created, so we then log out of the account and login in back immediately using the newly generated user credentials.

Test Coverage

The following tests where written;

  • Users should be able to create a new account
  • Users should be able to logout after account creation
  • Users should be able to login after logging out

Browser Compatibility

So far, this test has been run across two different browsers namely;

  • Chrome
  • Firefox

    There's a slight change in behavior of the webpage on each browser, Here are a few;
  • Firefox takes a bit more time to render the DOM after a button click(Apprx 2seconds)
  • The logout button loads a prompt that asks if we want to proceed or not on chrome, whereas it just logs out directly on firefox.

By default, some tests that pass on chrome fails on firefox due to this. I made a few modifications to the codebase to accommodate the change in chrome - firefox behavior and added timers where necessary.


The patch can be downloaded here.

Run npm install to install all dependencies

To run tests using chrome, run npm run puppeteer-chrome

To run tests using firefox, run npm run puppeteer-firefox


Tests can fail at times due to several reasons or during the development process. Logs are provided for each test that fails, but it's also important that we visually see the test procedures so it can be easy to debug.
Currently, a screenshot of each failing test is provided at ./mediawiki/tests/puppeteer/logs/. Features like a full recording of the whole test would be added later on.

NOTE: This task would be constantly updated as progress is continually made.

Event Timeline

Gbahdeyboh renamed this task from A simple automated test with puppeteer to A simple automated test with puppeteer(T248219).Apr 2 2020, 3:22 AM
Gbahdeyboh updated the task description. (Show Details)
zeljkofilipin renamed this task from A simple automated test with puppeteer(T248219) to A simple automated test with puppeteer.Apr 2 2020, 10:03 AM

@Gbahdeyboh is no longer working on the project.