I was about to open a proposal but I’m actually mixed with it so it’s more a brainstorming.
We have an important problem in XWiki that we all know about which is that we have no clear separation of the language of the UI and the language of the doc, leading to weird things like the UI suddenly switching to french when looking a french document in multilingual wiki.
One of the unexpected effect of that issue is that it’s currently very difficult to write UI tests which manipulates document translations: we currently do have many page objects that relies on displayed texts which are by nature translated. So we’d need to write the tests knowing in advance the translation and ensure the translation does not change.
So my first proposal was to add a new best practice, to ensure that PO would always use metadata to find elements and not displayed text. For example, currently the LiveData page objects only offers to find a cell by looking on the column name, instead of having a specific class name on the column to find it. Another example is the Diff page object which currently looks for “Page properties” to retrieve the diff.
I do think that it would make sense to fix those examples and to avoid in the future to rely on displayed text to find elements in new page objects APIs. And I think it would probably faster to fix those APIs now, than to properly fix the general problem we have in the mix of translated document / translated UI.
I’m mixed on adding it in the best practices, mainly because I think it’s a best practice we need because of a problem in XWiki. Now since I don’t have a good perspective on when this will be fixed, it might still be a good idea to write it down somewhere.