Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#29892 closed Bug (fixed)

Multiple Selenium test failures in Firefox

Reported by: Tom Forbes Owned by: nobody
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: jon.dufresne@… 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

When running the Selenium tests on master with the latest Firefox (63) installed on MacOS 10.14 I get the following tests failing:

test_textarea_trailing_newlines (forms_tests.tests.test_widgets.LiveWidgetTests)
test_select (admin_views.test_autocomplete_view.SeleniumTests)
test_prepopulated_fields (admin_views.tests.SeleniumTests)
test_date_time_picker_shortcuts (admin_widgets.tests.DateTimePickerAltTimezoneSeleniumTests)
test_date_time_picker_shortcuts (admin_widgets.tests.DateTimePickerShortcutsSeleniumTests)
test_select_multiple (admin_views.test_autocomplete_view.SeleniumTests)
test_first_field_focus (admin_views.tests.SeleniumTests)

Two of these failures do not appear at first to be related to the browser itself, however interestingly enough they do not fail on Chrome at all and reliably fail on Firefox.

I've also attached full stacktraces below.

Attachments (1)

failures.txt (8.2 KB ) - added by Tom Forbes 6 years ago.

Download all attachments as: .zip

Change History (14)

by Tom Forbes, 6 years ago

Attachment: failures.txt added

comment:1 by Simon Charette, 6 years ago

FWIW I had to disable selenium tests on a lot of projects on FF since they moved to WebDriver as it broke a lot of stuff.

comment:2 by Tim Graham, 6 years ago

Resolution: needsinfo
Status: newclosed

Yes, the selenium tests haven't worked on Firefox since the switch to geckodriver. Feel free to reopen and submit a patch if you find that Django is at fault.

comment:3 by Tom Forbes, 6 years ago

Ok, thanks for the info. If I have time to investigate I will look into the two Python failures as they are the most suspicious.

comment:4 by Jon Dufresne, 5 years ago

Cc: jon.dufresne@… added

I think some of the failures are due to the behavior described in https://github.com/mozilla/geckodriver/issues/878 That is, the current page isn't invalidated after a .submit() call so selenium driver doesn't wait for a page reload.

If I understand the Firefox people correctly, Element.submit() should not be used as it isn't a WebDriver primitive.

comment:5 by Jon Dufresne, 5 years ago

Has patch: set

PR https://github.com/django/django/pull/12147 for tests:

test_date_time_picker_shortcuts (admin_widgets.tests.DateTimePickerAltTimezoneSeleniumTests)
test_date_time_picker_shortcuts (admin_widgets.tests.DateTimePickerShortcutsSeleniumTests)

(I think this ticket should be reopened.)

comment:6 by Jon Dufresne, 5 years ago

Resolution: needsinfo
Status: closednew
Triage Stage: UnreviewedAccepted

PR to fix all tests with Firefox.

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

comment:7 by Carlton Gibson <carlton.gibson@…>, 5 years ago

In f0ed38ed:

Refs #29892 -- Replaced Selenium .submit() shim with .click() on the submit button.

There is no WebDriver submit primitive. The Selenium project implements
it as a convenience only. The geckodriver developers recommend against
using it. Replace it with a real primitive, click on the submit button.

Fixes failing Seleninum test test_date_time_picker_shortcuts when using
the Firefox Selenium driver.

comment:8 by Carlton Gibson <carlton.gibson@…>, 5 years ago

Resolution: fixed
Status: newclosed

In 875e3ff4:

Fixed #29892 -- Added .wait_page_loaded() in SeleniumTests.test_first_field_focus().

comment:9 by Carlton Gibson, 5 years ago

Resolution: fixed
Status: closednew

Ooops. I should have updated the commit message on 875e3ff4fd883e11008ca9dfcf02b8314c57c0a6 to be Refs. PR12152 is still incoming.

comment:10 by Carlton Gibson, 5 years ago

Triage Stage: AcceptedReady for checkin

comment:11 by GitHub <noreply@…>, 5 years ago

Resolution: fixed
Status: newclosed

In c33eb6d:

Fixed #29892 -- Added explicit Selenium wait in admin autocomplete tests.

comment:12 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 65285d1e:

Refs #29892 -- Made Selenium tests wait for popups to be ready.

comment:13 by GitHub <noreply@…>, 5 years ago

In d15d824:

Refs #29892 -- Fixed selenium test test_inline_formset_error_input_border on Firefox.

Firefox does not include shorthand properties, such as "border", in the
computed CSS properties object. This is documented at MDN:

https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle

The returned CSSStyleDeclaration object contains active values for CSS
property longhand names. For example, border-bottom-width instead of
the border-width and border shorthand property names. It is safest to
query values with only longhand names like font-size. Shorthand names
like font will not work with most browsers.

This difference between Firefox and Chrome is also discussed in the
stackoverflow thread at:

https://stackoverflow.com/a/32296604

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