Page MenuHomePhabricator

Selenium test 'should be able to log in @daily' fails when the user menu is hidden
Closed, ResolvedPublic

Description

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.

Event Timeline

Change 579572 had a related patch set uploaded (by Aron Manning; owner: Aron Manning):
[mediawiki/core@master] Adapt test 'should be able to log in @daily' for Desktop Improvements' drop-down usermenu

https://gerrit.wikimedia.org/r/579572

Jdlrobson subscribed.

This is not strictly related to desktop improvements as no code has landed yet so leaving in the capable hands of the QA team who manages these tests. Thanks for flagging this Aron.

Change 579572 abandoned by Aron Manning:
Adapt test 'should be able to log in @daily' for Desktop Improvements' drop-down usermenu

Reason:
Resolved by https://gerrit.wikimedia.org/r/c/mediawiki/core/ /583361

https://gerrit.wikimedia.org/r/579572

Demian reassigned this task from Demian to kostajh.
Demian removed a project: Patch-For-Review.
Demian updated the task description. (Show Details)
Demian added a subscriber: kostajh.