Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] Update widgetastic.patternfly to fix FlashMessages exception handling #9970

Merged
merged 1 commit into from
Mar 12, 2020
Merged

[1LP][RFR] Update widgetastic.patternfly to fix FlashMessages exception handling #9970

merged 1 commit into from
Mar 12, 2020

Conversation

tpapaioa
Copy link
Contributor

@tpapaioa tpapaioa commented Mar 5, 2020

This PR updates widgetastic.patternfly to include the changes in:

Add NoSuchElementException handling back into FlashMessages.
RedHatQE/widgetastic.patternfly#118

This will resolve the test failures caused by NoSuchElementException errors in recent SSUI tests, such as the following:

        with appliance.context.use(context):
            dashboard = Dashboard(appliance)
>           assert dashboard.retired_services() == dashboard.results()

cfme/tests/ssui/test_ssui_dashboard.py:218: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[...]
cfme/base/ssui.py:185: in step
    self.obj.login()
.cfme_venv/lib64/python3.7/site-packages/sentaku/context.py:131: in __call__
    return bound_method(*k, **kw)
cfme/base/ssui.py:156: in login
    login_view.flash.assert_no_error()
.cfme_venv/lib64/python3.7/site-packages/widgetastic/widget/base.py:67: in wrapped
    return method(self, *new_args, **new_kwargs)
.cfme_venv/lib64/python3.7/site-packages/widgetastic_patternfly/__init__.py:2916: in assert_no_error
    for msg in self.messages(**msg_filter):
.cfme_venv/lib64/python3.7/site-packages/widgetastic_patternfly/__init__.py:2876: in messages
    stop = self.msg_count + 1
.cfme_venv/lib64/python3.7/site-packages/widgetastic_patternfly/__init__.py:2821: in msg_count
    return len(self.browser.elements(self.MSG_LOCATOR, parent=self))
[...]
E           selenium.common.exceptions.NoSuchElementException: Message: Could not find an element Locator(by='xpath', locator='.//div[@id="flash_msg_div"]')

.cfme_venv/lib64/python3.7/site-packages/widgetastic/browser.py:352: NoSuchElementException (cfme/fixtures/log.py:84)

It appears that although cfme.base.ssui.LoginPage includes a nested FlashMessages view, the corresponding div element does not actually exist when viewing the page in the browser. A future PR should clean up this and other view classes that include FlashMessages but shouldn't.

{{ pytest: cfme/tests/ssui/test_ssui_dashboard.py -v }}

@mshriver mshriver self-assigned this Mar 5, 2020
@mshriver mshriver added the requirements Changes to requirements label Mar 5, 2020
@tpapaioa tpapaioa changed the title [WIPTEST] Update widgetastic.patternfly to fix FlashMessages exception handling [WIP] Update widgetastic.patternfly to fix FlashMessages exception handling Mar 5, 2020
@tpapaioa tpapaioa changed the title [WIP] Update widgetastic.patternfly to fix FlashMessages exception handling [WIPTEST] Update widgetastic.patternfly to fix FlashMessages exception handling Mar 5, 2020
@tpapaioa tpapaioa changed the title [WIPTEST] Update widgetastic.patternfly to fix FlashMessages exception handling [RFR] Update widgetastic.patternfly to fix FlashMessages exception handling Mar 5, 2020
@dajoRH dajoRH removed the WIP-testing label Mar 5, 2020
@john-dupuy john-dupuy changed the title [RFR] Update widgetastic.patternfly to fix FlashMessages exception handling [1LP][RFR] Update widgetastic.patternfly to fix FlashMessages exception handling Mar 12, 2020
@mshriver mshriver merged commit c63598e into ManageIQ:master Mar 12, 2020
@tpapaioa tpapaioa deleted the flash_exception_handling branch March 12, 2020 14:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lint-ok requirements Changes to requirements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants