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

[1LP][RFR] Automate load service with button #9825

Merged
merged 1 commit into from
Jan 28, 2020
Merged
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
48 changes: 44 additions & 4 deletions cfme/tests/services/test_myservice.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from datetime import datetime

import fauxfactory
import pytest
from widgetastic_patternfly import Dropdown

from cfme import test_requirements
from cfme.fixtures.automate import DatastoreImport
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.markers.env_markers.provider import ONE_PER_TYPE
from cfme.services.myservice.ui import MyServiceDetailView
Expand All @@ -11,6 +14,7 @@
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.blockers import BZ
from cfme.utils.browser import ensure_browser_open
from cfme.utils.log_validator import LogValidator
from cfme.utils.update import update
from cfme.utils.wait import wait_for

Expand Down Expand Up @@ -294,10 +298,14 @@ def test_load_multiple_services():
pass


@pytest.mark.meta(coverage=[1737559])
@pytest.mark.manual
@pytest.mark.meta(automates=[1737559])
@pytest.mark.tier(2)
def test_load_service_with_button():
@pytest.mark.customer_scenario
@pytest.mark.parametrize("import_data", [DatastoreImport("bz_1737559.zip", "bz_1737559", None)],
ids=["datastore"])
@pytest.mark.parametrize("file_name", ["bz_1737559.yml"], ids=["load-button"])
def test_load_service_with_button(request, appliance, generic_service, import_dialog,
import_datastore, import_data):
"""
Bugzilla:
1737559
Expand All @@ -324,4 +332,36 @@ def test_load_service_with_button():
6.
7. Service should load without an error in log
"""
pass
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")

# Start log check
with LogValidator("/var/www/miq/vmdb/log/automation.log",
failure_patterns=[r".*ERROR.*"]).waiting(timeout=60):

# 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)