Commit graph

145 commits

Author SHA1 Message Date
Kunal Mehta 3a1883f3db Add test case to demonstrate T68512 is fixed
Change-Id: Icadf33455aa09147e7f42809a9c36794ec7abd82
2015-07-06 17:31:08 -07:00
Kunal Mehta c1c91a0c1d Update tests/phpunit for new directory structure
Change-Id: Ic2d5659bb1db89cb62d3703ce59f3e58ba909886
2015-06-15 11:36:02 -07:00
Matthew Flaschen a6412a6d27 Fix typo in scenario name
Change-Id: I90cf03197c715dc7c786479056f95137245ef939
2015-06-11 23:02:12 -04:00
Kunal Mehta add1eb8266 Remove unused EchoDiscussionParser::getNotifiedUsersForComment()
Change-Id: I63c51835f54735c04f8356cf8ce161210895c378
2015-06-09 23:38:16 -04:00
Kunal Mehta 70d95fbad0 Use mw.Api.postWithToken to automatically re-try badtoken errors
Bug: T101664
Change-Id: I93188099e24102b47384c08113e8dbd26dac8df1
2015-06-07 18:11:48 -07:00
Erik Bernhardson a17ae46897 Test with $wgDiff = false when wikidiff2 is installed
Change-Id: I404b26589d0e8788c458f72c1d608af859e98a6f
2015-05-20 22:26:26 -07:00
Erik Bernhardson fb028f7a8c Run DiscussionParserTest with $wgDiff = false to match prod
Change-Id: Ie2f64bdb5c614a71412d935ea1b8e9ce7dc2a9a4
2015-05-20 22:18:07 -07:00
Roan Kattouw 518101e495 Actually pass jscs
Removed exemptions from .jscsrc and fixed the code to make jscs still
pass.

Kept the dangling underscores exemption because leading underscores
are (for now) used as a naming convention for private functions in
this repo.

Change-Id: I18964f8469f52c294276527d92cb6bf9f48c2576
2015-05-04 19:28:01 +00:00
jenkins-bot df9de05c68 Merge "Start tests for the built-in notification types" 2015-05-01 20:51:50 +00:00
Matthias Mullie da07893647 Display red badge based on time of notifications vs last time panel was opened
I tried to stick as close to the existing code as possible.

Special:Notifications is slightly different from the overlay,
however. I made it add .mw-echo-unread class for consistency,
but that JS doesn't record seen time (it only loads older
entries), not does the CSS fadeout apply there (it marks
everything as read as soon as it's displayed, so different
behavior from overlay)

PS: I'm not sure about browser compat for the fadeout. But
even if some obscure browsers don't support this, meh. It's
not an "important" feature that can't be missed.

Bug: T94634
Change-Id: Ibb201823fb52ef8a3d5eaa39b0b724ede8d271d1
2015-05-01 11:39:45 -07:00
jenkins-bot 472779eb59 Merge "Title::newFromText requires string argument." 2015-04-04 04:10:01 +00:00
Erik Bernhardson 70639162f3 Allow multiple target pages per event
Bug: T85064
Change-Id: I338f3d73efb98a3bb66ef64fdeeb66e752a453c2
2015-03-31 07:56:52 +00:00
Erik Bernhardson a8c0fff41a Title::newFromText requires string argument.
Change-Id: Ieb062879e7e8e43796b7c3aa7829b5e6b00644ad
2015-03-23 15:47:45 -07:00
jenkins-bot 7be4aad14c Merge "Hygiene: Remove unused method on EchoTargetPageMapper" 2015-03-20 12:26:23 +00:00
Erik Bernhardson e9f1e67487 Hygiene: Remove unused method on EchoTargetPageMapper
Change-Id: Ic2517bf095421ced125c653716fbf44c7934a1e9
2015-03-16 08:48:22 -07:00
Cmcmahon 4631bc8d94 QA: insert one-second sleep for Chrome workaround
As of about 4 March, Chrome has begun failing to wait for javascript
event listeners on pages. The only workaround we've found is to
pause for a bit before clicking any element that brings up a WMF
"overlay"

This is the failure see at
https://integration.wikimedia.org/ci/view/BrowserTests/view/-All/job/browsertests-Echo-en.wikipedia.beta.wmflabs.org-linux-chrome-sauce/399/testReport/

Change-Id: I984f394a55423f17feae85236e18d16dd00239bc
2015-03-09 18:43:24 -04:00
Cmcmahon 68c8a7a65a QA: rubocop fixes broke the tests in the builds
regenerated rubocop config so those checks also stay green

Change-Id: Ib8a88c88c02d1638e758d62eb86f2ac59feefe5d
2015-02-23 09:44:41 -07:00
jenkins-bot f0cd4d5076 Merge "QA: update for rubocop offenses" 2015-02-20 17:02:37 +00:00
Cmcmahon 7d607dbfb6 QA: update for rubocop offenses
Do not name methods starting with "get"

