URL: https://github.com/freeipa/freeipa/pull/1919
Author: Rezney
 Title: #1919: ui_tests: checkbox click fix
Action: opened

PR body:
"""
We check a box with clicking on label by default however sometimes when a label 
is too short 
(1-2 letters) we are hitting an issue that the checkbox obscures the label.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1919/head:pr1919
git checkout pr1919
From e2804575ee4fd88cd3a3f75681f45e82d6000635 Mon Sep 17 00:00:00 2001
From: Michal Reznik <mrez...@redhat.com>
Date: Thu, 10 May 2018 14:35:21 +0200
Subject: [PATCH 1/2] ui_tests: checkbox click fix

We check a box with clicking on label by default however sometimes
when a label is too short (1-2 letters) we are hitting an issue
that the checkbox obscures the label.
---
 ipatests/test_webui/ui_driver.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ipatests/test_webui/ui_driver.py b/ipatests/test_webui/ui_driver.py
index 34d21ae35d..239cfa7b97 100644
--- a/ipatests/test_webui/ui_driver.py
+++ b/ipatests/test_webui/ui_driver.py
@@ -42,6 +42,7 @@
     from selenium.common.exceptions import InvalidElementStateException
     from selenium.common.exceptions import StaleElementReferenceException
     from selenium.common.exceptions import WebDriverException
+    from selenium.common.exceptions import ElementClickInterceptedException
     from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
     from selenium.webdriver.common.keys import Keys
     from selenium.webdriver.common.by import By
@@ -912,15 +913,21 @@ def check_option(self, name, value=None, parent=None):
             s += "[@value='%s']" % value
         opts = self.find(s, "xpath", parent, many=True)
         label = None
+        checkbox = None
         # Select only the one which matches exactly the name
         for o in opts:
             n = o.get_attribute("name")
             if n == name or re.match("^%s\d+$" % name, n):
                 s = "label[for='%s']" % o.get_attribute("id")
                 label = self.find(s, By.CSS_SELECTOR, parent, strict=True)
+                checkbox = o
                 break
         assert label is not None, "Option not found: %s" % name
-        label.click()
+
+        try:
+            label.click()
+        except ElementClickInterceptedException:
+            checkbox.click()
 
     def select_combobox(self, name, value, parent=None, combobox_input=None):
         """

From 6fe54e26952add3f302d05443af6a2c510d77fbf Mon Sep 17 00:00:00 2001
From: Michal Reznik <mrez...@redhat.com>
Date: Thu, 10 May 2018 15:00:11 +0200
Subject: [PATCH 2/2] TEMP_COMMIT: activate WebUI tests

---
 .freeipa-pr-ci.yaml | 173 ++++++----------------------------------------------
 1 file changed, 20 insertions(+), 153 deletions(-)

diff --git a/.freeipa-pr-ci.yaml b/.freeipa-pr-ci.yaml
index 88d34d58fc..af48bd307a 100644
--- a/.freeipa-pr-ci.yaml
+++ b/.freeipa-pr-ci.yaml
@@ -27,183 +27,50 @@ jobs:
         timeout: 1800
         topology: *build
 
-  fedora-27/simple_replication:
+  fedora-27/test_webui_a_to_d:
     requires: [fedora-27/build]
     priority: 50
     job:
-      class: RunPytest
+      class: RunWebuiTests
       args:
         build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_simple_replication.py
+        test_suite: test_webui/test_[a-d]*.py
         template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
+        timeout: 7200
+        topology: *ipaserver
 
-  fedora-27/caless:
+  fedora-27/test_webui_g_to_m:
     requires: [fedora-27/build]
     priority: 50
     job:
-      class: RunPytest
+      class: RunWebuiTests
       args:
         build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_caless.py::TestServerReplicaCALessToCAFull
+        test_suite: test_webui/test_[g-m]*.py
         template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
+        timeout: 7200
+        topology: *ipaserver
 
-  fedora-27/external_ca:
+  fedora-27/test_webui_n_to_r:
     requires: [fedora-27/build]
     priority: 50
     job:
-      class: RunPytest
+      class: RunWebuiTests
       args:
         build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_external_ca.py::TestExternalCA test_integration/test_external_ca.py::TestSelfExternalSelf test_integration/test_external_ca.py::TestExternalCAInstall
+        test_suite: test_webui/test_[n-r]*.py
         template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
+        timeout: 7200
+        topology: *ipaserver
 
-  fedora-27/test_topologies:
+  fedora-27/test_webui_s_to_z:
     requires: [fedora-27/build]
     priority: 50
     job:
-      class: RunPytest
+      class: RunWebuiTests
       args:
         build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_topologies.py
+        test_suite: test_webui/test_[s-z]*.py
         template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_sudo:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_sudo.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-27/test_ipa_cli:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_ipa_cli.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_kerberos_flags:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_kerberos_flags.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-27/test_http_kdc_proxy:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_http_kdc_proxy.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-27/test_forced_client_enrolment:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_forced_client_reenrollment.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl_1client
-
-  fedora-27/test_advise:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_advise.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_testconfig:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_testconfig.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_service_permissions:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_service_permissions.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_netgroup:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_netgroup.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_vault:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_vault.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl
-
-  fedora-27/test_authconfig:
-    requires: [fedora-27/build]
-    priority: 50
-    job:
-      class: RunPytest
-      args:
-        build_url: '{fedora-27/build_url}'
-        test_suite: test_integration/test_authselect.py
-        template: *ci-master-f27
-        timeout: 3600
-        topology: *master_1repl_1client
-
+        timeout: 7200
+        topology: *ipaserver
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to