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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cfme/services/service_catalogs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class fields(ParametrizedView): # noqa
".//div[contains(@class, 'bootstrap-select')]/select[@id={key|quote}]/.."))
param_dropdown = BootstrapSelect(locator=ParametrizedLocator(
".//div[contains(@class, 'bootstrap-select')]/select[@id='param_{key}']/.."))
multi_drop = BootstrapSelect(locator=ParametrizedLocator(
".//div[contains(@class, 'bootstrap-select')]/select[@input-id={key|quote}]/.."))
checkbox = Checkbox(id=Parameter("key"))
refresh = Text(
locator=ParametrizedLocator(
Expand Down
33 changes: 20 additions & 13 deletions cfme/tests/services/test_dialog_element_in_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,10 +990,10 @@ def test_datepicker_in_service_request():
pass


@pytest.mark.meta(coverage=[1740823])
@pytest.mark.manual
@pytest.mark.tier(2)
def test_dialog_dropdown_integer_required():
@pytest.mark.meta(automates=[1740823])
@pytest.mark.customer_scenario
@pytest.mark.parametrize("file_name", ["bz_1740823.yml"], ids=["sample_dialog"],)
def test_multi_dropdown_dialog_value(appliance, generic_catalog_item_with_imported_dialog):
digitronik marked this conversation as resolved.
Show resolved Hide resolved
"""
Bugzilla:
1740823
Expand All @@ -1003,20 +1003,27 @@ 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

1. Create a multi select dropdown using the default "One, Two, Three" values.
2. Add dialog to catalog item
3. Order the new item
4. Go to your multi select dropdown and choose the value "<None>"
5. Select additional options, notice that displayed list of choices includes "<None>"
testSteps:
1. Create a multi select dropdown with values "One, Two, Three"
2. Add catalog item
3. Go to service order page
4. Check the values in dropdown
5. Check the "<None>" in multi drop down list
expectedResults:
1.
2.
3.
4.
5. "<None>" should not be displayed in the list of selected options
4. "One, Two, Three" should be present in list
5. "<None>" should not be displayed in the list
"""
pass
catalog_item, sd, ele_label = generic_catalog_item_with_imported_dialog

service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
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'}

assert "<None>" not in options_list


@pytest.mark.tier(2)
Expand Down