Change-Id: If4adf0c775b031d6a462e00aed8b588077169413
2015-02-20 10:00:01 -07:00
jenkins-bot 5f93e4defe Merge "QA: more rubocop updates" 2015-02-20 16:57:10 +00:00
Cmcmahon 60a0e05c7c QA: more rubocop updates
No change to function at all

Change-Id: I150aed4379c75f716633cc4904cb9d8f388c9d45
2015-02-20 09:54:06 -07:00
jenkins-bot 1ae16a6358 Merge "QA: update for rubocop offenses" 2015-02-20 16:52:11 +00:00
Cmcmahon fcd695a076 QA: update for rubocop offenses
No change to function, just cleaning up

Change-Id: I1b0b4fe8e4f785cbeebc2d1415a45f831dc75f5c
2015-02-20 09:49:38 -07:00
Erik Bernhardson 91abb657c8 More gracefully handle unavailability of ParserFunctions in phpunit
Change-Id: I375c13e937892062b061940b2b9ac5bdd832ac9d
2015-02-17 14:53:51 -08:00
Matthias Mullie 0dee3d3587 Pass title along to signature parser
* Parser generates signature to compare against
* Signature can be overwritten per wiki, in NS_MEDIAWIKI
* Such overwritten default can be different depending on
  page the signature is on[1]
* Our comparison signature generation was page-agnostic
  (always from Title::newMainPage)
* Signatures didn't match up on own talk pages, where
  default signature is different

Also added 2 new tests cases & improved tests by also
setting the page

1: https://en.wikipedia.org/w/index.php?title=MediaWiki%3ASignature&diff=176507985&oldid=176229132

Bug: T78424
Change-Id: Ice151d4d16236a5d1556ef62805b61310c7beb85
2015-02-17 10:24:12 -08:00
Cmcmahon 46f2d7c46d QA: robustify Notification no-javascript test
Identify the first heading better

Change-Id: Idb029c43b20915022f4d566a7795c3e0ec55cea2
2015-02-09 13:48:02 -07:00
jenkins-bot 6f4d2b68fb Merge "Add tests for generateEventsForRevision" 2015-02-06 13:49:16 +00:00
Matthias Mullie 682eff7022 Add tests for generateEventsForRevision
Change-Id: I54d6904c613d6f58beaa4d8202a07f1bf5850e7e
2015-02-06 14:37:58 +01:00
jenkins-bot d3bfc5a5b9 Merge "Improve signature detection" 2015-02-06 01:21:27 +00:00
Matthias Mullie 58e1c765d6 Improve signature detection
Previously, there were a couple of hacks in play.
It was also not picking up ~~~ (signature without timestamp)
And it relied an a nasty regular expression which, although
based on Parser, may some day get out of date.
And it relied heavily on a specific signature format, which
isn't guaranteed (it's an i18n msg)

This patch changes the approach: it will use a very simple
regex to match links, and will send those through Parser to
generate the signature anew. My reasoning is that that should
be exactly the same as what Echo just received (should've
also gone through parser)

Biggest discomfort of this approach is that it's much stricter.
It should still match whatever it generated from a ~~~ or ~~~~,
but no longer the e.g. not-real signatures we were doing in
our tests. Also had to update our tests, because signatures
change depending on anon. So I had to generate all the users.
And fix some of the signature formats used in the tests.

Bug: T75426
Bug: T87852
Bug: T75366
Bug: T78424
Change-Id: Ibeff36397129fdd5d376f3668a23a45f9a014525
2015-02-05 20:45:19 +01:00
jenkins-bot 028388aa6c Merge "Bug: Fails signature detection with extra long signature" 2015-01-31 01:13:43 +00:00
Kunal Mehta 3e94bfac8b Start tests for the built-in notification types
* Only covers EchoHooks::onUserRights right now, more
  patches to follow

Change-Id: Ie93eff0a9a75a4a9816c81d57b7530149a14bb7a
2015-01-30 18:09:04 +00:00
Erik Bernhardson bf5ff9b8ea Rework broken echo test to make less assumptions
Change-Id: Id73794e3555ef18e5dde0c40b8f9ab8eba53eb96
2015-01-29 16:45:05 -08:00
Antoine Musso 7f5b0c1793 Fix EchoTitleLocalCacheTest::testGet corner case
EchoTitleLocalCache title cache resolution ends up querying the database
to resolve title id to Title object.

In some corner case, we might only have one page in the database (UTPage
as provided by MediaWikiTestCase), thus the id 2 would not resolve to a
Title breaking the test.

Use insertPage() to ensure we have a second page.

Bug: T78592
Change-Id: Ia9dbb256f566e489e1c81d89b6a6077831e07fc3
2015-01-09 13:54:08 +01:00
Erik Bernhardson 2578c37d6c Bug: Fails signature detection with extra long signature
There were two different circumstances that could trigger echo's signature
detection to fail: multibyte characters in signature, and signatures near
$wgMaxSigChars limit that expanded past the limit due to wfEscapeWikiText().

This patch adjusts to use mb_substr to appropriatly handle the multibyte
characters, and adds a couple extra charactesr to $wgMaxSigChars to allow
for wfEscapeWikiText().  This isn't perfect, but a stricter implementation
would require much more work than i think we should spend here.

