Page MenuHomePhabricator

RSpec tests for Echo notifications
Closed, ResolvedPublic

Description

Start adding tests for all types of notifications

  • Welcome (welcome)
  • Mention (flow-mention, mention)
  • Create a new Flow topic (flow-new-topic, flowusertalk-new-topic)
  • Flow post edits (flow-post-edited, flowusertalk-post-edited)
  • Reply to Flow post ( flow-post-reply, flowusertalk-post-reply)

Status:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 28 2016, 4:33 PM

Change 313221 had a related patch set uploaded (by Etonkovidova):
WIP RSpec test for Mention notificationon

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

zeljkofilipin renamed this task from Create rspec tests for Echo to RSpec tests for Echo Mention notificationon.Dec 1 2016, 9:11 AM
zeljkofilipin triaged this task as Normal priority.
zeljkofilipin removed a project: User-zeljkofilipin.

Change 324687 had a related patch set uploaded (by Zfilipin):
WIP RSpec tests for Echo Mention notificationon

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

zeljkofilipin renamed this task from RSpec tests for Echo Mention notificationon to RSpec tests for Echo Mention notification.Dec 5 2016, 4:53 PM

Change 324687 merged by jenkins-bot:
RSpec tests for Echo Mention notification

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

Change 327219 had a related patch set uploaded (by Zfilipin):
WIP mwext-mw-rspec-jessie does not need Vector skin

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

Change 327219 merged by jenkins-bot:
mwext-mw-rspec-jessie does not need Vector skin

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

Change 348721 had a related patch set uploaded (by Zfilipin; owner: Etonkovidova):
[mediawiki/extensions/Echo@master] [WIP] RSpec tests for mention notification

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

Change 348761 had a related patch set uploaded (by Zfilipin; owner: Etonkovidova):
[mediawiki/extensions/Echo@master] Echo should notify a new user with welcome message

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

Change 348721 merged by jenkins-bot:
[mediawiki/extensions/Echo@master] Echo should notify a new user with welcome message

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

Change 313221 abandoned by Zfilipin:
[WIP] RSpec tests for mention notification

Reason:
I have split this commit into several smaller ones:

https://gerrit.wikimedia.org/r/#/q/topic:T146916

Smaller commits should be easier to merge.

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

zeljkofilipin lowered the priority of this task from Normal to Low.

Change 348761 merged by jenkins-bot:
[mediawiki/extensions/Echo@master] Echo should notify user about mention on wikitext page

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

hashar added a subscriber: hashar.May 4 2017, 12:16 PM

I have been talking about this rspec suite for Echo with Zeljko.

Looking at tests/rspec/notification_spec.rb, it does http query to api.php with parameters, grab the result and runs assertion on it.

We already have support to test the API in MediaWiki / PHPUnit . There are even some in Echo already in tests/phpunit/api/ApiEchoNotificationsTest.php (written by Benny Situ back in 2014).

I highly recommend to extend the PHPUnit tests instead of introducing a new stack based on ruby/rspec. The only advantage the spec has right now, is that one can potentially target an arbitrary URL. Maybe that was the intent ?

Additional note: the advantage of the rspec based tests is that they are super fast and do not use a browser. So that is a good fast smoke test to run before running the actual browser tests. I am not sure using ruby/rspec is a best stack long term, but right now it is good enough (and code is already there).

greg added a subscriber: greg.May 4 2017, 3:48 PM

Change 348775 had a related patch set uploaded (by Etonkovidova; owner: Etonkovidova):
[mediawiki/extensions/Echo@master] Echo should notify user about new edits on user talk page

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

Change 348774 had a related patch set uploaded (by Zfilipin; owner: Etonkovidova):
[mediawiki/extensions/Echo@master] Echo should notify a user who watches a Flow board when another user creates a new topic there

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

Change 348769 had a related patch set uploaded (by Zfilipin; owner: Etonkovidova):
[mediawiki/extensions/Echo@master] Echo should notify an author of a Flow topic when another user posts a reply

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

Change 348764 had a related patch set uploaded (by Zfilipin; owner: Etonkovidova):
[mediawiki/extensions/Echo@master] Echo should notify new user about Flow mention on Flow talk page

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

Change 348768 had a related patch set uploaded (by Zfilipin; owner: Etonkovidova):
[mediawiki/extensions/Echo@master] Test: notify new user about wikitext mention on Flow talk page 'flow-mention' notification

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

Etonkovidova renamed this task from RSpec tests for Echo Mention notification to RSpec tests for Echo notifications.Jul 26 2017, 4:29 PM
Etonkovidova updated the task description. (Show Details)

Change 348764 had a related patch set uploaded (by Zfilipin; owner: Etonkovidova):
[mediawiki/extensions/Echo@master] Echo should notify new user about Flow mention on Flow talk page

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

Change 348764 abandoned by Zfilipin:
Echo should notify new user about Flow mention on Flow talk page

Reason:
Not working on Ruby tests any more, but on Node.js tests (T177412).

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

Change 348769 abandoned by Zfilipin:
Test: notify an author of a Flow topic when another user posts a reply

Reason:
Not working on Ruby tests any more, but on Node.js tests (T177412).

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

Change 348774 abandoned by Zfilipin:
Test: notify a user who watches a Flow board when another user creates a new topic there

Reason:
Not working on Ruby tests any more, but on Node.js tests (T177412).

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

Change 348775 abandoned by Zfilipin:
Test: notify user about new edits on user talk page

Reason:
Not working on Ruby tests any more, but on Node.js tests (T177412).

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

zeljkofilipin closed this task as Resolved.Nov 27 2017, 4:52 PM

@Etonkovidova and I have talked about this and decided to resolve this one. I am working on T139740: Port Selenium tests from Ruby to Node.js so having API tests in Ruby does not make much sense. API tests for Echo will be implemented in Node.js, see T177412: Mocha tests for Echo notifications.

Change 348768 abandoned by Zfilipin:
Test:should notify a new user about edits to his post done by Admin

Reason:
Not working on Ruby tests any more, but on Node.js tests (T177412).

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