#25364: Provide a more generic way to test different browsers in selenium tests
-----------------------------------+------------------------------------
     Reporter:  timgraham          |                    Owner:  akki
         Type:  New feature        |                   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:  1
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------

Comment (by MoritzS):

 I may be a bit late for this, but I see a problem with this approach.
 Right now the selenium browser is started in `setUpClass()` and closed in
 `tearDownClass()`. This means that the browser has to be started once for
 every test class.

 This new approach does a bit of Meta class and method copying hacking to
 provide a new method `test_foo__browser` for all test functions and
 browsers. But then a single test class has tests for ''different''
 browsers. This means that the selenium browser started can't be started in
 `setUpClass()` so the logic for starting it was moved to `setUp()`. That
 however means that the browser is started and closed once for '''every'''
 test case. If you consider that starting the browser can take up to a few
 seconds (especially on the CI system), I'd say that solution is not
 acceptable.

 I can think of a solution that works by creating a new test class for each
 browser in the meta class' `__new__()` method and then return a proxy
 class containing those newly created classes that knows how to run the
 tests on all of them.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.dd78d8c8863a530d1ef578ed91dcfe22%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to