0

I recently upgraded Django from 1.6.11 to 1.8.9, and all of our integration tests are failing. All of these tests passed in 1.16.11.

Some examples of errors I get are:

    And I should see "Announcements" somewhere in the page within 5 seconds                                     # home/ubuntu/virtualenvs/venv-system/local/lib/python2.7/site-packages/salad/steps/browser/elements.py:10
And I should see "Announcements" somewhere in the page within 5 seconds                                     # home/ubuntu/virtualenvs/venv-system/local/lib/python2.7/site-packages/salad/steps/browser/elements.py:10
Traceback (most recent call last):
  File "/home/ubuntu/virtualenvs/venv-system/local/lib/python2.7/site-packages/lettuce/core.py", line 144, in __call__
    ret = self.function(self.step, *args, **kw)
  File "/home/ubuntu/virtualenvs/venv-system/local/lib/python2.7/site-packages/salad/steps/browser/elements.py", line 11, in should_see_in_the_page
    assert_with_negate(text in world.browser.html, negate)
  File "/home/ubuntu/virtualenvs/venv-system/local/lib/python2.7/site-packages/salad/tests/util.py", line 19, in assert_with_negate
    assert assertion
AssertionError

And I click on the element with the css selector ".banner-announcement-dismiss"                             # home/ubuntu/virtualenvs/venv-system/local/lib/python2.7/site-packages/salad/steps/browser/mouse.py:49
salad - ERROR - Element not found: find_by_css for .banner-announcement-dismiss
And I click on the element with the css selector ".banner-announcement-dismiss"                             # home/ubuntu/virtualenvs/venv-system/local/lib/python2.7/site-packages/salad/steps/browser/mouse.py:49
Traceback (most recent call last):
  File "/home/ubuntu/virtualenvs/venv-system/local/lib/python2.7/site-packages/lettuce/core.py", line 144, in __call__
    ret = self.function(self.step, *args, **kw)
   File "/home/ubuntu/virtualenvs/venv-system/local/lib/python2.7/site-packages/salad/steps/browser/mouse.py", line 50, in _this_step
ele = _get_element(finder_function, first, last, find_pattern)
   File "/home/ubuntu/virtualenvs/venv-system/local/lib/python2.7/site-packages/salad/steps/browser/finders.py", line 43, in _get_element
raise ElementDoesNotExist
ElementDoesNotExist

Does anyone have ideas of what might be going wrong? I am running the following versions:

Django==1.8.9
lettuce==0.2.21
salad==0.4.14
splinter==0.7.3
Julie Qiu
  • 59
  • 5

2 Answers2

0

Looks like layout have been changed and there's no more element with css class ".banner-announcement-dismiss".

Eugene Lisitsky
  • 12,113
  • 5
  • 38
  • 59
0

I had to change from LiveServerTestCase to StaticLiveServerTestCase when I upgraded my project (that has Splinter tests) from Django 1.6 to 1.8.

Ben Konrath
  • 423
  • 4
  • 8
  • Were you able to configure your static files properly with whitenoise? Or did setting the LETTUCE_TEST_SERVER=StaticLiveServerTestCase in settings.py work for you? I ended up having to write a monkey patch on the lettuce service to allow it to work properly with whitenoise but was wondering if there is a way around that – Julie Qiu Mar 27 '16 at 04:59
  • I'm not using Lettuce, only Splinter. I only needed to change to using `StaticLiveServerTestCase` to get things to work. – Ben Konrath Mar 29 '16 at 19:43