Opened 3 weeks ago

Closed 4 days ago

#37180 closed Cleanup/optimization (fixed)

Fix assertions in SelectFilter height selenium tests.

Reported by: Varun Kasyap Pentamaraju Owned by: Varun Kasyap Pentamaraju
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Varun Kasyap Pentamaraju)

in test_selectbox_height_collapsible_fieldset and test_selectbox_height_not_collapsible_fieldset tests in admin_views/tests.py (introduced in #33024)

these tests compare the height of the inner <select> boxes (from_box and to_box)

since, the UI was updated to use CSS Flexbox, Flexbox makes the outer containers (.selector-available and .selector-chosen) equal in height, not the inner <select> boxes.

as shown in attached screenshot:
Because the help text for the right box ("Remove toppings...") is longer than the left box ("Choose toppings..."), it can wrap into an extra line on smaller screens. When the text wraps into 3 lines, Flexbox automatically shrinks the inner <select> box to adjust. This means the inner boxes will have different heights.

The current Selenium tests are passing mostly by luck. But if the test runs in a different window size, it could fail.

We should update the test to compare the heights of the outer flex containers only.

Attachments (1)

ss.png (33.6 KB ) - added by Varun Kasyap Pentamaraju 3 weeks ago.

Download all attachments as: .zip

Change History (8)

by Varun Kasyap Pentamaraju, 3 weeks ago

Attachment: ss.png added

comment:1 by Varun Kasyap Pentamaraju, 3 weeks ago

Description: modified (diff)

comment:2 by Jacob Walls, 3 weeks ago

Component: Testing frameworkcontrib.admin
Type: UncategorizedCleanup/optimization

Thanks, I've noticed this as well.

comment:3 by Tim Graham, 3 weeks ago

Triage Stage: UnreviewedAccepted

comment:4 by Amar, 3 weeks ago

Owner: set to Amar
Status: newassigned

comment:5 by Varun Kasyap Pentamaraju, 9 days ago

Has patch: set
Owner: changed from Amar to Varun Kasyap Pentamaraju

Sorry Amar, I'm picking this

https://github.com/django/django/pull/21580

comment:6 by Sarah Boyce, 4 days ago

Triage Stage: AcceptedReady for checkin

comment:7 by Sarah Boyce <42296566+sarahboyce@…>, 4 days ago

Resolution: fixed
Status: assignedclosed

In ecc6197:

Fixed #37180 -- Fixed admin SelectBox height tests to verify available/chosen box heights.

Note: See TracTickets for help on using tickets.
Back to Top