Page MenuHomePhabricator

browsertests fail if wiki messages aren't customized exactly like enwiki
Closed, ResolvedPublic

Description

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


Version: wmf-deployment
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=60347

Details

Reference
bz54206

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:53 AM
bzimport set Reference to bz54206.
bzimport added a subscriber: Unknown Object (MLST).

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.

Should this be merged with bug #54349?

Chris, as far as I remember all tests in core are working in all languages. Can this be resolved now?