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

[1LP][RFR] Enhanced security group test case for multiple checks #9886

Merged
merged 3 commits into from
Jan 30, 2020

Conversation

mayurilahane
Copy link
Contributor

Purpose or Intent

Enhanced as per suggestion given: https://github.com/ManageIQ/integration_tests/pull/9799/files#r366572190

PRT Run

{{ pytest: cfme/tests/cloud_infra_common/test_relationships.py::test_change_network_security_groups_per_page_items --use-provider complete --use-template-cache -qsvv }}

@mayurilahane mayurilahane changed the title [WIPTEST] Enhanced security group test case for multiple checks [RFR] Enhanced security group test case for multiple checks Jan 28, 2020
Copy link
Member

@ganeshhubale ganeshhubale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

view.paginator.set_items_per_page(item_count)
assert len(view.entities.get_all()) <= view.paginator.items_per_page
view.paginator.set_items_per_page(1000)
total_count = len(view.entities.get_all())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question:

  1. Why are you setting set_items_per_page to 1000? if it is for getting total count then please check if there is any other way available to get total count of entities.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can refer "view.entities.get_all(surf_pages=True)"
to surf the page for entites to get total count.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a method for this in PaginationPane - https://github.com/ManageIQ/integration_tests/blob/master/widgetastic_manageiq/__init__.py#L1809

It will be slow to use get_all if there are actually 1000 items. It'll also not get the total count if there are more than 1000.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mshriver!
updated with your suggestion

@ganeshhubale ganeshhubale changed the title [RFR] Enhanced security group test case for multiple checks [1LP][RFR] Enhanced security group test case for multiple checks Jan 29, 2020
@dajoRH dajoRH changed the title [1LP][RFR] Enhanced security group test case for multiple checks [1LP][WIP] Enhanced security group test case for multiple checks Jan 30, 2020
@dajoRH dajoRH added needs-lint and removed lint-ok labels Jan 30, 2020
@mayurilahane mayurilahane changed the title [1LP][WIP] Enhanced security group test case for multiple checks [1LP][WIPTEST] Enhanced security group test case for multiple checks Jan 30, 2020
@mayurilahane mayurilahane changed the title [1LP][WIPTEST] Enhanced security group test case for multiple checks [1LP][RFR] Enhanced security group test case for multiple checks Jan 30, 2020
@digitronik digitronik self-assigned this Jan 30, 2020
Copy link
Contributor

@digitronik digitronik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@digitronik digitronik merged commit f01ec96 into ManageIQ:master Jan 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants