URL: https://github.com/freeipa/freeipa/pull/5727
Author: miskopo
 Title: #5727: WebUI: Handle assertion if multiple notifications are present
Action: opened

PR body:
"""
If multiple notifications of the same type are shown at the same
time, assertion works for only the first one. This change enables to
search for notification's content in all shown notifications.
    
Fixes: https://pagure.io/freeipa/issue/8641
    
Signed-off-by: Michal Polovka <mpolo...@redhat.com>

"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/5727/head:pr5727
git checkout pr5727
From ca2c360ce1b624d89c84edfcee1267892cc1683d Mon Sep 17 00:00:00 2001
From: Michal Polovka <mpolo...@redhat.com>
Date: Thu, 22 Apr 2021 14:21:37 +0200
Subject: [PATCH 1/2] WebUI: Handle assertion if multiple notifications are
 present

If multiple notifications of the same type are shown at the same
time, assertion works for only the first one. This change enables to
search for notification's content in all shown notifications.

Fixes: https://pagure.io/freeipa/issue/8641

Signed-off-by: Michal Polovka <mpolo...@redhat.com>
---
 ipatests/test_webui/ui_driver.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipatests/test_webui/ui_driver.py b/ipatests/test_webui/ui_driver.py
index a5a082830e7..4720d37d2b8 100644
--- a/ipatests/test_webui/ui_driver.py
+++ b/ipatests/test_webui/ui_driver.py
@@ -2324,10 +2324,10 @@ def assert_notification(self, type='success', assert_text=None):
         notification_type = 'div.notification-area .alert-{}'.format(type)
         # wait for a half sec for notification to appear
         self.wait(0.5)
-        is_present = self.find(notification_type, By.CSS_SELECTOR)
+        is_present = self.find(notification_type, By.CSS_SELECTOR, many=True)
         assert is_present, "Notification not present"
         if assert_text:
-            assert assert_text in is_present.text
+            assert any(map(lambda x: assert_text in x.text, is_present))
 
     def assert_last_error_dialog(self, expected_err, details=False,
                                  dialog_name='error_dialog'):

From e98b8a61737840d5f432fe6f0ce0692b97881f27 Mon Sep 17 00:00:00 2001
From: Michal Polovka <mpolo...@redhat.com>
Date: Thu, 22 Apr 2021 14:27:53 +0200
Subject: [PATCH 2/2] temp commit

Signed-off-by: Michal Polovka <mpolo...@redhat.com>
---
 .freeipa-pr-ci.yaml                        |  2 +-
 ipatests/prci_definitions/temp_commit.yaml | 66 +++++++++++++++++++++-
 2 files changed, 64 insertions(+), 4 deletions(-)

diff --git a/.freeipa-pr-ci.yaml b/.freeipa-pr-ci.yaml
index abcf8c5b634..80656690080 120000
--- a/.freeipa-pr-ci.yaml
+++ b/.freeipa-pr-ci.yaml
@@ -1 +1 @@
-ipatests/prci_definitions/gating.yaml
\ No newline at end of file
+ipatests/prci_definitions/temp_commit.yaml
\ No newline at end of file
diff --git a/ipatests/prci_definitions/temp_commit.yaml b/ipatests/prci_definitions/temp_commit.yaml
index 895dcdff758..cef2aa3aada 100644
--- a/ipatests/prci_definitions/temp_commit.yaml
+++ b/ipatests/prci_definitions/temp_commit.yaml
@@ -61,14 +61,74 @@ jobs:
         timeout: 1800
         topology: *build
 
-  fedora-latest/temp_commit:
+  fedora-latest/temp_commit_overall:
     requires: [fedora-latest/build]
     priority: 50
     job:
-      class: RunPytest
+      class: RunWebuiTests
       args:
         build_url: '{fedora-latest/build_url}'
-        test_suite: test_integration/test_REPLACEME.py
+        test_suite: test_webui/test_user.py
+        template: *ci-master-latest
+        timeout: 3600
+        topology: *master_1repl_1client
+
+  fedora-latest/temp_commit_singular_1:
+    requires: [fedora-latest/build]
+    priority: 50
+    job:
+      class: RunWebuiTests
+      args:
+        build_url: '{fedora-latest/build_url}'
+        test_suite: test_webui/test_user.py::TestLifeCycles::test_life_cycles
+        template: *ci-master-latest
+        timeout: 3600
+        topology: *master_1repl_1client
+
+  fedora-latest/temp_commit_singular_2:
+    requires: [ fedora-latest/build ]
+    priority: 50
+    job:
+      class: RunWebuiTests
+      args:
+        build_url: '{fedora-latest/build_url}'
+        test_suite: test_webui/test_user.py::TestLifeCycles::test_life_cycles
+        template: *ci-master-latest
+        timeout: 3600
+        topology: *master_1repl_1client
+
+  fedora-latest/temp_commit_singular_3:
+    requires: [fedora-latest/build]
+    priority: 50
+    job:
+      class: RunWebuiTests
+      args:
+        build_url: '{fedora-latest/build_url}'
+        test_suite: test_webui/test_user.py::TestLifeCycles::test_life_cycles
+        template: *ci-master-latest
+        timeout: 3600
+        topology: *master_1repl_1client
+
+  fedora-latest/temp_commit_singular_4:
+    requires: [ fedora-latest/build ]
+    priority: 50
+    job:
+      class: RunWebuiTests
+      args:
+        build_url: '{fedora-latest/build_url}'
+        test_suite: test_webui/test_user.py::TestLifeCycles::test_life_cycles
+        template: *ci-master-latest
+        timeout: 3600
+        topology: *master_1repl_1client
+
+  fedora-latest/temp_commit_singular_5:
+    requires: [ fedora-latest/build ]
+    priority: 50
+    job:
+      class: RunWebuiTests
+      args:
+        build_url: '{fedora-latest/build_url}'
+        test_suite: test_webui/test_user.py::TestLifeCycles::test_life_cycles
         template: *ci-master-latest
         timeout: 3600
         topology: *master_1repl_1client
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to