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

[1LP][RFR] Automating upload/remove image on catalog bundle test #10290

Merged
merged 1 commit into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion cfme/services/catalogs/catalog_items/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from widgetastic_manageiq import EntryPoint
from widgetastic_manageiq import FileInput
from widgetastic_manageiq import FonticonPicker
from widgetastic_manageiq import InputButton
from widgetastic_manageiq import ManageIQTree
from widgetastic_manageiq import SummaryForm
from widgetastic_manageiq import SummaryFormItem
Expand Down Expand Up @@ -151,7 +152,9 @@ def is_displayed(self):


class DetailsEntitiesCatalogItemView(View):
custom_image = FileInput("upload_image")
upload_image = FileInput(id="upload_image")
upload_button = InputButton("commit")
remove = Button(title="Remove this Custom Image")
smart_management = SummaryTable("Smart Management")
digitronik marked this conversation as resolved.
Show resolved Hide resolved


Expand Down
35 changes: 35 additions & 0 deletions cfme/tests/services/test_catalog_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from cfme.services.service_catalogs import ServiceCatalogs
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.blockers import BZ
from cfme.utils.conf import cfme_data
from cfme.utils.ftp import FTPClientWrapper
from cfme.utils.log import logger
from cfme.utils.log_validator import LogValidator
from cfme.utils.update import update
Expand Down Expand Up @@ -624,3 +626,36 @@ def test_add_bundle_in_bundle(appliance, catalog_bundle):
options = view.resources.select_resource.all_options
assert catalog_bundle.name not in [o.text for o in options]
view.cancel_button.click()


@pytest.mark.meta(automates=[1487056])
def test_upload_delete_custom_image_on_bundle(catalog_bundle):
"""
Bugzilla:
1487056
Polarion:
assignee: nansari
casecomponent: Services
initialEstimate: 1/8h
testSteps:
1. Create a catalog item
2. Create a catalog bundle
3. Upload a custom image to bundle
4. remove the image
expectedResults:
1.
2.
3.
4. Upload and Remove image should work
"""
image = 'logo.png'
fs = FTPClientWrapper(cfme_data.ftpserver.entities.others)
file_path = fs.download(image)

view = navigate_to(catalog_bundle, 'Details')
view.entities.upload_image.fill(file_path)
view.entities.upload_button.click()
view.flash.assert_message(f'Custom Image file "{image}" successfully uploaded')

view.entities.remove.click()
view.flash.assert_message('Custom Image successfully removed')
30 changes: 0 additions & 30 deletions cfme/tests/services/test_service_catalog_dialog_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,6 @@ def test_changing_action_order_in_catalog_bundle_should_not_removes_resource():
pass


@pytest.mark.manual
@pytest.mark.tier(2)
def test_custom_image_on_item_bundle_crud():
"""
Polarion:
assignee: nansari
casecomponent: Services
testtype: functional
initialEstimate: 1/8h
startsin: 5.5
tags: service
testSteps:
1. Create a catalog item
2. Upload custom image
3. remove custom image
4. Create a catalog bundle
5. Upload a custom image
6. Change custom image
expectedResults:
1.
2. No error seen
3.
4.
5. No error seen
Bugzilla:
1487056
"""
pass


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