From 44a6e44902abda9de9ac7cc30f75be74813c01ad Mon Sep 17 00:00:00 2001 From: dgaikwad Date: Tue, 21 Jul 2020 11:32:13 +0530 Subject: [PATCH 1/3] test fixing --- cfme/tests/test_login.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cfme/tests/test_login.py b/cfme/tests/test_login.py index ba3865a406..4392ea43b0 100644 --- a/cfme/tests/test_login.py +++ b/cfme/tests/test_login.py @@ -49,8 +49,6 @@ def test_login(context, method, appliance): @pytest.mark.tier(2) @pytest.mark.sauce @pytest.mark.parametrize('context', [ViaUI]) -# BZ 1632718 is only relevant for Chrome browser -@pytest.mark.meta(blockers=[BZ(1632718)]) def test_bad_password(context, request, appliance): """ Tests logging in with a bad password. @@ -67,7 +65,9 @@ def test_bad_password(context, request, appliance): user = appliance.collections.users.instantiate(credential=cred, name='Administrator') with appliance.context.use(context): - with pytest.raises(Exception, match="Login failed: Unauthorized"): + with pytest.raises( + Exception, match="Sorry, the username or password you entered is incorrect." + ): appliance.server.login(user) view = appliance.browser.create_view(LoginPage) assert view.password.read() == '' and view.username.read() == '' From c08899566b9f5205920912e07217d2687fce2b78 Mon Sep 17 00:00:00 2001 From: dgaikwad Date: Tue, 21 Jul 2020 11:34:59 +0530 Subject: [PATCH 2/3] Revert "test fixing" This reverts commit 44a6e44902abda9de9ac7cc30f75be74813c01ad. --- cfme/tests/test_login.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cfme/tests/test_login.py b/cfme/tests/test_login.py index 4392ea43b0..ba3865a406 100644 --- a/cfme/tests/test_login.py +++ b/cfme/tests/test_login.py @@ -49,6 +49,8 @@ def test_login(context, method, appliance): @pytest.mark.tier(2) @pytest.mark.sauce @pytest.mark.parametrize('context', [ViaUI]) +# BZ 1632718 is only relevant for Chrome browser +@pytest.mark.meta(blockers=[BZ(1632718)]) def test_bad_password(context, request, appliance): """ Tests logging in with a bad password. @@ -65,9 +67,7 @@ def test_bad_password(context, request, appliance): user = appliance.collections.users.instantiate(credential=cred, name='Administrator') with appliance.context.use(context): - with pytest.raises( - Exception, match="Sorry, the username or password you entered is incorrect." - ): + with pytest.raises(Exception, match="Login failed: Unauthorized"): appliance.server.login(user) view = appliance.browser.create_view(LoginPage) assert view.password.read() == '' and view.username.read() == '' From 2c884d7d909f9c53007e5dbf6a20de3b0bf64be2 Mon Sep 17 00:00:00 2001 From: dgaikwad Date: Tue, 21 Jul 2020 11:37:06 +0530 Subject: [PATCH 3/3] fixing test --- cfme/tests/automate/test_domain.py | 2 +- cfme/tests/automate/test_git_import.py | 2 +- cfme/tests/test_login.py | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cfme/tests/automate/test_domain.py b/cfme/tests/automate/test_domain.py index 362a5a1dd9..45195f559a 100644 --- a/cfme/tests/automate/test_domain.py +++ b/cfme/tests/automate/test_domain.py @@ -650,7 +650,7 @@ def test_existing_domain_child_override(appliance, custom_domain, import_data): ) datastore.import_domain_from(import_data.from_domain, import_data.to_domain) view = appliance.browser.create_view(FileImportSelectorView) - view.flash.assert_message("Error: Selected domain is locked") + view.flash.assert_message("Error: Cannot import into a locked domain.") custom_domain.unlock() datastore.import_domain_from(import_data.from_domain, import_data.to_domain) view.flash.assert_no_error() diff --git a/cfme/tests/automate/test_git_import.py b/cfme/tests/automate/test_git_import.py index a9e85a12ac..9dbab5129d 100644 --- a/cfme/tests/automate/test_git_import.py +++ b/cfme/tests/automate/test_git_import.py @@ -580,6 +580,6 @@ def test_git_refresh_with_renamed_yaml(appliance): import_type="git", url=GIT_REPO_URL ) with pytest.raises(AssertionError, match=( - "Error: import failed: Selected branch or tag does not contain a valid domain" + "Error: import failed: Import of domain failed" )): repo.import_domain_from(branch="origin/broken-yaml") diff --git a/cfme/tests/test_login.py b/cfme/tests/test_login.py index ba3865a406..a0c49315c0 100644 --- a/cfme/tests/test_login.py +++ b/cfme/tests/test_login.py @@ -49,11 +49,12 @@ def test_login(context, method, appliance): @pytest.mark.tier(2) @pytest.mark.sauce @pytest.mark.parametrize('context', [ViaUI]) -# BZ 1632718 is only relevant for Chrome browser -@pytest.mark.meta(blockers=[BZ(1632718)]) +@pytest.mark.meta(automates=[1632718]) def test_bad_password(context, request, appliance): - """ Tests logging in with a bad password. + """ Tests logging in with a bad password and 1632718 is only relevant for Chrome browser + Bugzilla: + 1632718 Polarion: assignee: dgaikwad casecomponent: WebUI @@ -67,7 +68,9 @@ def test_bad_password(context, request, appliance): user = appliance.collections.users.instantiate(credential=cred, name='Administrator') with appliance.context.use(context): - with pytest.raises(Exception, match="Login failed: Unauthorized"): + with pytest.raises( + Exception, match="Sorry, the username or password you entered is incorrect." + ): appliance.server.login(user) view = appliance.browser.create_view(LoginPage) assert view.password.read() == '' and view.username.read() == ''