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

Commit

Permalink
Update click_cancel and click_reset kwargs to be consistent (#9792)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshriver authored and izapolsk committed Dec 20, 2019
1 parent 4b37e2e commit fefc34e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions cfme/common/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,14 @@ def _refresh():
if load_details:
navigate_to(self, "Details", use_resetter=False)

def set_ownership(self, user=None, group=None, click_cancel=False, click_reset=False):
def set_ownership(self, user=None, group=None, cancel=False, reset=False):
"""Set instance ownership
Args:
user (User): user object for ownership
group (Group): group object for ownership
click_cancel (bool): Whether to cancel form submission
click_reset (bool): Whether to reset form after filling
cancel (bool): Whether to cancel form submission
reset (bool): Whether to reset form after filling
"""
view = navigate_to(self, 'SetOwnership', wait_for_view=0)
fill_result = view.form.fill({
Expand All @@ -446,13 +446,13 @@ def set_ownership(self, user=None, group=None, click_cancel=False, click_reset=F
return

# Only if the form changed
if click_reset:
if reset:
view.form.reset_button.click()
view.flash.assert_message('All changes have been reset', 'warning')
# Cancel after reset
assert view.form.is_displayed
view.form.cancel_button.click()
elif click_cancel:
elif cancel:
view.form.cancel_button.click()
view.flash.assert_success_message('Set Ownership was cancelled by the user')
else:
Expand Down
4 changes: 2 additions & 2 deletions cfme/infrastructure/virtual_machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,11 @@ def get_relationship(self):
view.form.cancel_button.click()
return rel

def set_relationship(self, server_name, server_id, click_cancel=False):
def set_relationship(self, server_name, server_id, cancel=False):
view = self.navigate()
view.form.fill({'server': '{} ({})'.format(server_name, server_id)})

if click_cancel:
if cancel:
view.form.cancel_button.click()
else:
view.form.save_button.click()
Expand Down
4 changes: 2 additions & 2 deletions cfme/tests/cloud_infra_common/test_vm_ownership.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ def test_form_button_validation(user1, vm_crud):
initialEstimate: 1/4h
"""
# Reset button test
vm_crud.set_ownership(user=user1, click_reset=True)
vm_crud.set_ownership(user=user1, reset=True)
# Cancel button test
vm_crud.set_ownership(user=user1, click_cancel=True)
vm_crud.set_ownership(user=user1, cancel=True)
# Save button test
vm_crud.set_ownership(user=user1)
# Unset the ownership
Expand Down

0 comments on commit fefc34e

Please sign in to comment.