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 #9551 from mshriver/fix-button-group-create-rc
Browse files Browse the repository at this point in the history
[RFR] Update automate button group create, add button wait
  • Loading branch information
mshriver authored Oct 28, 2019
2 parents 9a9ccd5 + 025f52f commit eb50486
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions cfme/automate/buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@

from cfme.automate import AutomateCustomizationView
from cfme.base.ui import AutomateSimulationView
from cfme.exceptions import CFMEException
from cfme.modeling.base import BaseCollection
from cfme.modeling.base import BaseEntity
from cfme.utils.appliance.implementations.ui import CFMENavigateStep
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.appliance.implementations.ui import navigator
from cfme.utils.log import logger
from cfme.utils.update import Updateable
from cfme.utils.wait import TimedOutError
from cfme.utils.wait import wait_for
from widgetastic_manageiq import AutomateRadioGroup
from widgetastic_manageiq import FonticonPicker
from widgetastic_manageiq import MultiBoxOrderedSelect
Expand Down Expand Up @@ -530,6 +534,15 @@ def create(
else:
view.advanced.role_show.fill("<To All>")

try:
# add button slow to enable?
wait_for(lambda: not view.add_button.disabled,
timeout=5,
handle_exception=True)
except TimedOutError:
logger.exception('Timed out waiting for add button on button group form')
raise CFMEException('Custom button group add form button did not activate')

view.add_button.click()
view = self.create_view(ButtonGroupDetailView, self.group, wait="15s")
view.flash.assert_no_error()
Expand Down Expand Up @@ -850,7 +863,7 @@ def create(
self.type = type

view = navigate_to(self, "Add")
view.fill(
changed = view.fill(
{
"text": text,
"hover": hover,
Expand All @@ -860,11 +873,23 @@ def create(
"assign_buttons": assign_buttons,
}
)
if not changed:
# the form wasn't filled with anything
# no button group to instantiate, nothing was created
return None
try:
# add button slow to enable?
wait_for(lambda: not view.add_button.disabled,
timeout=5,
handle_exception=True)
except TimedOutError:
logger.exception('Timed out waiting for add button on button group form')
raise CFMEException('Custom button group add form button did not activate')
view.add_button.click()
view = self.create_view(ButtonGroupObjectTypeView)

view.flash.assert_no_error()
view.flash.assert_message('Button Group "{}" was added'.format(hover))
view.flash.assert_success_message('Button Group "{}" was added'.format(hover))
return self.instantiate(
text=text,
hover=hover,
Expand Down

0 comments on commit eb50486

Please sign in to comment.