Possible project for any of the hackathons.
I've seen in multiple projects that browser test pages specify strings with messages from the HTML:
* [[ https://gerrit.wikimedia.org/r/#/c/192540/1/tests/browser/features/support/pages/not_found_page.rb | Example in gather (cant use ids because title changes from skin to skin) ]]
* [[ http://git.wikimedia.org/blob/mediawiki%2Fextensions%2FMobileFrontend.git/master/tests%2Fbrowser%2Ffeatures%2Fsupport%2Fpages%2Farticle_page.rb#L50 | Example in mobile frontend ]].
Those messages are brittle because if they change or they get translated differently the tests will break.
i18n messages have good conventions around them, so we should be able to scan and grab the messages from mediawiki core, and from the installed extensions and put them on a hash we can use in the pages (concrete design of the code open to thoughts) so that we can reference elements by text in a solid way that wont break (and also test cross-language tests without trouble).
The idea would be that instead of doing this:
h1(:title, text: 'Error - Page not found')
We could do something like (syntax open to discussion):
h1(:title, text: messages[:en]['mobile-frontend-generic-404-title'])
And grab the i18n message from the actual json files.
With Zeljko we made a small [[ https://gerrit.wikimedia.org/r/#/c/192542/1 | proof of concept to show it working and serve as inspiration/test : https://gerrit.wikimedia.org/r/#/c/192542/1 ]]