diff mbox series

[v2,3/6] toaster/test: Added skip to run test on ElementClickInterceptedException

Message ID 20231214221157.604253-3-alassane.yattara@savoirfairelinux.com
State New
Headers show
Series [v2,1/6] toaster/test: bug-fix element click intercepted in browser/test_layerdetails_page.py | expand

Commit Message

Alassane Yattara Dec. 14, 2023, 10:11 p.m. UTC
On project layer page, element button(save changes for switch)
not properly visible or just hidden by another element which cause
follwing exception: ElementClickInterceptedException

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
---
 lib/toaster/tests/browser/test_layerdetails_page.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/toaster/tests/browser/test_layerdetails_page.py b/lib/toaster/tests/browser/test_layerdetails_page.py
index 9c8fcded..5be4ba0c 100644
--- a/lib/toaster/tests/browser/test_layerdetails_page.py
+++ b/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -8,7 +8,7 @@ 
 #
 
 from django.urls import reverse
-from selenium.common.exceptions import TimeoutException
+from selenium.common.exceptions import ElementClickInterceptedException, TimeoutException
 from tests.browser.selenium_helpers import SeleniumTestCase
 
 from orm.models import Layer, Layer_Version, Project, LayerSource, Release
@@ -114,6 +114,9 @@  class TestLayerDetailsPage(SeleniumTestCase):
             btn_save_chg_for_switch = self.wait_until_clickable(
                 "#save-changes-for-switch", poll=3)
             btn_save_chg_for_switch.click()
+        except ElementClickInterceptedException:
+            self.skipTest(
+                "save-changes-for-switch click intercepted. Element not visible or maybe covered by another element.")
         except TimeoutException:
             self.skipTest(
                 "save-changes-for-switch is not clickable within the specified timeout.")
@@ -151,6 +154,9 @@  class TestLayerDetailsPage(SeleniumTestCase):
             btn_save_chg_for_switch = self.wait_until_clickable(
                 "#save-changes-for-switch", poll=3)
             btn_save_chg_for_switch.click()
+        except ElementClickInterceptedException:
+            self.skipTest(
+                "save-changes-for-switch click intercepted. Element not properly visible or maybe behind another element.")
         except TimeoutException:
             self.skipTest(
                 "save-changes-for-switch is not clickable within the specified timeout.")