summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-08-22 16:42:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-02 16:29:36 +0100
commitacdfafdd753abe38a313c42e3a9d6211338b4e73 (patch)
tree4aab49f67c59aa842744662e5d5f535fb8269fab /lib
parent37c2b4f105d7334cdd83d9675af787f4327e7fe7 (diff)
downloadbitbake-contrib-acdfafdd753abe38a313c42e3a9d6211338b4e73.tar.gz
toaster: tests Add selenium test layer source switching layer details page
Add selenium tests for the new layer source switching functionality on the layer details page. Edits the values for git repository and saves and then edits the details for directory information and saves. Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/toaster/tests/browser/test_layerdetails_page.py32
1 files changed, 28 insertions, 4 deletions
diff --git a/lib/toaster/tests/browser/test_layerdetails_page.py b/lib/toaster/tests/browser/test_layerdetails_page.py
index 2fa967267..72b6f60c2 100644
--- a/lib/toaster/tests/browser/test_layerdetails_page.py
+++ b/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -82,15 +82,17 @@ class TestLayerDetailsPage(SeleniumTestCase):
self.get(self.url)
self.click("#add-remove-layer-btn")
+ self.click("#edit-layer-source")
+ self.click("#repo")
+
+ self.wait_until_visible("#layer-git-repo-url")
# Open every edit box
for btn in self.find_all("dd .glyphicon-edit"):
btn.click()
- self.wait_until_visible("dd input")
-
# Edit each value
- for inputs in self.find_all("dd input[type=text]") + \
+ for inputs in self.find_all("#layer-git input[type=text]") + \
self.find_all("dd textarea"):
# ignore the tt inputs (twitter typeahead input)
if "tt-" in inputs.get_attribute("class"):
@@ -104,16 +106,20 @@ class TestLayerDetailsPage(SeleniumTestCase):
inputs.send_keys("-edited")
+ # Save the new values
for save_btn in self.find_all(".change-btn"):
save_btn.click()
+ self.click("#save-changes-for-switch")
+ self.wait_until_visible("#edit-layer-source")
+
# Refresh the page to see if the new values are returned
self.get(self.url)
new_values = ["%s-edited" % old_val
for old_val in self.initial_values]
- for inputs in self.find_all('dd input[type="text"]') + \
+ for inputs in self.find_all('#layer-git input[type="text"]') + \
self.find_all('dd textarea'):
# ignore the tt inputs (twitter typeahead input)
if "tt-" in inputs.get_attribute("class"):
@@ -125,6 +131,24 @@ class TestLayerDetailsPage(SeleniumTestCase):
"Expecting any of \"%s\" but got \"%s\"" %
(new_values, value))
+ # Now convert it to a local layer
+ self.click("#edit-layer-source")
+ self.click("#dir")
+ dir_input = self.wait_until_visible("#layer-dir-path-in-details")
+
+ new_dir = "/home/test/my-meta-dir"
+ dir_input.send_keys(new_dir)
+
+ self.click("#save-changes-for-switch")
+ self.wait_until_visible("#edit-layer-source")
+
+ # Refresh the page to see if the new values are returned
+ self.get(self.url)
+ dir_input = self.find("#layer-dir-path-in-details")
+ self.assertTrue(new_dir in dir_input.get_attribute("value"),
+ "Expected %s in the dir value for layer directory" %
+ new_dir)
+
def test_delete_layer(self):
""" Delete the layer """