Bug: 73426
Change-Id: Ic51c2bc2a08600f188db13a9a0537f1321c9a655
2014-12-03 11:33:39 -08:00
Cmcmahon bf9773e6ed QA update for single quote preference
Change-Id: I35d22c47abd78a588f622b9b7cd07444c345db5a
2014-11-10 14:21:28 -07:00
Cmcmahon 6468f8e575 QA update quotes for string interpolation
Change-Id: Ic74333eea147183f407ffbe2b5319bb4683b5833
2014-11-10 14:14:52 -07:00
Cmcmahon 1ac73fa54b QA: rubocop updates
Change-Id: I580ec597dbb0d1dcd0830233995f94bc27d10278
2014-11-10 10:50:10 -07:00
Cmcmahon 0bfd18dbc7 QA: rubocop config updated to baseline again
Change-Id: Ic399ef9bb681cfed25b0b775b0c430e338f11bd3
2014-11-07 14:19:31 -07:00
jenkins-bot c5559da8cb Merge "Detect signature using Title class" 2014-10-23 21:25:37 +00:00
Željko Filipin 57241c6867 Prepare repository for running RuboCop after every push to Gerrit
For now ignoring all problems.

Bug: 69245
Change-Id: I0e411fba725ecd9aea0ef9d40a145efb62bbf0fa
2014-10-21 12:59:54 +02:00
Erik Bernhardson 8da75c3a50 Detect signature using Title class
Currently echo attempts to find a signature by looking for a series of
strings starting with what it thinks are the current aliases of NS_USER
and NS_USER_TALK.  This has shown to be error prone, see the linked bug
for how a change to ru.wikipedia.org/wiki/Mediawiki:Signature broke
mention notifications.

Patch switches things arround to pull wikilinks out of the text and run
them through the Title class.  The results of this parsing are checked
for NS_USER and NS_USER_TALK, giving a much stronger guarantee of finding
translated namespaces.

Bug: 71353
Change-Id: Ib0d0f4e068339d2fd28761087c05f5a1acb3c1fc
2014-09-30 19:06:16 -07:00
bsitu 55ef794d74 Add job to keep user notifications in reasonable volume
Change-Id: I4d4fa4c987a1732e5e29536a7669e28c34d4ab18
2014-09-29 23:10:18 +00:00
jenkins-bot 94736491cb Merge "QA: replace hard-coded 7 seconds sleep with poll method" 2014-09-25 22:52:17 +00:00
jenkins-bot d3a093ae68 Merge "QA update feature descriptions for messages test" 2014-09-25 21:41:04 +00:00
Cmcmahon 530688aa39 QA: replace hard-coded 7 seconds sleep with poll method
The step formerly know as "I come back from grabbing a cup of coffee"
is replaced by a step that reloads the page a number of times, where
that number may be set by the user.  If the notification has arrived,
the polling stops and the test continues.

In practice with a local browser pointed to beta labs, the
notification is arriving in plenty of time for the first page load
and I do not see the page reloading at all.

Change-Id: I95dd77d4f5525645e46244e40bfcd86e9124f3b1
2014-09-24 15:07:10 -07:00
Cmcmahon 8f2681c01b QA update feature descriptions for messages test
Cucumber Scenario and Feature description are just plain text.
Instead of using comments, it is far better to describe in each
test step what should happen in each test step.

I believe I have described these test steps correctly. Please
advise if they need to be tweaked.

(The test itself seems to be fine, but feel free to review that
also)

Finally, since messages.feature uses the "I have no new notifications"
step, I updated those assertions for modern RSpec syntax

Change-Id: Ie884a85c1fc3f7045773a271a8d76fad6b0b3826
2014-09-24 11:50:18 -07:00
Cmcmahon 4961e32b53 QA: add modern assertions to flyout tests
"Then" steps should always contains RSpec assertions. In the
past this meant using some version of the word "should", but
the modern convention in RSpec is to use "expect()" as I
did here.

Change-Id: I1c438a310803e29c0985328a76d2ec08578e0cb0
2014-09-23 14:14:47 -07:00
Cmcmahon b3df4d0814 QA: Refactoring and making the nojs test dtrt
* add @custom_browser tag so we don't create an extra browser instance
* remove @chrome tag because this only works in Firefox
* alphabetize within G/W/T buckets in commons_steps.rb
* alphabetize flyout_steps.rb
* bring env.rb up to date with the modern situation
* make assertions about the URL and heading on the final destination page
* update Ruby gems, especially mediawiki-selenium with a @custom_browser improvement
** use modern RSpec assert syntax
*** we're going to have to update all the repos for this soon

Change-Id: I6cb20126a662bd2a20e2b4bbebe91e8f3b04c7df
2014-09-23 13:35:50 -07:00
Cmcmahon 50790b2965 QA: refactor for consistent Ruby practice
* use symbols not strings for element labels
* use double quotes except where single quotes required

Change-Id: I4eef50206c526611da535e529035c076d5bce266
2014-09-17 16:27:24 -07:00