-
Notifications
You must be signed in to change notification settings - Fork 165
[1LP][RFR] Replace usage of entity.check() with entity.ensure_checked. Part 1. #9669
Conversation
a00f9f6
to
4c55660
Compare
…er_relationships_ui
…n/test_vm_instance_analysis.py
4c55660
to
12072ad
Compare
@@ -318,7 +318,7 @@ def power_control_from_cfme(self, *args, **kwargs): | |||
raise ItemNotFound( | |||
'Failed to find instance in table: {}'.format(self.name) | |||
) | |||
row.check() | |||
row.ensure_checked() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only been able to test this by changing the surrounding code so line 321 would be executed. IT tested fine, but there is not a specific test in PRT that covers this update.
@@ -643,7 +643,8 @@ def prerequisite(self): | |||
def step(self, *args, **kwargs): | |||
# click the checkbox of every object in the filtered collection | |||
for entity in self.obj.all(): | |||
self.prerequisite_view.entities.get_entity(name=entity.name, surf_pages=True).check() | |||
self.prerequisite_view.entities.get_entity(name=entity.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is covered by cfme/tests/cloud_infra_common/test_policy_simulation.py::test_policy_simulation_ui and will be added to PRT.
@@ -266,7 +266,8 @@ class Edit(CFMENavigateStep): | |||
prerequisite = NavigateToSibling('All') | |||
|
|||
def step(self, *args, **kwargs): | |||
self.prerequisite_view.entities.get_entity(name=self.obj.name, surf_pages=True).check() | |||
self.prerequisite_view.entities.get_entity(name=self.obj.name, | |||
surf_pages=True).ensure_checked() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a usage of this. It is the normal implementation of ensure_checked() that has been tested elsewhere.
@@ -289,7 +290,8 @@ class EditTags(CFMENavigateStep): | |||
prerequisite = NavigateToSibling('All') | |||
|
|||
def step(self, *args, **kwargs): | |||
self.prerequisite_view.entities.get_entity(name=self.obj.name, surf_pages=True).check() | |||
self.prerequisite_view.entities.get_entity(name=self.obj.name, | |||
surf_pages=True).ensure_checked() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a usage of this. It is the normal implementation of ensure_checked() that has been tested elsewhere.
@@ -744,7 +744,7 @@ def refresh_provider_relationships_ui(self, from_list_view=False, wait=0, delay= | |||
if from_list_view: | |||
view = navigate_to(self, 'All') | |||
entity = view.entities.get_entity(name=self.name, surf_pages=True) | |||
entity.check() | |||
entity.ensure_checked() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a usage of this. It is the normal implementation of ensure_checked() that has been tested elsewhere.
view.entities.get_entity(name=testing_instance.name).check() | ||
view.entities.get_entity(name=testing_instance2.name).check() | ||
view.entities.get_entity(name=testing_instance.name).ensure_checked() | ||
view.entities.get_entity(name=testing_instance2.name).ensure_checked() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and will be part of PRT.
@@ -971,7 +971,7 @@ def test_ssa_multiple_vms(ssa_multiple_vms, soft_assert, appliance, compare_linu | |||
view.toolbar.view_selector.select('List View') | |||
view.paginator.set_items_per_page(1000) | |||
for ssa_vm in ssa_multiple_vms: | |||
view.entities.get_entity(name=ssa_vm.name, surf_pages=True).check() | |||
view.entities.get_entity(name=ssa_vm.name, surf_pages=True).ensure_checked() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and I am adding to PRT.
@@ -90,7 +90,7 @@ def navigate_and_select_quads(provider): | |||
view: the provider nodes view, quadicons already selected""" | |||
hosts_view = navigate_to(provider, 'ProviderNodes') | |||
assert hosts_view.is_displayed | |||
[h.check() for h in hosts_view.entities.get_all()] | |||
[h.ensure_checked() for h in hosts_view.entities.get_all()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been tested with cfme/tests/infrastructure/test_host.py::test_multiple_host_good_creds and the test will be added to PRT.
Something seems to be wrong with my PRT format. It's not running what I expect. Output doesn't tell me what is wrong , so I'll just keep trying until it works or I give up. |
I have updated the format of my PRT command a couple times. I'll get some assistance debugging this on Monday. Am marking RFR to possibly get this looked at while trying to figure out the PRT issue. I also added comments about the testing of each update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for this PR 👍
…. Part 1. (ManageIQ#9669) * Replace check() with ensure_checked() in test_multiple_host_good_creds * Remove pytest mark used for testing * Update test_power_on_or_off_multiple to use ensure_checked() * Replace entity.check() with entity.ensure_checked() in refresh_provider_relationships_ui * Replace check() with ensure_checked() in cfme/tests/cloud_infra_common/test_vm_instance_analysis.py * Replace check() with ensure_checked() in power_control_from_cfme * Replace check() with ensure_checked() in PolicySimulationOnCollection * Replace check() with ensure_checked() in Edit * Replace check() with ensure_checked() in EditTags
Purpose or Intent
PRT Run
{{ pytest: --use-provider rhv42 --use-provider rhos13 --long-running cfme/tests/cloud_infra_common/test_policy_simulation.py::test_policy_simulation_ui cfme/tests/cloud/test_instance_power_control.py::test_power_on_or_off_multiple cfme/tests/cloud_infra_common/test_vm_instance_analysis.py::test_ssa_multiple_vms cfme/tests/infrastructure/test_host.py::test_multiple_host_good_creds }}