Page MenuHomePhabricator

[EPIC] Port Selenium tests from Ruby to Node.js on Reading Web extensions
Closed, DeclinedPublic

Description

See parent task T139740: Port Selenium tests from Ruby to Node.js for context.

This epic groups the work of migrating the tests on reading extensions:

Before removing the ruby tests, the following item on the parent task needs to be resolved:

Run WebdriverIO jobs in test and gate-and-submit pipelines for mediawiki/core and extensions, voting.

It doesn't block starting the migrations though. Just the removal of the old tests.


Process

Based on the process for RelatedArticles extension:

  • Rewrite browser tests to Node, removing browser tests from Ruby implementation
  • Work out whether LocalSettings.php is applied to the browser test environment when written in Node. If not find an alternative solution as this blocks migrating our tests.
  • Upon completing rewrite remove the Selenium job for the Jenkins pipeline and enable the Node job as the default

Subtasks

Create subtasks when ready to approach the work.

Details

Related Gerrit Patches:

Related Objects

StatusAssignedTask
OpenNone
ResolvedJdlrobson
DeclinedNone
Resolvedzeljkofilipin
Resolvedzeljkofilipin
DuplicateJdlrobson
ResolvedJdlrobson
Resolvedzeljkofilipin
Resolvedzeljkofilipin
Resolvedzeljkofilipin
OpenNone
ResolvedJdlrobson
ResolvedNone
Resolvedawight
DuplicateLegoktm
StalledNone
OpenNone
Resolvedzeljkofilipin
Resolvedhashar
OpenNone
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedJdrewniak
OpenNone
OpenNone
OpenNone
ResolvedJdlrobson

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@dduvall are you aware of any problems with LocalSettings.php and webdriverio tests? As far as I know, nothing changes in mediawiki configuration.

I've updated patch to use the library. I forgot how to test locally so I haven't been able to verify it works. Feedback welcomed!

Is there any easier way to run selenium tests locally than executing browser tests from the core directory? Ideally I'd want a one line command e.g. npm run browsertests to make it easier to write tests.

I've updated patch to use the library. I forgot how to test locally so I haven't been able to verify it works. Feedback welcomed!

Documented at Selenium/Node.js. There is entire Run tests section! :)

Is there any easier way to run selenium tests locally than executing browser tests from the core directory? Ideally I'd want a one line command e.g. npm run browsertests to make it easier to write tests.

You have to run tests from mediawiki/core directory. To run all tests: npm run selenium

Jdlrobson updated the task description. (Show Details)Apr 21 2017, 4:54 PM

@zeljkofilipin - I can't work out how to run these browser tests within Jenkins check experimental doesn't seem to work.. where do they show up?

zeljkofilipin added a comment.EditedApr 27 2017, 2:59 PM

@Jdlrobson apologies, we have made some changes to the CI recently and I have forgot to update the documentation:

https://www.mediawiki.org/wiki/Selenium/Node.js/mediawiki-core-qunit-selenium-jessie_Jenkins_job

I am working on it (T164002: Update documentation for mediawiki-core-qunit-selenium-jessie Jenkins job).

Jdlrobson triaged this task as Medium priority.May 2 2017, 4:33 PM
Jdlrobson renamed this task from Port Selenium tests from Ruby to Node.js on Reading Web extensions to [EPIC] Port Selenium tests from Ruby to Node.js on Reading Web extensions.Jun 2 2017, 8:32 PM
Jdlrobson changed the task status from Open to Stalled.Jul 3 2017, 10:11 PM
Jdlrobson moved this task from Needs Prioritization to Epics/Goals on the Readers-Web-Backlog board.

Blocked on T164002 which is blocked on T164721

Jdlrobson moved this task from Backlog to Epics on the MobileFrontend board.Jul 13 2017, 5:54 PM
Jdlrobson updated the task description. (Show Details)Jul 21 2017, 5:22 PM
zeljkofilipin changed the task status from Stalled to Open.Jul 24 2017, 4:13 PM
zeljkofilipin claimed this task.
zeljkofilipin raised the priority of this task from Medium to High.

I will port one test per repository and make sure it runs in CI.

Blocked on T164002 which is blocked on T164721

Both tasks have been resolved. ๐ŸŽ‰

After T164024 is done, we'll need to work out what to do next and when and how we'll do it.

zeljkofilipin removed zeljkofilipin as the assignee of this task.Jul 27 2017, 1:55 PM

I will port one test per repository and make sure it runs in CI.

I don't have the time for this at the moment.

@zeljkofilipin are there any guidelines on how to login in a browser test? I can't find any examples.

@Jdlrobson there is a User should be able to log in test in core! ๐Ÿ˜‰

 it( 'should be able to log in', function () {

   // create
   browser.call( function () {
     return CreateAccountPage.apiCreateAccount( username, password );
   } );

   // log in
   UserLoginPage.login( username, password );

   // check
   assert.equal( UserLoginPage.userPage.getText(), username );

} );

So, from an extension:

const UserLoginPage = require( '../../../../../tests/selenium/userlogin.page' );
UserLoginPage.login( username, password );

username and password are defined in wdio.conf.js.

const UserLoginPage = require( '../../../../../tests/selenium/userlogin.page' );
UserLoginPage.login( username, password );

great that was what I was looking for.

phuedx removed a subscriber: phuedx.Sep 8 2017, 9:41 AM
phuedx added a subscriber: phuedx.
greg added a subscriber: greg.

Just removing our -kanban board, let us know if you need help on the sub-tasks.

Change 384041 had a related patch set uploaded (by Zfilipin; owner: Jdlrobson):
[integration/config@master] Run Selenium tests for Reading Web extension

https://gerrit.wikimedia.org/r/384041

Change 384041 merged by jenkins-bot:
[integration/config@master] Run Selenium tests for Reading Web extension

https://gerrit.wikimedia.org/r/384041

phuedx updated the task description. (Show Details)Nov 8 2017, 3:48 PM

@Jdlrobson, is this a good candidate to discuss for inclusion in the next sprint?

Change 502907 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Migrate browser tests from Ruby to Node.js

https://gerrit.wikimedia.org/r/502907

Jdlrobson closed this task as Declined.Aug 1 2019, 8:22 PM

I think we're unlikely to ever port QuickSurveys tests. T174018 and T177260 reflect the state of Minerva and MobileFrontend