def test_service_ansible_playbook_crud(ansible_repository): cat_item = AnsiblePlaybookCatalogItem(fauxfactory.gen_alphanumeric(), fauxfactory.gen_alphanumeric(), provisioning={ "repository": ansible_repository.name, "playbook": "dump_all_variables.yml", "machine_credential": "CFME Default Credential", "create_new": True, "provisioning_dialog_name": fauxfactory.gen_alphanumeric() }) cat_item.create() assert cat_item.exists with update(cat_item): new_name = "edited_{}".format(fauxfactory.gen_alphanumeric()) cat_item.name = new_name cat_item.provisioning = {"playbook": "copy_file_example.yml"} view = navigate_to(cat_item, "Details") assert new_name in view.title.text assert view.provisioning.info.get_text_of( "Playbook") == "copy_file_example.yml" cat_item.delete() assert not cat_item.exists
def test_service_ansible_playbook_negative(): view = navigate_to(AnsiblePlaybookCatalogItem("", "", {}), "Add") view.fill({ "name": fauxfactory.gen_alphanumeric(), "description": fauxfactory.gen_alphanumeric() }) assert not view.add.active
def ansible_catalog_item(ansible_repository): cat_item = AnsiblePlaybookCatalogItem( fauxfactory.gen_alphanumeric(), fauxfactory.gen_alphanumeric(), display_in_catalog=True, provisioning={ "repository": ansible_repository.name, "playbook": "dump_all_variables.yml", "machine_credential": "CFME Default Credential", "create_new": True, "provisioning_dialog_name": fauxfactory.gen_alphanumeric(), "extra_vars": [("some_var", "some_value")] }, retirement={ "repository": ansible_repository.name, "playbook": "dump_all_variables.yml", "machine_credential": "CFME Default Credential", "extra_vars": [("some_var", "some_value")] } ) cat_item.create() yield cat_item if cat_item.exists: cat_item.delete()
def catalog_item(ansible_repository): cat_item = AnsiblePlaybookCatalogItem( fauxfactory.gen_alphanumeric(), fauxfactory.gen_alphanumeric(), provisioning={ "repository": ansible_repository.as_fill_value, "playbook": "dump_all_variables.yml", "machine_credential": "CFME Default Credential", "create_new": True, "provisioning_dialog_name": fauxfactory.gen_alphanumeric() } ) cat_item.create() yield cat_item if cat_item.exists: cat_item.delete()
def test_service_ansible_playbook_available(): view = navigate_to(AnsiblePlaybookCatalogItem("", "", provisioning={}), "PickItemType") assert "Ansible Playbook" in [ option.text for option in view.catalog_item_type.all_options ]