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

Alassane Yattara <[email protected]> Thu, 14 Dec 2023 23:09:10 +0100
Newsgroups org.yoctoproject.lists.toaster
Message-ID <[email protected]>
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 <[email protected]>
---
 lib/toaster/tests/browser/test_layerdetails_page.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/toaster/tests/browser/test_layerdetails_page.py b/lib/to=
aster/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 @@
 #
=20
 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
=20
 from orm.models import Layer, Layer_Version, Project, LayerSource, Relea=
se
@@ -114,6 +114,9 @@ class TestLayerDetailsPage(SeleniumTestCase):
             btn_save_chg_for_switch =3D self.wait_until_clickable(
                 "#save-changes-for-switch", poll=3D3)
             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 spe=
cified timeout.")
@@ -151,6 +154,9 @@ class TestLayerDetailsPage(SeleniumTestCase):
             btn_save_chg_for_switch =3D self.wait_until_clickable(
                 "#save-changes-for-switch", poll=3D3)
             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 spe=
cified timeout.")
--=20
2.34.1