summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
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 18:09:50 +0100
commit4daae7987532eb199a8810be2586dfccaebf8053 (patch)
tree655a13a8dc7100c2bf2ff0e3cb18e4dbe8aacdae /bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
parent2318f92580eeb7042bf9d4d6dd2f514856b69d4a (diff)
downloadpoky-4daae7987532eb199a8810be2586dfccaebf8053.tar.gz
bitbake: 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. (Bitbake rev: acdfafdd753abe38a313c42e3a9d6211338b4e73) 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 'bitbake/lib/toaster/tests/browser/test_layerdetails_page.py')
-rw-r--r--bitbake/lib/toaster/tests/browser/test_layerdetails_page.py32
1 files changed, 28 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
index 2fa9672673..72b6f60c21 100644
--- a/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
+++ b/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -82,15 +82,17 @@ class TestLayerDetailsPage(SeleniumTestCase):
82 self.get(self.url) 82 self.get(self.url)
83 83
84 self.click("#add-remove-layer-btn") 84 self.click("#add-remove-layer-btn")
85 self.click("#edit-layer-source")
86 self.click("#repo")
87
88 self.wait_until_visible("#layer-git-repo-url")
85 89
86 # Open every edit box 90 # Open every edit box
87 for btn in self.find_all("dd .glyphicon-edit"): 91 for btn in self.find_all("dd .glyphicon-edit"):
88 btn.click() 92 btn.click()
89 93
90 self.wait_until_visible("dd input")
91
92 # Edit each value 94 # Edit each value
93 for inputs in self.find_all("dd input[type=text]") + \ 95 for inputs in self.find_all("#layer-git input[type=text]") + \
94 self.find_all("dd textarea"): 96 self.find_all("dd textarea"):
95 # ignore the tt inputs (twitter typeahead input) 97 # ignore the tt inputs (twitter typeahead input)
96 if "tt-" in inputs.get_attribute("class"): 98 if "tt-" in inputs.get_attribute("class"):
@@ -104,16 +106,20 @@ class TestLayerDetailsPage(SeleniumTestCase):
104 106
105 inputs.send_keys("-edited") 107 inputs.send_keys("-edited")
106 108
109 # Save the new values
107 for save_btn in self.find_all(".change-btn"): 110 for save_btn in self.find_all(".change-btn"):
108 save_btn.click() 111 save_btn.click()
109 112
113 self.click("#save-changes-for-switch")
114 self.wait_until_visible("#edit-layer-source")
115
110 # Refresh the page to see if the new values are returned 116 # Refresh the page to see if the new values are returned
111 self.get(self.url) 117 self.get(self.url)
112 118
113 new_values = ["%s-edited" % old_val 119 new_values = ["%s-edited" % old_val
114 for old_val in self.initial_values] 120 for old_val in self.initial_values]
115 121
116 for inputs in self.find_all('dd input[type="text"]') + \ 122 for inputs in self.find_all('#layer-git input[type="text"]') + \
117 self.find_all('dd textarea'): 123 self.find_all('dd textarea'):
118 # ignore the tt inputs (twitter typeahead input) 124 # ignore the tt inputs (twitter typeahead input)
119 if "tt-" in inputs.get_attribute("class"): 125 if "tt-" in inputs.get_attribute("class"):
@@ -125,6 +131,24 @@ class TestLayerDetailsPage(SeleniumTestCase):
125 "Expecting any of \"%s\" but got \"%s\"" % 131 "Expecting any of \"%s\" but got \"%s\"" %
126 (new_values, value)) 132 (new_values, value))
127 133
134 # Now convert it to a local layer
135 self.click("#edit-layer-source")
136 self.click("#dir")
137 dir_input = self.wait_until_visible("#layer-dir-path-in-details")
138
139 new_dir = "/home/test/my-meta-dir"
140 dir_input.send_keys(new_dir)
141
142 self.click("#save-changes-for-switch")
143 self.wait_until_visible("#edit-layer-source")
144
145 # Refresh the page to see if the new values are returned
146 self.get(self.url)
147 dir_input = self.find("#layer-dir-path-in-details")
148 self.assertTrue(new_dir in dir_input.get_attribute("value"),
149 "Expected %s in the dir value for layer directory" %
150 new_dir)
151
128 def test_delete_layer(self): 152 def test_delete_layer(self):
129 """ Delete the layer """ 153 """ Delete the layer """
130 154