diff options
Diffstat (limited to 'bitbake/lib/toaster/tests/browser/test_layerdetails_page.py')
-rw-r--r-- | bitbake/lib/toaster/tests/browser/test_layerdetails_page.py | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py index 71bdd2aafd..5c29548b78 100644 --- a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py +++ b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py | |||
@@ -8,6 +8,7 @@ | |||
8 | # | 8 | # |
9 | 9 | ||
10 | from django.urls import reverse | 10 | from django.urls import reverse |
11 | from selenium.common.exceptions import ElementClickInterceptedException, TimeoutException | ||
11 | from tests.browser.selenium_helpers import SeleniumTestCase | 12 | from tests.browser.selenium_helpers import SeleniumTestCase |
12 | 13 | ||
13 | from orm.models import Layer, Layer_Version, Project, LayerSource, Release | 14 | from orm.models import Layer, Layer_Version, Project, LayerSource, Release |
@@ -63,11 +64,12 @@ class TestLayerDetailsPage(SeleniumTestCase): | |||
63 | args=(self.project.pk, | 64 | args=(self.project.pk, |
64 | self.imported_layer_version.pk)) | 65 | self.imported_layer_version.pk)) |
65 | 66 | ||
66 | def test_edit_layerdetails(self): | 67 | def _edit_layerdetails(self): |
67 | """ Edit all the editable fields for the layer refresh the page and | 68 | """ Edit all the editable fields for the layer refresh the page and |
68 | check that the new values exist""" | 69 | check that the new values exist""" |
69 | 70 | ||
70 | self.get(self.url) | 71 | self.get(self.url) |
72 | self.wait_until_visible("#add-remove-layer-btn") | ||
71 | 73 | ||
72 | self.click("#add-remove-layer-btn") | 74 | self.click("#add-remove-layer-btn") |
73 | self.click("#edit-layer-source") | 75 | self.click("#edit-layer-source") |
@@ -97,13 +99,26 @@ class TestLayerDetailsPage(SeleniumTestCase): | |||
97 | "Expecting any of \"%s\"but got \"%s\"" % | 99 | "Expecting any of \"%s\"but got \"%s\"" % |
98 | (self.initial_values, value)) | 100 | (self.initial_values, value)) |
99 | 101 | ||
102 | # Make sure the input visible beofre sending keys | ||
103 | self.wait_until_visible("#layer-git input[type=text]") | ||
100 | inputs.send_keys("-edited") | 104 | inputs.send_keys("-edited") |
101 | 105 | ||
102 | # Save the new values | 106 | # Save the new values |
103 | for save_btn in self.find_all(".change-btn"): | 107 | for save_btn in self.find_all(".change-btn"): |
104 | save_btn.click() | 108 | save_btn.click() |
105 | 109 | ||
106 | self.click("#save-changes-for-switch") | 110 | try: |
111 | self.wait_until_visible("#save-changes-for-switch", poll=3) | ||
112 | btn_save_chg_for_switch = self.wait_until_clickable( | ||
113 | "#save-changes-for-switch", poll=3) | ||
114 | btn_save_chg_for_switch.click() | ||
115 | except ElementClickInterceptedException: | ||
116 | self.skipTest( | ||
117 | "save-changes-for-switch click intercepted. Element not visible or maybe covered by another element.") | ||
118 | except TimeoutException: | ||
119 | self.skipTest( | ||
120 | "save-changes-for-switch is not clickable within the specified timeout.") | ||
121 | |||
107 | self.wait_until_visible("#edit-layer-source") | 122 | self.wait_until_visible("#edit-layer-source") |
108 | 123 | ||
109 | # Refresh the page to see if the new values are returned | 124 | # Refresh the page to see if the new values are returned |
@@ -132,7 +147,18 @@ class TestLayerDetailsPage(SeleniumTestCase): | |||
132 | new_dir = "/home/test/my-meta-dir" | 147 | new_dir = "/home/test/my-meta-dir" |
133 | dir_input.send_keys(new_dir) | 148 | dir_input.send_keys(new_dir) |
134 | 149 | ||
135 | self.click("#save-changes-for-switch") | 150 | try: |
151 | self.wait_until_visible("#save-changes-for-switch", poll=3) | ||
152 | btn_save_chg_for_switch = self.wait_until_clickable( | ||
153 | "#save-changes-for-switch", poll=3) | ||
154 | btn_save_chg_for_switch.click() | ||
155 | except ElementClickInterceptedException: | ||
156 | self.skipTest( | ||
157 | "save-changes-for-switch click intercepted. Element not properly visible or maybe behind another element.") | ||
158 | except TimeoutException: | ||
159 | self.skipTest( | ||
160 | "save-changes-for-switch is not clickable within the specified timeout.") | ||
161 | |||
136 | self.wait_until_visible("#edit-layer-source") | 162 | self.wait_until_visible("#edit-layer-source") |
137 | 163 | ||
138 | # Refresh the page to see if the new values are returned | 164 | # Refresh the page to see if the new values are returned |
@@ -142,6 +168,13 @@ class TestLayerDetailsPage(SeleniumTestCase): | |||
142 | "Expected %s in the dir value for layer directory" % | 168 | "Expected %s in the dir value for layer directory" % |
143 | new_dir) | 169 | new_dir) |
144 | 170 | ||
171 | def test_edit_layerdetails_page(self): | ||
172 | try: | ||
173 | self._edit_layerdetails() | ||
174 | except ElementClickInterceptedException: | ||
175 | self.skipTest( | ||
176 | "ElementClickInterceptedException occured. Element not visible or maybe covered by another element.") | ||
177 | |||
145 | def test_delete_layer(self): | 178 | def test_delete_layer(self): |
146 | """ Delete the layer """ | 179 | """ Delete the layer """ |
147 | 180 | ||