Related: T248484: Core's selenium tests should not depend on Vector
The POC implementation of Desktop Improvements' drop-down usermenu failed one browser test (source): the username couldn't be read from the hidden user menu.
Reason: Webdriver's .getText() (api) returns empty string on hidden elements (source).
Example
https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-docker/52558/console
20:48:45 [0-5] AssertionError [ERR_ASSERTION] in "User should be able to log in @daily" 20:48:45 Input A expected to strictly equal input B: 20:48:45 + expected - actual 20:48:45 20:48:45 - '' 20:48:45 + 'User-0.2950667500966373-Iñtërnâtiônàlizætiøn'
Screenshot location: https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-docker/52558/artifact/log/User-should-be-able-to-log-in-%2540daily.png
Solution
Use .getHtml() which works on hidden elements and a selector specific to the innermost element (child of #pt-userpage).
Patch: 579572
The patch works for both old Vector and the new layout.