From 6b480235ec5daf6112f27324f660bc4a120d2392 Mon Sep 17 00:00:00 2001 From: Ansari Niyaz Akhtar Date: Wed, 18 Mar 2020 13:28:23 +0530 Subject: [PATCH] Adding multidrop down test --- cfme/services/service_catalogs/__init__.py | 2 ++ .../test_dialog_element_in_catalog.py | 33 +++++++++++-------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/cfme/services/service_catalogs/__init__.py b/cfme/services/service_catalogs/__init__.py index da7d05378d..1ab02803d1 100644 --- a/cfme/services/service_catalogs/__init__.py +++ b/cfme/services/service_catalogs/__init__.py @@ -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( diff --git a/cfme/tests/services/test_dialog_element_in_catalog.py b/cfme/tests/services/test_dialog_element_in_catalog.py index 14e1bb7f52..6e90793425 100644 --- a/cfme/tests/services/test_dialog_element_in_catalog.py +++ b/cfme/tests/services/test_dialog_element_in_catalog.py @@ -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): """ Bugzilla: 1740823 @@ -1003,20 +1003,27 @@ def test_dialog_dropdown_integer_required(): casecomponent: Services initialEstimate: 1/16h startsin: 5.10 - testSteps: - 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 "" - 5. Select additional options, notice that displayed list of choices includes "" + 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 "" in multi drop down list expectedResults: 1. 2. 3. - 4. - 5. "" should not be displayed in the list of selected options + 4. "One, Two, Three" should be present in list + 5. "" 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"]]) + assert "" not in options_list @pytest.mark.tier(2)