Last modified: 2014-06-30 22:33:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T56206, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54206 - browsertests fail if wiki messages aren't customized exactly like enwiki
browsertests fail if wiki messages aren't customized exactly like enwiki
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Quality Assurance (Other open bugs)
wmf-deployment
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-17 04:03 UTC by spage
Modified: 2014-06-30 22:33 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description spage 2013-09-17 04:03:55 UTC
I ran `bundle exec cucumber features/login.feature` per [1] in my MediaWiki-Vagrant instance and got two failures:

   expected "Login error\nYou have not specified a valid username." to match "You\\ have\\ not\\ specified\\ a\\ valid\\ user\\ name\\." 

  expected "Login error\nPassword entered was blank. Please try again." to match "The\\ password\\ field\\ was\\ empty\\.\\ Please\\ try\\ again\\." (RSpec::Expectations::ExpectationNotMetError)

The first one expects enwiki's modified noname message which adds a space in "user name" (https://test2.wikipedia.org/wiki/MediaWiki:Noname).  The second one expects enwiki's rewritten wrongpasswordempty message (https://test2.wikipedia.org/wiki/MediaWiki:Wrongpasswordempty).

Obviously any developer who just installed MediaWiki won't have these customizations, so the tests fail. And admins on enwiki regularly change its messages, so the tests are brittle.

Some of enwiki's modified messages helpfully include a
  <span id="mw-wrongpasswordempty">
which won't change, but the default form doesn't have this.

The tests could do more generic text matches such as '.*valid user.*', but almost nothing is in common between the default and enwiki for wrongpasswordempty. I think a better approach is to get tests to execute with the ?uselang=qqx language code in the query string, which renders message text as the message keys themselves and thus is independent of language and message tweaks.

[1] https://git.wikimedia.org/blob/mediawiki%2Fvagrant.git/HEAD/puppet%2Fmodules%2Fbrowsertests%2FREADME
Comment 1 Chris McMahon 2013-09-17 14:53:22 UTC
Unfortunately, while 

/wiki/Special:UserLogin?uselang=qqx 

does the right thing, upon entering an invalid password the user is sent to 

/w/index.php?title=Special:UserLogin&action=submitlogin&type=login 

where the password error message is not qqx.  Appending ?uselang=qqx to that url, 

(w/index.php?title=Special:UserLogin&action=submitlogin&type=login?uselang=qqx) 

has no effect, the qqx message keys do not appear. 

I agree that this test is brittle, and there are other tests with similar issues.
Comment 2 Željko Filipin 2013-12-02 16:27:12 UTC
Should this be merged with bug #54349?
Comment 3 Željko Filipin 2014-01-28 12:55:53 UTC
Duplicate of bug #60347?
Comment 4 Željko Filipin 2014-06-28 20:56:55 UTC
Chris, as far as I remember all tests in core are working in all languages. Can this be resolved now?
Comment 5 Antoine "hashar" Musso (WMF) 2014-06-30 22:33:46 UTC
Well done !

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links