This repository has been archived by the owner on Apr 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 165
[1LP][RFR]Automated Service state test #9824
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can use fixture 'order_service' that will order catalog_item and also delete service at the end. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sshveta we need to fail ordered service catalog item before successfully provisioned. so for that, we are removing provider while ordered catalog item is in progress hence we can not use fixture which provides successfully provision service catalog item. |
||
|
||
@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]) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion: please replace
un_provisioned
<==>unprovisioned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, I'd say it's optional though