-
Notifications
You must be signed in to change notification settings - Fork 165
[1LP][RFR] Adding multi_drop down service dialog test #9996
Conversation
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] |
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 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 -
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: |
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.
Why did you remove testSteps and expectedResults?
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.
added
4b0ec72
to
6b48023
Compare
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"]]) |
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 would try to use set operation here.
assert set(options_list) == {'One', 'Two', 'Three'}
Purpose or Intent
PRT Run
{{pytest: cfme/tests/services/test_dialog_element_in_catalog.py::test_multi_dropdown_dialog_value }}