Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix selenium integration tests #202

Open
tompollard opened this issue Jan 1, 2019 · 0 comments
Open

Fix selenium integration tests #202

tompollard opened this issue Jan 1, 2019 · 0 comments

Comments

@tompollard
Copy link
Member

The integration tests arbitrarily fail, possibly due to timing issues (e.g. looking for an element in a webpage before it is fully loaded). Some example errors are:

======================================================================
ERROR: test_publish (project.test_browser.TestSubmit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/src/github.com/MIT-LCP/physionet-build/physionet-django/project/test_browser.py", line 290, in test_publish
    'id_editor')).select_by_visible_text('admin')
  File "/root/venv/3.6/lib/python3.6/site-packages/selenium/webdriver/support/select.py", line 120, in select_by_visible_text
    self._setSelected(opt)
  File "/root/venv/3.6/lib/python3.6/site-packages/selenium/webdriver/support/select.py", line 212, in _setSelected
    option.click()
  File "/root/venv/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/root/venv/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute
    return self._parent.execute(command, params)
  File "/root/venv/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/root/venv/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: Element <option> could not be scrolled into view


----------------------------------------------------------------------
======================================================================
ERROR: test_publish (project.test_browser.TestSubmit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/src/github.com/MIT-LCP/physionet-build/physionet-django/project/test_browser.py", line 278, in test_publish
    self.selenium_login(username='admin', password='Tester11!', new=True)
  File "/root/src/github.com/MIT-LCP/physionet-build/physionet-django/project/test_browser.py", line 97, in selenium_login
    element.click()
  File "/root/venv/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/root/venv/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute
    return self._parent.execute(command, params)
  File "/root/venv/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/root/venv/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.StaleElementReferenceException: Message: The element reference of <a id="nav_account_dropdown" class="nav-link dropdown-toggle" href="#"> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed


----------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant