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

Commit

Permalink
Merge pull request #8234 from izapolsk/fix_flash_in_hammer
Browse files Browse the repository at this point in the history
[1LP][RFR] unifying flash message xpaths and fixing issue in hammer
  • Loading branch information
mshriver committed Dec 7, 2018
2 parents f9516e1 + 985fd09 commit 665dc7e
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 23 deletions.
5 changes: 3 additions & 2 deletions cfme/automate/explorer/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,12 @@ def create(
add_page.validate_button.click()
add_page.wait_displayed()
add_page.flash.assert_no_error()
add_page.flash.assert_message('Data validated successfully')
add_page.flash.assert_message('Data validated successfully', wait=3)
if cancel:
add_page.cancel_button.click()
add_page.flash.assert_no_error()
add_page.flash.assert_message('Add of new Automate Method was cancelled by the user')
add_page.flash.assert_message('Add of new Automate Method was cancelled by the user',
wait=3)
return None
else:
add_page.add_button.click()
Expand Down
6 changes: 1 addition & 5 deletions cfme/base/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ class BaseLoggedInPage(View):
logged in.
"""
CSRF_TOKEN = '//meta[@name="csrf-token"]'
flash = FlashMessages(
'.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")] | '
'.//div[starts-with(@class, "flash_text_div") or @id="flash_text_div"]'
)
flash = FlashMessages('.//div[@id="flash_msg_div"]')
help = NavDropdown('.//li[./a[@id="dropdownMenu1"]]|.//li[./a[@id="help-menu"]]')
settings = SettingsNavDropdown('.//li[./a[@id="dropdownMenu2"]]')
navigation = VerticalNavigation('#maintab')
Expand Down
4 changes: 2 additions & 2 deletions cfme/base/ssui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SSUIBaseLoggedInPage(View):
"""This page should be subclassed by any page that models any other page that is available as
logged in.
"""
flash = FlashMessages('div#flash_text_div')
flash = FlashMessages('.//div[@id="flash_msg_div"]')
help = NavDropdown('.//li[./a[@id="dropdownMenu1"]]')
navigation = SSUIVerticalNavigation('//ul[@class="list-group"]')
domain_switcher = Button(id="domain-switcher")
Expand Down Expand Up @@ -82,7 +82,7 @@ def logout(self):


class LoginPage(View):
flash = FlashMessages('div#flash_text_div')
flash = FlashMessages('.//div[@id="flash_msg_div"]')
username = Input(id='inputUsername')
password = Input(id='inputPassword')
login = Button('Log In')
Expand Down
2 changes: 1 addition & 1 deletion cfme/base/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def address(self):


class LoginPage(View):
flash = FlashMessages('//div[@class="flash_text_div" or @id="flash_text_div"]')
flash = FlashMessages('.//div[@id="flash_msg_div"]')

class details(View): # noqa
region = Text('.//p[normalize-space(text())="Region:"]/span')
Expand Down
8 changes: 2 additions & 6 deletions cfme/configure/configuration/server_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ class ServerInformationView(View):
""" Class represents full Server tab view"""
title = Text("//div[@id='settings_server']/h3[1]")
# Local Flash widget for validation since class nested under a class inheriting BaseLoggedInPage
flash = FlashMessages('.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")] | '
'.//div[starts-with(@class, "flash_text_div") or @id="flash_text_div"]')
flash = FlashMessages('.//div[@id="flash_msg_div"]')
save = Button('Save')
reset = Button('Reset')

Expand Down Expand Up @@ -555,9 +553,7 @@ class ServerAuthenticationView(View):
""" Server Authentication View."""
title = Text("//div[@id='settings_authentication']/h3[1]")
# Local Flash widget for validation since class nested under a class inheriting BaseLoggedInPage
flash = FlashMessages('.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")] | '
'.//div[starts-with(@class, "flash_text_div") or @id="flash_text_div"]')
flash = FlashMessages('.//div[@id="flash_msg_div"]')
hours_timeout = BootstrapSelect(id='session_timeout_hours')
minutes_timeout = BootstrapSelect(id='session_timeout_mins')
# TODO new button widget to handle buttons_on buttons_off divs
Expand Down
4 changes: 1 addition & 3 deletions cfme/intelligence/reports/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ def open(self):


class SchedulesFormCommon(CloudIntelReportsView):
flash = FlashMessages('.//div[@id="flash_msg_div"]/div[@id="flash_text_div" or '
'contains(@class, "flash_text_div")] | '
'.//div[starts-with(@class, "flash_text_div") or @id="flash_text_div"]')
flash = FlashMessages('.//div[@id="flash_msg_div"]')
# Basic Information
title = Text("#explorer_title_text")
name = TextInput(name="name")
Expand Down
2 changes: 1 addition & 1 deletion requirements/frozen.py2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ webencodings==0.5.1
websocket-client==0.40.0
Werkzeug==0.14.1
widgetastic.core==0.30.3
widgetastic.patternfly==0.0.39
widgetastic.patternfly==0.0.40
widgetsnbextension==3.4.2
wrapanapi==3.0.33
wrapt==1.10.11
Expand Down
2 changes: 1 addition & 1 deletion requirements/frozen.py3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ webencodings==0.5.1
websocket-client==0.40.0
Werkzeug==0.14.1
widgetastic.core==0.30.3
widgetastic.patternfly==0.0.39
widgetastic.patternfly==0.0.40
widgetsnbextension==3.4.2
wrapanapi==3.0.33
wrapt==1.10.11
Expand Down
2 changes: 1 addition & 1 deletion requirements/frozen_docs.py2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ webencodings==0.5.1
websocket-client==0.40.0
Werkzeug==0.14.1
widgetastic.core==0.30.3
widgetastic.patternfly==0.0.39
widgetastic.patternfly==0.0.40
widgetsnbextension==3.4.2
wrapt==1.10.11
xmltodict==0.11.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/frozen_docs.py3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ webencodings==0.5.1
websocket-client==0.40.0
Werkzeug==0.14.1
widgetastic.core==0.30.3
widgetastic.patternfly==0.0.39
widgetastic.patternfly==0.0.40
widgetsnbextension==3.4.2
wrapt==1.10.11
xmltodict==0.11.0
Expand Down

0 comments on commit 665dc7e

Please sign in to comment.