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

[1LP][RFR] Adding multi_drop down service dialog test #9996

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

niyazRedhat
Copy link
Contributor

@niyazRedhat niyazRedhat commented Mar 18, 2020

Purpose or Intent

PRT Run

{{pytest: cfme/tests/services/test_dialog_element_in_catalog.py::test_multi_dropdown_dialog_value }}

@niyazRedhat niyazRedhat changed the title Adding multi_drop down service dialog test [WIPTEST] Adding multi_drop down service dialog test Mar 18, 2020
@niyazRedhat niyazRedhat changed the title [WIPTEST] Adding multi_drop down service dialog test [RFR] Adding multi_drop down service dialog test Mar 18, 2020
Comment on lines 1012 to 1015
assert "One" and "Two" and "Three" in[
option.text for option in view.fields(ele_label).multi_drop.all_options]
assert "<None>" not in [
option.text for option in view.fields(ele_label).multi_drop.all_options]
Copy link
Contributor

Choose a reason for hiding this comment

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

This condition will not check what you want to check.
The condition here will only fail if Three is not in the list.

You can do this instead -

Suggested change
assert "One" and "Two" and "Three" in[
option.text for option in view.fields(ele_label).multi_drop.all_options]
assert "<None>" not in [
option.text for option in view.fields(ele_label).multi_drop.all_options]
options_list = [option.text for option in view.fields(ele_label).multi_drop.all_options]
assert all([opt in options_list for opt in ["One", "Two", "Three"]])
assert "<None>" in options_list

@@ -1003,20 +1003,16 @@ def test_dialog_dropdown_integer_required():
casecomponent: Services
initialEstimate: 1/16h
startsin: 5.10
testSteps:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you remove testSteps and expectedResults?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

@valaparthvi valaparthvi changed the title [RFR] Adding multi_drop down service dialog test [1LP][RFR] Adding multi_drop down service dialog test Mar 18, 2020
view = navigate_to(service_catalogs, "Order")

options_list = [option.text for option in view.fields(ele_label).multi_drop.all_options]
assert all([opt in options_list for opt in ["One", "Two", "Three"]])
Copy link
Contributor

Choose a reason for hiding this comment

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

I would try to use set operation here.
assert set(options_list) == {'One', 'Two', 'Three'}

@digitronik digitronik self-assigned this Mar 24, 2020
@digitronik digitronik merged commit 470d33e into ManageIQ:master Mar 24, 2020
@mshriver mshriver added the test-automation To be applied on PR's which are automating existing manual cases label Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lint-ok test-automation To be applied on PR's which are automating existing manual cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants