Page MenuHomePhabricator

Rewrite disabled MobileFrontend browser tests to phpunit tests and Node.js browser tests
Closed, DeclinedPublic8 Estimated Story Points

Description

Our browser tests for MobileFrontend were broken and disabled. This task deals with the cleanup related to restoring them in the MobileFrontend extension.

Following an audit, new guidelines https://www.mediawiki.org/wiki/Reading/Web/QA#What_are_browser_tests_for and discussion of that audit and suggested guidelines it has been proposed that the remaining browser tests are either deleted or reimplemented as phpunit tests, since they do not test behaviour - they test page content.

Acceptance criteria

  • Add new job selenium-daily-beta-MobileFrontend
  • new job selenium-daily-beta-MobileFrontend should be green and passing
  • All tests should run starting from the desktop domain (T130429). This has caused issues historically and should be avoided when rewriting them.
  • special_contributions.feature has been rewritten as a PHPUnit test (and associated code refactored)
  • special_watchlist.feature and special_watchlist_editors.feature have been rewritten as a Node.js test (https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/506592/)
  • user_page.feature has been rewritten as a Node.js test
  • special_history.feature and special_history_nojs.feature has been rewritten as a PHPUnit test (and associated code refactored)
  • special_watchlist_newuser.feature has been rewritten as a PHPUnit test (and associated code refactored) - https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/MobileFrontend/+/506591/1
  • switch_views.feature has been rewritten as a Node.js test
  • Disable the Ruby job in integration/config for daily builds and for commits
  • While working on this, do an audit as originally proposed in T148973 of what we are testing. Remove unnecessary tests and document missing tests. At the end, summarise the browser test for each extension.

Sign off steps

  • Ensure the user_page test has been restored (T221860)

Note: It was skipped indefinitely. The value was not worth the hassle.

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Jdlrobson renamed this task from Rewrite MobileFrontend's browser tests to Rewrite MobileFrontend's browser tests from Ruby to Node.Aug 14 2018, 9:43 PM

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

Change 502907 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Migrate browser tests from Ruby to Node.js

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

Change 504328 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/extensions/MobileFrontend@master] Add wdio-mocha-framework to package.json

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

Change 504328 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Add wdio-mocha-framework to package.json

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

Jdlrobson changed the task status from Stalled to Open.Apr 23 2019, 8:04 AM
Jdlrobson removed the point value for this task.
Jdlrobson moved this task from Upcoming to Needs Prioritization on the Web-Team-Backlog board.

Quite possible we're want to break this down into smaller tasks.

Change 506343 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[integration/config@master] Drop Selenium Ruby jobs from Jenkins on MobileFrontend

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

Change 506343 merged by jenkins-bot:
[integration/config@master] Drop Selenium Ruby jobs from Jenkins on MobileFrontend

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

Change 506427 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] 🏗 Remove Ruby browser tests

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

Change 506591 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Audit: Remove unnecessary browser tests

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

Change 506592 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] WIP: Rewrite watchlist tests in Node.js

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

After looking into this, I think we should not bother with most of the Selenium browser tests. Testing behaviour seems important, but not

Let's estimate the work involved to:

  1. Port the watchlist tests I've highlighted as being useful to Node.js
  2. Rewriting the tests I identified in my audit to phpunit
  3. Cleaning up the repo. e.g. https://gerrit.wikimedia.org/r/506427
Jdlrobson renamed this task from Rewrite MobileFrontend's browser tests from Ruby to Node to Rewrite remaining MobileFrontend's Ruby browser tests to phpunit tests and Node.js browser tests.May 1 2019, 8:37 PM
Jdlrobson removed phuedx as the assignee of this task.
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
ovasileva set the point value for this task to 8.May 8 2019, 4:58 PM

Change 392026 abandoned by Pmiazga:
WIP: Rewrite MobileFronted Ruby tests to NodeJS

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

Change 506427 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] 🏗 Remove Ruby browser tests

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

Should this task be resolved? There's nothing left in tests/browser.

No there are 4 open checkboxes on this ticket. Ruby tests were deleted but not all the tests got ported.

Jdlrobson renamed this task from Rewrite remaining MobileFrontend's Ruby browser tests to phpunit tests and Node.js browser tests to Rewrite disabled MobileFrontend browser tests to phpunit tests and Node.js browser tests.Jul 9 2019, 2:48 PM

Change 522488 had a related patch set uploaded (by Zfilipin; owner: Zfilipin):
[integration/config@master] Delete selenium-MobileFrontend Jenkins job

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

Change 522488 merged by jenkins-bot:
[integration/config@master] Delete selenium-MobileFrontend Jenkins job

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

Jdlrobson lowered the priority of this task from High to Medium.Jul 31 2019, 4:24 PM

Change 506591 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Audit: Remove unnecessary browser tests

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

Change 506592 abandoned by Jdlrobson:
WIP: Rewrite watchlist tests in Node.js

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

Note: These tests still exist in the repo, but are no longer run.

Is this still relevant, since MobileFrontend doesn't have WebdriverIO tests since 859535?

it's still relevant in the sense, this ticket was about rewriting some tests that were previously in Selenium to PHPUnit. However now it's likely a sunken cost and the time might be better spent removing these pages e.g. T109277

@ovasileva: Per emails from Sep18 and Oct20 and https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup , I am resetting the assignee of this task because there has not been progress lately (please correct me if I am wrong!). Resetting the assignee avoids the impression that somebody is already working on this task. It also allows others to potentially work towards fixing this task. Please claim this task again when you plan to work on it (via Add Action...Assign / Claim in the dropdown menu) - it would be welcome. Thanks for your understanding!

The code in question will be removed in T305113 and T266065