Skip to content

Instantly share code, notes, and snippets.

@bobsilverberg
Created September 18, 2012 14:39
Show Gist options
  • Save bobsilverberg/3743482 to your computer and use it in GitHub Desktop.
Save bobsilverberg/3743482 to your computer and use it in GitHub Desktop.
Sumo failures on staging
~/Documents/gitRepos/sumo-tests[merge-redesign]$ py.test tests/desktop/ -n 4 --baseurl=http://support.allizom.org
========================================================================== test session starts ===========================================================================
platform darwin -- Python 2.6.7 -- pytest-2.2.4
gw0 [33] / gw1 [33] / gw2 [33] / gw3 [33]
scheduling tests via LoadScheduling
.............X...F..F.....F......
================================================================================ FAILURES ================================================================================
__________________________________________________________ TestKnowledgeBaseArticle.test_view_helpfulness_chart __________________________________________________________
[gw3] darwin -- Python 2.6.7 /Users/robertsilverberg/.virtualenvs/sumo-tests/bin/python
self = <tests.desktop.test_kb_article.TestKnowledgeBaseArticle instance at 0x1103c78c0>
mozwebqa = <pytest_mozwebqa.pytest_mozwebqa.TestSetup instance at 0x1103c71b8>
@pytest.mark.nondestructive
def test_view_helpfulness_chart(self, mozwebqa):
"""
Creates a new knowledge base article.
Verifies creation.
Deletes the article
"""
sumo_homepage = PageProvider(mozwebqa).home_page(do_login=True)
> contrib_page = sumo_homepage.click_knowledge_base_dashboard_link()
tests/desktop/test_kb_article.py:169:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pages.desktop.support_home_page.SupportHomePage object at 0x1103c3a90>
def click_knowledge_base_dashboard_link(self):
> self.selenium.find_element(*self._kb_dashboard_link_locator).click()
pages/desktop/support_home_page.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.firefox.webdriver.WebDriver object at 0x110124250>
by = 'link text', value = 'Knowledge Base Dashboard'
def find_element(self, by=By.ID, value=None):
"""
'Private' method used by the find_element_by_* methods.
:Usage:
Use the corresponding find_element_by_* instead of this.
"""
if isinstance(by, tuple) or isinstance(value, int) or value==None:
raise InvalidSelectorException("Invalid locator values passed in")
return self.execute(Command.FIND_ELEMENT,
> {'using': by, 'value': value})['value']
def find_elements(self, by=By.ID, value=None):
../../../.virtualenvs/sumo-tests/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py:671:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.firefox.webdriver.WebDriver object at 0x110124250>
driver_command = 'findElement'
params = {'sessionId': u'993c85e6-3a28-c548-a5cd-f1b28a00b65b', 'using': 'link text', 'value': 'Knowledge Base Dashboard'}
def execute(self, driver_command, params=None):
"""
Sends a command to be executed by a command.CommandExecutor.
:Args:
- driver_command: The name of the command to execute as a string.
- params: A dictionary of named parameters to send with the command.
:Returns:
The command's JSON response loaded into a dictionary object.
"""
if not params:
params = {'sessionId': self.session_id}
elif 'sessionId' not in params:
params['sessionId'] = self.session_id
params = self._wrap_value(params)
response = self.command_executor.execute(driver_command, params)
if response:
> self.error_handler.check_response(response)
../../../.virtualenvs/sumo-tests/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py:156:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x1103c3250>
response = {u'name': u'findElement', u'sessionId': u'993c85e6-3a28-c548-a5cd-f1b28a00b65b', u'status': 7, u'value': {u'message': ...wwbgbc4p9m0000gn/T/tmpd8nj7Z/extensions/fxdriver@googlecode.com/components/driver_component.js', u'lineNumber': 471}]}}
def check_response(self, response):
"""
Checks that a JSON response from the WebDriver does not have an error.
:Args:
- response - The JSON response from the WebDriver server as a dictionary
object.
:Raises: If the response contains an error message.
"""
status = response['status']
if status == ErrorCode.SUCCESS:
return
exception_class = ErrorInResponseException
if status == ErrorCode.NO_SUCH_ELEMENT:
exception_class = NoSuchElementException
elif status == ErrorCode.NO_SUCH_FRAME:
exception_class = NoSuchFrameException
elif status == ErrorCode.NO_SUCH_WINDOW:
exception_class = NoSuchWindowException
elif status == ErrorCode.STALE_ELEMENT_REFERENCE:
exception_class = StaleElementReferenceException
elif status == ErrorCode.ELEMENT_NOT_VISIBLE:
exception_class = ElementNotVisibleException
elif status == ErrorCode.INVALID_ELEMENT_STATE:
exception_class = InvalidElementStateException
elif status == ErrorCode.INVALID_SELECTOR \
or status == ErrorCode.INVALID_XPATH_SELECTOR \
or status == ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
exception_class = InvalidSelectorException
elif status == ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
exception_class = ElementNotSelectableException
elif status == ErrorCode.INVALID_COOKIE_DOMAIN:
exception_class = WebDriverException
elif status == ErrorCode.UNABLE_TO_SET_COOKIE:
exception_class = WebDriverException
elif status == ErrorCode.TIMEOUT:
exception_class = TimeoutException
elif status == ErrorCode.SCRIPT_TIMEOUT:
exception_class = TimeoutException
elif status == ErrorCode.UNKNOWN_ERROR:
exception_class = WebDriverException
elif status == ErrorCode.NO_ALERT_OPEN:
exception_class = NoAlertPresentException
elif status == ErrorCode.IME_NOT_AVAILABLE:
exception_class = ImeNotAvailableException
elif status == ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
exception_class = ImeActivationFailedException
else:
exception_class = WebDriverException
value = response['value']
if type(value) is str:
if exception_class == ErrorInResponseException:
raise exception_class(response, value)
raise exception_class(value)
message = ''
if 'message' in value:
message = value['message']
screen = None
if 'screen' in value:
screen = value['screen']
stacktrace = None
if 'stackTrace' in value and value['stackTrace']:
zeroeth = ''
try:
zeroeth = value['stackTrace'][0]
except:
pass
if zeroeth.has_key('methodName'):
stacktrace = "Method %s threw an error in %s" % \
(zeroeth['methodName'],
self._value_or_default(zeroeth, 'fileName', '[No file name]'))
if exception_class == ErrorInResponseException:
raise exception_class(response, message)
> raise exception_class(message, screen, stacktrace)
E NoSuchElementException: Message: u'Unable to locate element: {"method":"link text","selector":"Knowledge Base Dashboard"}'
../../../.virtualenvs/sumo-tests/lib/python2.6/site-packages/selenium/webdriver/remote/errorhandler.py:147: NoSuchElementException
---------------------------------------------------------------------------- pytest-mozwebqa -----------------------------------------------------------------------------
Failing URL: https://support.allizom.org/en-US/home
______________________________________________ TestQuestions.test_that_questions_sorts_correctly_by_filter_equal_to_solved _______________________________________________
[gw1] darwin -- Python 2.6.7 /Users/robertsilverberg/.virtualenvs/sumo-tests/bin/python
self = <tests.desktop.test_questions.TestQuestions instance at 0x10ca60b90>
mozwebqa = <pytest_mozwebqa.pytest_mozwebqa.TestSetup instance at 0x10ca57b00>
@pytest.mark.nondestructive
def test_that_questions_sorts_correctly_by_filter_equal_to_solved(self, mozwebqa):
"""
Goes to the /questions page,
Verifies the sort filter=solved works
"""
expected_sorted_text = "SOLVED"
questions_page = PageProvider(mozwebqa).questions_page()
questions_page.click_to_expand_sort_and_filter_box()
> Assert.true(questions_page.is_sort_and_filter_box_expanded)
tests/desktop/test_questions.py:45:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <class unittestzero.Assert at 0x10c8bfef0>, first = False, msg = None
@classmethod
def true(self, first, msg=None):
> assert first is True, msg
E assert False is True
../../../.virtualenvs/sumo-tests/lib/python2.6/site-packages/unittestzero.py:53: AssertionError
---------------------------------------------------------------------------- pytest-mozwebqa -----------------------------------------------------------------------------
Failing URL: https://support.allizom.org/en-US/questions
____________________________________________ TestQuestions.test_that_questions_sorts_correctly_by_filter_equal_to_no_replies _____________________________________________
[gw3] darwin -- Python 2.6.7 /Users/robertsilverberg/.virtualenvs/sumo-tests/bin/python
self = <tests.desktop.test_questions.TestQuestions instance at 0x110405f80>
mozwebqa = <pytest_mozwebqa.pytest_mozwebqa.TestSetup instance at 0x1104040e0>
@pytest.mark.nondestructive
def test_that_questions_sorts_correctly_by_filter_equal_to_no_replies(self, mozwebqa):
"""
Goes to the /questions page,
Verifies the sort filter=noreplies works
"""
expected_sorted_text = "No replies"
questions_page = PageProvider(mozwebqa).questions_page()
questions_page.click_to_expand_sort_and_filter_box()
> Assert.true(questions_page.is_sort_and_filter_box_expanded)
tests/desktop/test_questions.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <class unittestzero.Assert at 0x10ffd9ef0>, first = False, msg = None
@classmethod
def true(self, first, msg=None):
> assert first is True, msg
E assert False is True
../../../.virtualenvs/sumo-tests/lib/python2.6/site-packages/unittestzero.py:53: AssertionError
---------------------------------------------------------------------------- pytest-mozwebqa -----------------------------------------------------------------------------
Failing URL: https://support.allizom.org/en-US/questions
============================================================ 3 failed, 29 passed, 1 xpassed in 95.24 seconds =============================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment