[Django] #26048: Switch selenium tests to use implicitly_wait() instead of custom wait functions.

19 views
Skip to first unread message

Django

unread,
Jan 6, 2016, 7:44:53 PM1/6/16
to django-...@googlegroups.com
#26048: Switch selenium tests to use implicitly_wait() instead of custom wait
functions.
------------------------------------------------+------------------------
Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
From the selenium docs, "Dependent on several factors, including the
OS/Browser combination, WebDriver may or may not wait for the page to
load. In some circumstances, WebDriver may return control before the page
has finished, or even started, loading. To ensure robustness, you need to
wait for the element(s) to exist in the page using Explicit and Implicit
Waits."

Currently, we have a collection of
[https://github.com/django/django/blob/7f7553dd30534d606c84952a3f6dcb64b396ce37/django/contrib/admin/tests.py#L49-L120
wait_for*] methods to accomplish this. The idea is to switch our code to
call `self.selenium.implicitly_wait(10)` after initializing
`self.selenium` which should allow us to remove many of these waiting
calls.

--
Ticket URL: <https://code.djangoproject.com/ticket/26048>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 6, 2016, 7:52:04 PM1/6/16
to django-...@googlegroups.com
#26048: Switch selenium tests to use implicitly_wait() instead of custom wait
functions.
--------------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Description changed by timgraham:

Old description:

> From the selenium docs, "Dependent on several factors, including the
> OS/Browser combination, WebDriver may or may not wait for the page to
> load. In some circumstances, WebDriver may return control before the page
> has finished, or even started, loading. To ensure robustness, you need to
> wait for the element(s) to exist in the page using Explicit and Implicit
> Waits."
>
> Currently, we have a collection of
> [https://github.com/django/django/blob/7f7553dd30534d606c84952a3f6dcb64b396ce37/django/contrib/admin/tests.py#L49-L120
> wait_for*] methods to accomplish this. The idea is to switch our code to
> call `self.selenium.implicitly_wait(10)` after initializing
> `self.selenium` which should allow us to remove many of these waiting
> calls.

New description:

From the selenium docs, "Dependent on several factors, including the
OS/Browser combination, WebDriver may or may not wait for the page to
load. In some circumstances, WebDriver may return control before the page
has finished, or even started, loading. To ensure robustness, you need to
wait for the element(s) to exist in the page using

[http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp#explicit-and-
implicit-waits-reference Explicit and Implicit Waits]."

Currently, we have a collection of
[https://github.com/django/django/blob/7f7553dd30534d606c84952a3f6dcb64b396ce37/django/contrib/admin/tests.py#L49-L120
wait_for*] methods to accomplish this. The idea is to switch our code to
call `self.selenium.implicitly_wait(10)` after initializing
`self.selenium` which should allow us to remove many of these waiting
calls.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/26048#comment:1>

Django

unread,
Jan 6, 2016, 7:56:24 PM1/6/16
to django-...@googlegroups.com
#26048: Switch selenium tests to use implicitly_wait() instead of custom wait
functions.
--------------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"b2cddeaaf448234713f393749ceb1dbe22101f39" b2cddeaa]:
{{{
#!CommitTicketReference repository=""
revision="b2cddeaaf448234713f393749ceb1dbe22101f39"
Refs #26048 -- Fixed a flaky i18n selenium test: test_javascript_gettext.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26048#comment:2>

Django

unread,
Jan 11, 2016, 11:28:50 AM1/11/16
to django-...@googlegroups.com
#26048: Switch selenium tests to use implicitly_wait() instead of custom wait
functions.
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: | Status: assigned
Cleanup/optimization |
Component: contrib.admin | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* owner: nobody => timgraham
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/26048#comment:3>

Django

unread,
Jan 11, 2016, 12:29:51 PM1/11/16
to django-...@googlegroups.com
#26048: Switch selenium tests to use implicitly_wait() instead of custom wait
functions.
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: | Status: assigned
Cleanup/optimization |
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* cc: apollo13 (added)
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/5968 PR]. Unfortunately, I think we
still need to keep some waits after actions like clicks if they aren't
followed by other selenium queries.

--
Ticket URL: <https://code.djangoproject.com/ticket/26048#comment:4>

Django

unread,
Jan 11, 2016, 12:46:41 PM1/11/16
to django-...@googlegroups.com
#26048: Switch selenium tests to use implicitly_wait() instead of custom wait
functions.
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: | Status: assigned
Cleanup/optimization |
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by apollo13):

That is not so unfortunate, at least now we should be able to know when to
add them ;)

--
Ticket URL: <https://code.djangoproject.com/ticket/26048#comment:5>

Django

unread,
Jan 11, 2016, 2:17:01 PM1/11/16
to django-...@googlegroups.com
#26048: Switch selenium tests to use implicitly_wait() instead of custom wait
functions.
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: | Status: closed
Cleanup/optimization |
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"294d0d88158fa83eb095d663d054038ce9dfc3d4" 294d0d8]:
{{{
#!CommitTicketReference repository=""
revision="294d0d88158fa83eb095d663d054038ce9dfc3d4"
Fixed #26048 -- Made admin selenium tests use implicitly_wait()
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26048#comment:6>

Django

unread,
Jan 14, 2016, 7:38:46 PM1/14/16
to django-...@googlegroups.com
#26048: Switch selenium tests to use implicitly_wait() instead of custom wait
functions.
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: | Status: closed
Cleanup/optimization |
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"3486311a42728e0c9752bda16ac712797f5a6af9" 3486311]:
{{{
#!CommitTicketReference repository=""
revision="3486311a42728e0c9752bda16ac712797f5a6af9"
Refs #26048 -- Fixed a flaky selenium test.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26048#comment:7>

Reply all
Reply to author
Forward
0 new messages