def test_crud_set_ownership_and_edit_tags(appliance, context, myservice): """Tests my service crud , edit tags and ownership Metadata: test_flag: provision """ service_name, vm_name = myservice with appliance.context.use(context): myservice = MyService(appliance, name=service_name, vm_name=vm_name) myservice.set_ownership("Administrator", "EvmGroup-administrator") myservice.add_tag("Cost Center *", "Cost Center 001") with update(myservice): myservice.description = "my edited description" myservice.delete()
def test_crud_set_ownership_and_edit_tags(appliance, context, myservice): """Tests my service crud , edit tags and ownership Metadata: test_flag: provision Polarion: assignee: sshveta initialEstimate: 1/4h """ service_name, vm_name = myservice with appliance.context.use(context): myservice = MyService(appliance, name=service_name, vm_name=vm_name) myservice.set_ownership("Administrator", "EvmGroup-administrator") myservice.add_tag() with update(myservice): myservice.description = "my edited description" myservice.delete()
def test_custom_button_expression_ansible_service( appliance, context, vis_enb_button_service, order_ansible_service_in_ops_ui): """ Test custom button on ansible service as per expression enablement/visibility. Polarion: assignee: ndhandre initialEstimate: 1/4h caseimportance: medium casecomponent: CustomButton startsin: 5.9 testSteps: 1. Create custom button group on Service object type 2. Create a custom button with expression (Tag) a. Enablement Expression b. Visibility Expression 3. Navigate to object Detail page 4. Check: button should not enable/visible without tag 5. Check: button should enable/visible with tag Bugzilla: 1628727 1509959 1513498 1755229 """ group, button, expression = vis_enb_button_service service = MyService(appliance, order_ansible_service_in_ops_ui) navigate_to = ssui_nav if context is ViaSSUI else ui_nav # tags tag_cat = appliance.collections.categories.instantiate( name="department", display_name="Department") engineering_tag = tag_cat.collections.tags.instantiate( name="engineering", display_name="Engineering") # check button expression with tag and without tag for tag in [False, True]: # manage tag with appliance.context.use(ViaUI): current_tag_status = engineering_tag in service.get_tags() if tag != current_tag_status: if tag: service.add_tag(engineering_tag) else: service.remove_tag(engineering_tag) # check expression with appliance.context.use(context): view = navigate_to(service, "Details", wait_for_view=15) custom_button_group = (CustomButtonSSUIDropdwon(view, group.text) if context is ViaSSUI else Dropdown( view, group.text)) if tag: if expression == "enablement": assert custom_button_group.item_enabled(button.text) else: # visibility assert button.text in custom_button_group.items else: if expression == "enablement": # Note: SSUI still follow enablement behaviour like 5.9. In latest version # dropdown having single button and button is disabled then dropdown disabled. if context is ViaSSUI: assert not custom_button_group.item_enabled( button.text) else: assert not custom_button_group.is_enabled else: # visibility assert not custom_button_group.is_displayed