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.

Related Objects

StatusSubtypeAssignedTask
OpenNone
ResolvedJdlrobson
DeclinedNone
Resolved zeljkofilipin
Resolved zeljkofilipin
DuplicateJdlrobson
ResolvedJdlrobson
Resolved zeljkofilipin
Resolved zeljkofilipin
Resolved zeljkofilipin
DeclinedNone
ResolvedJdlrobson
ResolvedNone
Resolvedawight
DuplicateLegoktm
StalledNone
OpenNone
Resolved zeljkofilipin
Resolvedhashar
OpenNone
ResolvedPRODUCTION ERRORJdlrobson
ResolvedJdlrobson
ResolvedJdrewniak
OpenNone
OpenNone
ResolvedNone
Resolved zeljkofilipin
ResolvedEdtadros
Openovasileva
ResolvedJdlrobson

Event Timeline

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

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

@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?

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

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.

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 [[ https://phabricator.wikimedia.org/source/mediawiki/browse/master/tests/selenium/specs/user.js;ca01c9ff7f62556f76bba61cad4cfbcbc9519828$34-47 | 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.

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

@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

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