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

Commit

Permalink
Merge pull request #9939 from niyazRedhat/dyna-dialog
Browse files Browse the repository at this point in the history
[1LP][RFR] Adding dynamic dialog with custom button test
  • Loading branch information
mshriver authored Mar 12, 2020
2 parents bb6deb9 + cd0ecd9 commit b0a4c23
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 17 deletions.
71 changes: 71 additions & 0 deletions cfme/tests/services/test_dynamicdd_dialogelement.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import fauxfactory
import pytest
from widgetastic_patternfly import Dropdown

from cfme import test_requirements
from cfme.automate.explorer.domain import DomainCollection
from cfme.fixtures.automate import DatastoreImport
from cfme.services.service_catalogs import ServiceCatalogs
from cfme.tests.automate.custom_button import DropdownDialogView
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.log_validator import LogValidator
from cfme.utils.wait import wait_for
Expand Down Expand Up @@ -137,6 +139,75 @@ def test_submit_or_cancelation_btns_in_dd_dialogs_tied_to_a_service_button_shoul
pass


@pytest.mark.meta(automates=[1611527])
@pytest.mark.tier(2)
@pytest.mark.customer_scenario
@pytest.mark.parametrize("import_data", [DatastoreImport("bz_1611527.zip", "bz_1611527", None)],
ids=["datastore"])
@pytest.mark.parametrize("file_name", ["bz_1611527.yml"], ids=["load-button"])
def test_dynamic_submit_cancel_button_service(request, appliance, generic_service, import_dialog,
import_datastore, import_data):
"""
Bugzilla:
1611527
Polarion:
assignee: nansari
casecomponent: Services
initialEstimate: 1/6h
startsin: 5.10
testSteps:
1. Import Datastore and dialog
2. Create button with above dialog
3. Create catalog item
4. Order the service
5. Go to My services
6. Click on created service
7. load the service with a button
expectedResults:
1.
2.
3.
4.
5.
6.
7. Submit and Cancel button should be enabled
"""
service, _ = generic_service
sd, ele_label = import_dialog

# Create button group
collection = appliance.collections.button_groups
button_gp = collection.create(
text=fauxfactory.gen_alphanumeric(start="grp_"),
hover=fauxfactory.gen_alphanumeric(15, start="grp_hvr_"),
type=getattr(collection, "SERVICE"),
)
request.addfinalizer(button_gp.delete_if_exists)

# Create custom button under group
button = button_gp.buttons.create(
text=fauxfactory.gen_alphanumeric(start="btn_"),
hover=fauxfactory.gen_alphanumeric(15, start="btn_hvr_"),
dialog=sd.label,
system="Request",
request="InspectMe",
)
request.addfinalizer(button.delete_if_exists)

# Navigate to Details page of service
view = navigate_to(service, "Details")

# Load service on custom button
custom_button_group = Dropdown(view, button_gp.text)
assert custom_button_group.is_displayed
custom_button_group.item_select(button.text)
view = view.browser.create_view(DropdownDialogView, wait="60s")
serv = view.service_name(ele_label)
serv.dropdown.wait_displayed()
wait_for(lambda: not (view.submit.disabled and view.cancel.disabled), timeout=120)


@pytest.mark.manual
@pytest.mark.tier(3)
def test_drop_down_dialog_should_honor_the_order_of_values_as_they_are_inputted():
Expand Down
17 changes: 0 additions & 17 deletions cfme/tests/services/test_service_catalog_dialog_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,23 +536,6 @@ def test_search_field_at_the_top_of_a_dynamic_drop_down_dialog_element_should_di
pass


@pytest.mark.manual
@pytest.mark.tier(3)
def test_service_dialog_saving_elements_when_switching_elements():
"""
Polarion:
assignee: nansari
casecomponent: Services
testtype: functional
initialEstimate: 1/4h
startsin: 5.8
tags: service
Bugzilla:
1454428
"""
pass


@pytest.mark.manual
@pytest.mark.tier(3)
def test_entries_shouldnt_be_mislabeled_for_dropdown_element_in_dialog_editor():
Expand Down

0 comments on commit b0a4c23

Please sign in to comment.