[Django] #31042: Rewrite AdminSeleniumTestCase.get_css_value() without jQuery.

10 views
Skip to first unread message

Django

unread,
Nov 27, 2019, 10:43:48 PM11/27/19
to django-...@googlegroups.com
#31042: Rewrite AdminSeleniumTestCase.get_css_value() without jQuery.
------------------------------------------------+------------------------
Reporter: Jon Dufresne | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
jQuery is used in `AdminSeleniumTestCase.get_css_value()` to query an
element by a CSS selector and then return a CSS property.

Both of these operations have equivalent native Browser support and so
this method does not require jQuery.

`jQuery()` → `document.querySelector()`
`.css()` → `HTMLElement.style`

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

Django

unread,
Nov 27, 2019, 10:46:08 PM11/27/19
to django-...@googlegroups.com
#31042: Rewrite AdminSeleniumTestCase.get_css_value() without jQuery.
-------------------------------------+-------------------------------------

Reporter: Jon Dufresne | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Nov 28, 2019, 2:15:36 AM11/28/19
to django-...@googlegroups.com
#31042: Rewrite AdminSeleniumTestCase.get_css_value() without jQuery.
-------------------------------------+-------------------------------------
Reporter: Jon Dufresne | Owner: Jon
Type: | Dufresne
Cleanup/optimization | Status: assigned

Component: Testing framework | 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 felixxm):

* owner: nobody => Jon Dufresne
* status: new => assigned
* stage: Unreviewed => Accepted


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

Django

unread,
Nov 28, 2019, 9:11:50 AM11/28/19
to django-...@googlegroups.com
#31042: Rewrite AdminSeleniumTestCase.get_css_value() without jQuery.
-------------------------------------+-------------------------------------
Reporter: Jon Dufresne | Owner: Jon
Type: | Dufresne
Cleanup/optimization | Status: closed

Component: Testing framework | 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 Carlton Gibson <carlton.gibson@…>):

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


Comment:

In [changeset:"c8bd37a8606a89b6e09854ab5f3bbaa98e849408" c8bd37a8]:
{{{
#!CommitTicketReference repository=""
revision="c8bd37a8606a89b6e09854ab5f3bbaa98e849408"
Fixed #31042 -- Removed AdminSeleniumTestCase.get_css_value() in favor of
Selenium .is_displayed().

All instances of AdminSeleniumTestCase.get_css_value() were used to
inspect the display property.
}}}

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

Reply all
Reply to author
Forward
0 new messages