Opened 6 years ago

Closed 6 years ago

Last modified 17 months ago

#30220 closed Cleanup/optimization (fixed)

Use headless browsers for selenium tests

Reported by: Johannes Maron Owned by: Johannes Maron
Component: Testing framework 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: yes

Description

Both Chrome and Firefox support a new headless mode now. Besides being faster, it also is more reliable as well as convenient since there are no windows popping up.

I already gave it a try, I don't see any reason not to use the headless mode for the browsers that are supporting the feature. However I don't know how the jenkins setup works. Does that use a remote test server or does it use the browsers locally?

Change History (9)

comment:1 by Johannes Maron, 6 years ago

Owner: changed from nobody to Johannes Maron

comment:2 by Tim Graham, 6 years ago

Jenkins uses xfvb-run to run the tests headlessly. Does your proposal require changes to Django? Even if we changed the default to run the tests headlessly, I think we would still want to be able to run the tests and watch their execution for debugging purposes.

comment:3 by Johannes Maron, 6 years ago

It opened a PR with a possible implementation: https://github.com/django/django/pull/11033
It would be possible to add a command line argument to run it headless or not headless.

comment:4 by Carlton Gibson, 6 years ago

Has patch: set
Needs documentation: set
Needs tests: set
Triage Stage: UnreviewedAccepted

Hey Joe. — I could certainly benefit from a --headless flag (or something) to runtests.py.

  • I ticked Needs Docs because I couldn't see straight from the PR how I'd use it?
  • I ticked Needs Tests, but if it's just runtests..., and if Jenkins already does that... 🤔

comment:5 by Johannes Maron, 6 years ago

Needs documentation: unset

Hi Carlton,

I did add new CLI option and added documentation. However I don't really know how I would tests this. Since the selenium tests on Jenkins don't even run in the regular selenium mode but, this is somewhat tricky. I did however test it locally. I don't have windows tho. If you happen to have windows and would tests this wil IE, that would be great.

Best
-Joe

comment:6 by Carlton Gibson, 6 years ago

Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 8d010f39:

Fixed #30220 -- Added support for headless mode in selenium tests.

comment:8 by GitHub <noreply@…>, 17 months ago

In 06881341:

Refs #30220 -- Bumped required version of Selenium to 3.8.0.

Follow up to 8d010f39869f107820421631111417298d1c5bb9.

comment:9 by Mariusz Felisiak <felisiak.mariusz@…>, 17 months ago

In 4b433ef:

[4.2.x] Refs #30220 -- Bumped required version of Selenium to 3.8.0.

Follow up to 8d010f39869f107820421631111417298d1c5bb9.
Backport of 06881341d48dd17a4fdf25afc96991de4fb3b1ac from main

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