diff --git a/robottelo/constants/__init__.py b/robottelo/constants/__init__.py index caa88387bfe..7a2ce3795ad 100644 --- a/robottelo/constants/__init__.py +++ b/robottelo/constants/__init__.py @@ -1655,6 +1655,7 @@ class Colored(Box): 'name': 'ActivationKey', 'controller': 'katello_activation_keys', 'session_name': 'activationkey', + 'old_ui': True, }, {'name': 'Dashboard', 'controller': 'dashboard', 'session_name': 'dashboard'}, {'name': 'Audit', 'controller': 'audits', 'session_name': 'audit'}, @@ -1667,28 +1668,41 @@ class Colored(Box): {'name': 'Task', 'controller': 'foreman_tasks_tasks', 'session_name': 'task'}, # TODO Load manifest for the test_positive_end_to_end from the ui/test_bookmarks.py # {'name': 'Subscriptions', 'controller': 'subscriptions','session_name': 'subscription' }, - {'name': 'Product', 'controller': 'katello_products', 'session_name': 'product'}, + { + 'name': 'Product', + 'controller': 'katello_products', + 'session_name': 'product', + 'old_ui': True, + }, {'name': 'Repository', 'controller': 'katello_repositories', 'session_name': 'repository'}, { 'name': 'ContentCredential', 'controller': 'katello_content_credentials', 'session_name': 'contentcredential', + 'old_ui': True, + }, + { + 'name': 'SyncPlan', + 'controller': 'katello_sync_plans', + 'session_name': 'syncplan', + 'old_ui': True, }, - {'name': 'SyncPlan', 'controller': 'katello_sync_plans', 'session_name': 'syncplan'}, {'name': 'ContentView', 'controller': 'katello_content_views', 'session_name': 'contentview'}, - {'name': 'Errata', 'controller': 'katello_errata', 'session_name': 'errata'}, + {'name': 'Errata', 'controller': 'katello_errata', 'session_name': 'errata', 'old_ui': True}, {'name': 'Package', 'controller': 'katello_erratum_packages', 'session_name': 'package'}, { 'name': 'ContainerImageTag', 'controller': 'katello_docker_tags', 'session_name': 'containerimagetag', + 'old_ui': True, }, {'name': 'Host', 'controller': 'hosts', 'setup': entities.Host, 'session_name': 'host_new'}, - {'name': 'ContentHost', 'controller': 'hosts', 'session_name': 'contenthost'}, + {'name': 'ContentHost', 'controller': 'hosts', 'session_name': 'contenthost', 'old_ui': True}, { 'name': 'HostCollection', 'controller': 'katello_host_collections', 'session_name': 'hostcollection', + 'old_ui': True, }, {'name': 'Architecture', 'controller': 'architectures', 'session_name': 'architecture'}, { diff --git a/tests/foreman/ui/test_bookmarks.py b/tests/foreman/ui/test_bookmarks.py index 563a19102a7..037af909046 100644 --- a/tests/foreman/ui/test_bookmarks.py +++ b/tests/foreman/ui/test_bookmarks.py @@ -11,7 +11,7 @@ :CaseImportance: High """ -from airgun.exceptions import NoSuchElementException +from airgun.exceptions import DisabledWidgetError, NoSuchElementException from fauxfactory import gen_string import pytest @@ -256,8 +256,14 @@ def test_negative_create_with_duplicate_name(session, ui_entity, module_target_s existing_bookmark = session.bookmark.search(bookmark.name)[0] assert existing_bookmark['Name'] == bookmark.name ui_lib = getattr(session, ui_entity['name'].lower()) - # this fails but does not raise UI error, BZ#1992652 closed wontfix - ui_lib.create_bookmark({'name': bookmark.name, 'query': query, 'public': True}) + # this fails but does not raise UI error in old style dialog, BZ#1992652 closed + # wontfix, but new style dialog raises error, both situations occur + old_ui = ui_entity.get('old_ui') + if old_ui: + ui_lib.create_bookmark({'name': bookmark.name, 'query': query, 'public': True}) + else: + with pytest.raises((DisabledWidgetError, NoSuchElementException)): + ui_lib.create_bookmark({'name': bookmark.name, 'query': query, 'public': True}) # assert there are no duplicate bookmarks new_search = session.bookmark.search(bookmark.name) assert len(new_search) == 1