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 #9824 from niyazRedhat/service_state
Browse files Browse the repository at this point in the history
[1LP][RFR]Automated Service state test
  • Loading branch information
digitronik authored Jan 28, 2020
2 parents 9a4dc1e + d050e46 commit 8ad7873
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions cfme/tests/services/test_myservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
from cfme import test_requirements
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.markers.env_markers.provider import ONE_PER_TYPE
from cfme.services.myservice import MyService
from cfme.services.myservice.ui import MyServiceDetailView
from cfme.services.service_catalogs import ServiceCatalogs
from cfme.utils import browser
from cfme.utils.appliance import ViaUI
from cfme.utils.appliance.implementations.ui import navigate_to
Expand Down Expand Up @@ -184,11 +186,11 @@ def test_retire_on_date_for_multiple_service():
pass


@pytest.mark.meta(coverage=[1678123])
@pytest.mark.manual
@pytest.mark.meta(automates=[1678123])
@pytest.mark.ignore_stream('5.10')
@pytest.mark.tier(2)
def test_service_state():
@pytest.mark.parametrize("check", ["provisioned", "un_provisioned"])
def test_service_state(request, appliance, provider, catalog_item, check):
"""
Bugzilla:
1678123
Expand All @@ -208,7 +210,28 @@ def test_service_state():
3.
4. Service State should be Provisioned or Failed
"""
pass
service_catalogs = ServiceCatalogs(appliance, catalog_item.catalog, catalog_item.name)
service = MyService(appliance, catalog_item.name)
service_request = service_catalogs.order()

@request.addfinalizer
def _finalize():
service.delete()

if check == "provisioned":
expected_state = "Provisioned"
service_request.wait_for_request(method="ui", num_sec=200 * 60, delay=120)
else:
expected_state = "Unprovisioned"
# Delete Provider while service is provisioning
provider.delete_rest()
provider.wait_for_delete()

view = navigate_to(service, "Details")
wait_for(lambda: view.entities.lifecycle.get_text_of("State") == expected_state,
fail_condition=0,
num_sec=300,
fail_func=view.browser.refresh)


@pytest.mark.meta(coverage=[1727443])
Expand Down

0 comments on commit 8ad7873

Please sign in to comment.