Outreachy Internship Application Process: Part 2 Echo Tests

I ran into a problem when running the echo.js test. The login should be username: admin and password: vagrant as per these instructions, but when the test runs mediawiki complains that the password is too short and prompts the user to change it to a password of 8 characters or more.

When I tested this manually and clicked the ‘skip’ button this error showed up:

So my way around it is I created a new user called admin2 with password vagrant123 (so it met the password length requirement). I modified the echo.js code to say  UserLoginPage.login( 'admin2', 'vagrant123' ); but then it brought up this page,  something again to do with central login?:

To get around that I added this line after the modified one above:  UserLoginPage.open(); and the test passed.

So the echo.js code that passed it’s test looks like this:

‘use strict’;

var assert = require( 'assert' ),
        EchoPage = require( '../pageobjects/echo.page' ),
        UserLoginPage = require( 'wdio-mediawiki/LoginPage' );

describe( 'Echo', function () {

        it( 'alerts and notices are visible after logging in', function () {

                UserLoginPage.login( 'admin2', 'vagrant123' );
                UserLoginPage.open();
                assert( EchoPage.alerts.isExisting() );
                assert( EchoPage.notices.isExisting() );

        } );

} );

And Terminal Results:

ephemeral@ephemeral-peppy:~/Programs/vagrant/mediawiki$ sudo ./node_modules/.bin/wdio tests/selenium/wdio.conf.js --spec extensions/Echo/tests/selenium/specs/echo.js
pattern /home/ephemeral/Programs/vagrant/mediawiki/extensions/VisualEditor/modules/ve-mw/tests/selenium/specs/**/*.js did not match any file
pattern /home/ephemeral/Programs/vagrant/mediawiki/extensions/Wikibase/repo/tests/selenium/specs/**/*.js did not match any file
pattern /home/ephemeral/Programs/vagrant/mediawiki/skins/*/tests/selenium/specs/**/*.js did not match any file
pattern /home/ephemeral/Programs/vagrant/mediawiki/extensions/CirrusSearch/tests/selenium/specs/**/*.js did not match any file
pattern /home/ephemeral/Programs/vagrant/mediawiki/extensions/VisualEditor/modules/ve-mw/tests/selenium/specs/**/*.js did not match any file
pattern /home/ephemeral/Programs/vagrant/mediawiki/extensions/Wikibase/repo/tests/selenium/specs/**/*.js did not match any file
pattern /home/ephemeral/Programs/vagrant/mediawiki/skins/*/tests/selenium/specs/**/*.js did not match any file
------------------------------------------------------------------
[chrome #0-0] Session ID: 5e3a5bd5ee9de04125eb11c505b0c9e1
[chrome #0-0] Spec: /home/ephemeral/Programs/vagrant/mediawiki/extensions/Echo/tests/selenium/specs/echo.js
[chrome #0-0] Running: chrome
[chrome #0-0]
[chrome #0-0]   Echo
[chrome #0-0]
[chrome #0-0]   Echo
[chrome #0-0]       ✓ alerts and notices are visible after logging in
[chrome #0-0]
[chrome #0-0]
[chrome #0-0] 1 passing (26s)
[chrome #0-0]

Wrote xunit report to [/home/ephemeral/Programs/vagrant/mediawiki/tests/selenium/log].


1 passing (27.90s)

Update:
Found some documentation about how to change the value of the username and password here (values are set in the wdio.conf.js file).