diff options
Diffstat (limited to 'bitbake/lib/toaster/tests/functional/test_functional_basic.py')
-rw-r--r-- | bitbake/lib/toaster/tests/functional/test_functional_basic.py | 198 |
1 files changed, 99 insertions, 99 deletions
diff --git a/bitbake/lib/toaster/tests/functional/test_functional_basic.py b/bitbake/lib/toaster/tests/functional/test_functional_basic.py index e4070fbb88..d5c9708617 100644 --- a/bitbake/lib/toaster/tests/functional/test_functional_basic.py +++ b/bitbake/lib/toaster/tests/functional/test_functional_basic.py | |||
@@ -17,145 +17,132 @@ from selenium.webdriver.common.by import By | |||
17 | from tests.functional.utils import get_projectId_from_url | 17 | from tests.functional.utils import get_projectId_from_url |
18 | 18 | ||
19 | 19 | ||
20 | @pytest.mark.django_db | ||
21 | @pytest.mark.order("second_to_last") | ||
22 | class FuntionalTestBasic(SeleniumFunctionalTestCase): | 20 | class FuntionalTestBasic(SeleniumFunctionalTestCase): |
23 | """Basic functional tests for Toaster""" | 21 | """Basic functional tests for Toaster""" |
24 | project_id = None | 22 | project_id = None |
23 | project_url = None | ||
25 | 24 | ||
26 | def setUp(self): | 25 | def setUp(self): |
27 | super(FuntionalTestBasic, self).setUp() | 26 | super(FuntionalTestBasic, self).setUp() |
28 | if not FuntionalTestBasic.project_id: | 27 | if not FuntionalTestBasic.project_id: |
29 | self._create_slenium_project() | 28 | FuntionalTestBasic.project_id = self.create_new_project('selenium-project', '3', None, False) |
30 | current_url = self.driver.current_url | ||
31 | FuntionalTestBasic.project_id = get_projectId_from_url(current_url) | ||
32 | |||
33 | # testcase (1514) | ||
34 | def _create_slenium_project(self): | ||
35 | project_name = 'selenium-project' | ||
36 | self.get(reverse('newproject')) | ||
37 | self.wait_until_visible('#new-project-name', poll=3) | ||
38 | self.driver.find_element(By.ID, "new-project-name").send_keys(project_name) | ||
39 | self.driver.find_element(By.ID, 'projectversion').click() | ||
40 | self.driver.find_element(By.ID, "create-project-button").click() | ||
41 | element = self.wait_until_visible('#project-created-notification', poll=10) | ||
42 | self.assertTrue(self.element_exists('#project-created-notification'),'Project creation notification not shown') | ||
43 | self.assertTrue(project_name in element.text, | ||
44 | "New project name not in new project notification") | ||
45 | self.assertTrue(Project.objects.filter(name=project_name).count(), | ||
46 | "New project not found in database") | ||
47 | return Project.objects.last().id | ||
48 | 29 | ||
49 | # testcase (1515) | 30 | # testcase (1515) |
50 | def test_verify_left_bar_menu(self): | 31 | def test_verify_left_bar_menu(self): |
51 | self.get(reverse('all-projects')) | 32 | self.get(reverse('all-projects')) |
52 | self.wait_until_present('#projectstable', poll=10) | 33 | self.load_projects_page_helper() |
53 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() | 34 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() |
54 | self.wait_until_present('#config-nav', poll=10) | 35 | self.wait_until_present('#config-nav') |
55 | self.assertTrue(self.element_exists('#config-nav'),'Configuration Tab does not exist') | 36 | self.assertTrue(self.element_exists('#config-nav'),'Configuration Tab does not exist') |
56 | project_URL=self.get_URL() | 37 | project_URL=self.get_URL() |
57 | self.driver.find_element(By.XPATH, '//a[@href="'+project_URL+'"]').click() | 38 | self.driver.find_element(By.XPATH, '//a[@href="'+project_URL+'"]').click() |
58 | self.wait_until_present('#config-nav', poll=10) | ||
59 | 39 | ||
60 | try: | 40 | try: |
41 | self.wait_until_present('#config-nav') | ||
61 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'customimages/"'+"]").click() | 42 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'customimages/"'+"]").click() |
62 | self.wait_until_present('#config-nav', poll=10) | 43 | self.wait_until_present('#filter-modal-customimagestable') |
63 | self.assertTrue(re.search("Custom images",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'Custom images information is not loading properly') | ||
64 | except: | 44 | except: |
65 | self.fail(msg='No Custom images tab available') | 45 | self.fail(msg='No Custom images tab available') |
46 | self.assertTrue(re.search("Custom images",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'Custom images information is not loading properly') | ||
66 | 47 | ||
67 | try: | 48 | try: |
68 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'images/"'+"]").click() | 49 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'images/"'+"]").click() |
69 | self.wait_until_present('#config-nav', poll=10) | 50 | self.wait_until_present('#filter-modal-imagerecipestable') |
70 | self.assertTrue(re.search("Compatible image recipes",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible image recipes information is not loading properly') | ||
71 | except: | 51 | except: |
72 | self.fail(msg='No Compatible image tab available') | 52 | self.fail(msg='No Compatible image tab available') |
53 | self.assertTrue(re.search("Compatible image recipes",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible image recipes information is not loading properly') | ||
73 | 54 | ||
74 | try: | 55 | try: |
75 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'softwarerecipes/"'+"]").click() | 56 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'softwarerecipes/"'+"]").click() |
76 | self.wait_until_present('#config-nav', poll=10) | 57 | self.wait_until_present('#filter-modal-softwarerecipestable') |
77 | self.assertTrue(re.search("Compatible software recipes",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible software recipe information is not loading properly') | ||
78 | except: | 58 | except: |
79 | self.fail(msg='No Compatible software recipe tab available') | 59 | self.fail(msg='No Compatible software recipe tab available') |
60 | self.assertTrue(re.search("Compatible software recipes",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible software recipe information is not loading properly') | ||
80 | 61 | ||
81 | try: | 62 | try: |
82 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'machines/"'+"]").click() | 63 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'machines/"'+"]").click() |
83 | self.wait_until_present('#config-nav', poll=10) | 64 | self.wait_until_present('#filter-modal-machinestable') |
84 | self.assertTrue(re.search("Compatible machines",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible machine information is not loading properly') | ||
85 | except: | 65 | except: |
86 | self.fail(msg='No Compatible machines tab available') | 66 | self.fail(msg='No Compatible machines tab available') |
67 | self.assertTrue(re.search("Compatible machines",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible machine information is not loading properly') | ||
87 | 68 | ||
88 | try: | 69 | try: |
89 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'layers/"'+"]").click() | 70 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'layers/"'+"]").click() |
90 | self.wait_until_present('#config-nav', poll=10) | 71 | self.wait_until_present('#filter-modal-layerstable') |
91 | self.assertTrue(re.search("Compatible layers",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible layer information is not loading properly') | ||
92 | except: | 72 | except: |
93 | self.fail(msg='No Compatible layers tab available') | 73 | self.fail(msg='No Compatible layers tab available') |
74 | self.assertTrue(re.search("Compatible layers",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Compatible layer information is not loading properly') | ||
94 | 75 | ||
95 | try: | 76 | try: |
96 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'configuration"'+"]").click() | 77 | self.driver.find_element(By.XPATH, "//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'configuration"'+"]").click() |
97 | self.wait_until_present('#config-nav', poll=10) | 78 | self.wait_until_present('#configvar-list') |
98 | self.assertTrue(re.search("Bitbake variables",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Bitbake variables information is not loading properly') | ||
99 | except: | 79 | except: |
100 | self.fail(msg='No Bitbake variables tab available') | 80 | self.fail(msg='No Bitbake variables tab available') |
81 | self.assertTrue(re.search("Bitbake variables",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Bitbake variables information is not loading properly') | ||
101 | 82 | ||
102 | # testcase (1516) | 83 | # testcase (1516) |
103 | def test_review_configuration_information(self): | 84 | def test_review_configuration_information(self): |
104 | self.get(reverse('all-projects')) | 85 | self.get(reverse('all-projects')) |
105 | self.wait_until_present('#projectstable', poll=10) | 86 | self.load_projects_page_helper() |
106 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() | 87 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() |
107 | project_URL=self.get_URL() | 88 | project_URL=self.get_URL() |
108 | self.wait_until_present('#config-nav', poll=10) | 89 | |
90 | # Machine section of page | ||
91 | self.wait_until_visible('#machine-section') | ||
92 | self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist') | ||
93 | self.assertTrue(re.search("qemux86-64",self.driver.find_element(By.XPATH, "//span[@id='project-machine-name']").text),'The machine type is not assigned') | ||
109 | try: | 94 | try: |
110 | self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist') | ||
111 | self.assertTrue(re.search("qemux86-64",self.driver.find_element(By.XPATH, "//span[@id='project-machine-name']").text),'The machine type is not assigned') | ||
112 | self.driver.find_element(By.XPATH, "//span[@id='change-machine-toggle']").click() | 95 | self.driver.find_element(By.XPATH, "//span[@id='change-machine-toggle']").click() |
113 | self.wait_until_visible('#select-machine-form', poll=10) | 96 | self.wait_until_visible('#select-machine-form') |
114 | self.wait_until_visible('#cancel-machine-change', poll=10) | 97 | self.wait_until_visible('#cancel-machine-change') |
115 | self.driver.find_element(By.XPATH, "//form[@id='select-machine-form']/a[@id='cancel-machine-change']").click() | 98 | self.driver.find_element(By.XPATH, "//form[@id='select-machine-form']/a[@id='cancel-machine-change']").click() |
116 | except: | 99 | except: |
117 | self.fail(msg='The machine information is wrong in the configuration page') | 100 | self.fail(msg='The machine information is wrong in the configuration page') |
118 | 101 | ||
102 | # Most built recipes section | ||
103 | self.wait_until_visible('#no-most-built') | ||
119 | try: | 104 | try: |
120 | self.driver.find_element(By.ID, 'no-most-built') | 105 | self.driver.find_element(By.ID, 'no-most-built') |
121 | except: | 106 | except: |
122 | self.fail(msg='No Most built information in project detail page') | 107 | self.fail(msg='No Most built information in project detail page') |
123 | 108 | ||
124 | try: | 109 | # Project Release title |
125 | self.assertTrue(re.search("Yocto Project master",self.driver.find_element(By.XPATH, "//span[@id='project-release-title']").text),'The project release is not defined') | 110 | self.assertTrue(re.search("Yocto Project master",self.driver.find_element(By.XPATH, "//span[@id='project-release-title']").text), 'The project release is not defined in the project detail page') |
126 | except: | ||
127 | self.fail(msg='No project release title information in project detail page') | ||
128 | 111 | ||
112 | # List of layers in project | ||
113 | self.wait_until_visible('#layer-container') | ||
114 | self.driver.find_element(By.XPATH, "//div[@id='layer-container']") | ||
115 | self.assertTrue(re.search("3",self.driver.find_element(By.ID, "project-layers-count").text),'There should be 3 layers listed in the layer count') | ||
129 | try: | 116 | try: |
130 | self.driver.find_element(By.XPATH, "//div[@id='layer-container']") | ||
131 | self.assertTrue(re.search("3",self.driver.find_element(By.ID, "project-layers-count").text),'There should be 3 layers listed in the layer count') | ||
132 | layer_list = self.driver.find_element(By.ID, "layers-in-project-list") | 117 | layer_list = self.driver.find_element(By.ID, "layers-in-project-list") |
133 | layers = layer_list.find_elements(By.TAG_NAME, "li") | 118 | layers = layer_list.find_elements(By.TAG_NAME, "li") |
134 | for layer in layers: | ||
135 | if re.match ("openembedded-core",layer.text): | ||
136 | print ("openembedded-core layer is a default layer in the project configuration") | ||
137 | elif re.match ("meta-poky",layer.text): | ||
138 | print ("meta-poky layer is a default layer in the project configuration") | ||
139 | elif re.match ("meta-yocto-bsp",layer.text): | ||
140 | print ("meta-yocto-bsp is a default layer in the project configuratoin") | ||
141 | else: | ||
142 | self.fail(msg='default layers are missing from the project configuration') | ||
143 | except: | 119 | except: |
144 | self.fail(msg='No Layer information in project detail page') | 120 | self.fail(msg='No Layer information in project detail page') |
145 | 121 | ||
122 | for layer in layers: | ||
123 | if re.match ("openembedded-core", layer.text): | ||
124 | print ("openembedded-core layer is a default layer in the project configuration") | ||
125 | elif re.match ("meta-poky", layer.text): | ||
126 | print ("meta-poky layer is a default layer in the project configuration") | ||
127 | elif re.match ("meta-yocto-bsp", layer.text): | ||
128 | print ("meta-yocto-bsp is a default layer in the project configuratoin") | ||
129 | else: | ||
130 | self.fail(msg='default layers are missing from the project configuration') | ||
131 | |||
146 | # testcase (1517) | 132 | # testcase (1517) |
147 | def test_verify_machine_information(self): | 133 | def test_verify_machine_information(self): |
148 | self.get(reverse('all-projects')) | 134 | self.get(reverse('all-projects')) |
149 | self.wait_until_present('#projectstable', poll=10) | 135 | self.load_projects_page_helper() |
150 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() | 136 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() |
151 | self.wait_until_present('#config-nav', poll=10) | ||
152 | 137 | ||
138 | self.wait_until_visible('#machine-section') | ||
139 | self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist') | ||
140 | self.wait_until_visible('#project-machine-name') | ||
141 | self.assertTrue(re.search("qemux86-64",self.driver.find_element(By.ID, "project-machine-name").text),'The machine type is not assigned') | ||
153 | try: | 142 | try: |
154 | self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist') | ||
155 | self.assertTrue(re.search("qemux86-64",self.driver.find_element(By.ID, "project-machine-name").text),'The machine type is not assigned') | ||
156 | self.driver.find_element(By.ID, "change-machine-toggle").click() | 143 | self.driver.find_element(By.ID, "change-machine-toggle").click() |
157 | self.wait_until_visible('#select-machine-form', poll=10) | 144 | self.wait_until_visible('#select-machine-form') |
158 | self.wait_until_visible('#cancel-machine-change', poll=10) | 145 | self.wait_until_visible('#cancel-machine-change') |
159 | self.driver.find_element(By.ID, "cancel-machine-change").click() | 146 | self.driver.find_element(By.ID, "cancel-machine-change").click() |
160 | except: | 147 | except: |
161 | self.fail(msg='The machine information is wrong in the configuration page') | 148 | self.fail(msg='The machine information is wrong in the configuration page') |
@@ -163,83 +150,95 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): | |||
163 | # testcase (1518) | 150 | # testcase (1518) |
164 | def test_verify_most_built_recipes_information(self): | 151 | def test_verify_most_built_recipes_information(self): |
165 | self.get(reverse('all-projects')) | 152 | self.get(reverse('all-projects')) |
166 | self.wait_until_present('#projectstable', poll=10) | 153 | self.load_projects_page_helper() |
167 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() | 154 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() |
168 | self.wait_until_present('#config-nav', poll=10) | 155 | self.wait_until_present('#config-nav') |
169 | project_URL=self.get_URL() | 156 | project_URL=self.get_URL() |
157 | |||
158 | self.wait_until_visible('#no-most-built') | ||
159 | self.assertTrue(re.search("You haven't built any recipes yet",self.driver.find_element(By.ID, "no-most-built").text),'Default message of no builds is not present') | ||
170 | try: | 160 | try: |
171 | self.assertTrue(re.search("You haven't built any recipes yet",self.driver.find_element(By.ID, "no-most-built").text),'Default message of no builds is not present') | ||
172 | self.driver.find_element(By.XPATH, "//div[@id='no-most-built']/p/a[@href="+'"'+project_URL+'images/"'+"]").click() | 161 | self.driver.find_element(By.XPATH, "//div[@id='no-most-built']/p/a[@href="+'"'+project_URL+'images/"'+"]").click() |
173 | self.wait_until_present('#config-nav', poll=10) | ||
174 | self.assertTrue(re.search("Compatible image recipes",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Choose a recipe to build link is not working properly') | ||
175 | except: | 162 | except: |
176 | self.fail(msg='No Most built information in project detail page') | 163 | self.fail(msg='No Most built information in project detail page') |
164 | self.wait_until_visible('#config-nav') | ||
165 | self.assertTrue(re.search("Compatible image recipes",self.driver.find_element(By.XPATH, "//div[@class='col-md-10']").text),'The Choose a recipe to build link is not working properly') | ||
177 | 166 | ||
178 | # testcase (1519) | 167 | # testcase (1519) |
179 | def test_verify_project_release_information(self): | 168 | def test_verify_project_release_information(self): |
180 | self.get(reverse('all-projects')) | 169 | self.get(reverse('all-projects')) |
181 | self.wait_until_present('#projectstable', poll=10) | 170 | self.load_projects_page_helper() |
182 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() | 171 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() |
183 | self.wait_until_present('#config-nav', poll=10) | 172 | self.wait_until_visible('#project-release-title') |
184 | 173 | self.assertTrue(re.search("Yocto Project master",self.driver.find_element(By.ID, "project-release-title").text), 'No project release title information in project detail page') | |
185 | try: | ||
186 | self.assertTrue(re.search("Yocto Project master",self.driver.find_element(By.ID, "project-release-title").text),'The project release is not defined') | ||
187 | except: | ||
188 | self.fail(msg='No project release title information in project detail page') | ||
189 | 174 | ||
190 | # testcase (1520) | 175 | # testcase (1520) |
191 | def test_verify_layer_information(self): | 176 | def test_verify_layer_information(self): |
192 | self.get(reverse('all-projects')) | 177 | self.get(reverse('all-projects')) |
193 | self.wait_until_present('#projectstable', poll=10) | 178 | self.load_projects_page_helper() |
194 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() | 179 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() |
195 | self.wait_until_present('#config-nav', poll=10) | 180 | self.wait_until_present('#config-nav') |
196 | project_URL=self.get_URL() | 181 | project_URL=self.get_URL() |
182 | self.wait_until_visible('#layer-container') | ||
183 | self.driver.find_element(By.XPATH, "//div[@id='layer-container']") | ||
184 | self.wait_until_visible('#project-layers-count') | ||
185 | self.assertTrue(re.search("3",self.driver.find_element(By.ID, "project-layers-count").text),'There should be 3 layers listed in the layer count') | ||
186 | |||
197 | try: | 187 | try: |
198 | self.driver.find_element(By.XPATH, "//div[@id='layer-container']") | ||
199 | self.assertTrue(re.search("3",self.driver.find_element(By.ID, "project-layers-count").text),'There should be 3 layers listed in the layer count') | ||
200 | layer_list = self.driver.find_element(By.ID, "layers-in-project-list") | 188 | layer_list = self.driver.find_element(By.ID, "layers-in-project-list") |
201 | layers = layer_list.find_elements(By.TAG_NAME, "li") | 189 | layers = layer_list.find_elements(By.TAG_NAME, "li") |
190 | except: | ||
191 | self.fail(msg='No Layer information in project detail page') | ||
202 | 192 | ||
203 | for layer in layers: | 193 | for layer in layers: |
204 | if re.match ("openembedded-core",layer.text): | 194 | if re.match ("openembedded-core",layer.text): |
205 | print ("openembedded-core layer is a default layer in the project configuration") | 195 | print ("openembedded-core layer is a default layer in the project configuration") |
206 | elif re.match ("meta-poky",layer.text): | 196 | elif re.match ("meta-poky",layer.text): |
207 | print ("meta-poky layer is a default layer in the project configuration") | 197 | print ("meta-poky layer is a default layer in the project configuration") |
208 | elif re.match ("meta-yocto-bsp",layer.text): | 198 | elif re.match ("meta-yocto-bsp",layer.text): |
209 | print ("meta-yocto-bsp is a default layer in the project configuratoin") | 199 | print ("meta-yocto-bsp is a default layer in the project configuratoin") |
210 | else: | 200 | else: |
211 | self.fail(msg='default layers are missing from the project configuration') | 201 | self.fail(msg='default layers are missing from the project configuration') |
212 | 202 | ||
203 | try: | ||
213 | self.driver.find_element(By.XPATH, "//input[@id='layer-add-input']") | 204 | self.driver.find_element(By.XPATH, "//input[@id='layer-add-input']") |
214 | self.driver.find_element(By.XPATH, "//button[@id='add-layer-btn']") | 205 | self.driver.find_element(By.XPATH, "//button[@id='add-layer-btn']") |
215 | self.driver.find_element(By.XPATH, "//div[@id='layer-container']/form[@class='form-inline']/p/a[@id='view-compatible-layers']") | 206 | self.driver.find_element(By.XPATH, "//div[@id='layer-container']/form[@class='form-inline']/p/a[@id='view-compatible-layers']") |
216 | self.driver.find_element(By.XPATH, "//div[@id='layer-container']/form[@class='form-inline']/p/a[@href="+'"'+project_URL+'importlayer"'+"]") | 207 | self.driver.find_element(By.XPATH, "//div[@id='layer-container']/form[@class='form-inline']/p/a[@href="+'"'+project_URL+'importlayer"'+"]") |
217 | except: | 208 | except: |
218 | self.fail(msg='No Layer information in project detail page') | 209 | self.fail(msg='Layer configuration controls missing') |
219 | 210 | ||
220 | # testcase (1521) | 211 | # testcase (1521) |
221 | def test_verify_project_detail_links(self): | 212 | def test_verify_project_detail_links(self): |
222 | self.get(reverse('all-projects')) | 213 | self.get(reverse('all-projects')) |
223 | self.wait_until_present('#projectstable', poll=10) | 214 | self.load_projects_page_helper() |
224 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() | 215 | self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click() |
225 | self.wait_until_present('#config-nav', poll=10) | 216 | self.wait_until_present('#config-nav') |
226 | project_URL=self.get_URL() | 217 | project_URL=self.get_URL() |
227 | self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li[@id='topbar-configuration-tab']/a[@href="+'"'+project_URL+'"'+"]").click() | 218 | self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li[@id='topbar-configuration-tab']/a[@href="+'"'+project_URL+'"'+"]").click() |
228 | self.wait_until_present('#config-nav', poll=10) | 219 | self.wait_until_visible('#topbar-configuration-tab') |
229 | self.assertTrue(re.search("Configuration",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li[@id='topbar-configuration-tab']/a[@href="+'"'+project_URL+'"'+"]").text), 'Configuration tab in project topbar is misspelled') | 220 | self.assertTrue(re.search("Configuration",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li[@id='topbar-configuration-tab']/a[@href="+'"'+project_URL+'"'+"]").text), 'Configuration tab in project topbar is misspelled') |
230 | 221 | ||
231 | try: | 222 | try: |
232 | self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").click() | 223 | self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").click() |
233 | self.wait_until_visible('#project-topbar', poll=10) | 224 | except: |
234 | self.assertTrue(re.search("Builds",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").text), 'Builds tab in project topbar is misspelled') | 225 | self.fail(msg='Builds tab information is not present') |
226 | |||
227 | self.wait_until_visible('#project-topbar') | ||
228 | self.assertTrue(re.search("Builds",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").text), 'Builds tab in project topbar is misspelled') | ||
229 | try: | ||
235 | self.driver.find_element(By.XPATH, "//div[@id='empty-state-projectbuildstable']") | 230 | self.driver.find_element(By.XPATH, "//div[@id='empty-state-projectbuildstable']") |
236 | except: | 231 | except: |
237 | self.fail(msg='Builds tab information is not present') | 232 | self.fail(msg='Builds tab information is not present') |
238 | 233 | ||
239 | try: | 234 | try: |
240 | self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").click() | 235 | self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").click() |
241 | self.wait_until_visible('#project-topbar', poll=10) | 236 | except: |
242 | self.assertTrue(re.search("Import layer",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").text), 'Import layer tab in project topbar is misspelled') | 237 | self.fail(msg='Import layer tab not loading properly') |
238 | |||
239 | self.wait_until_visible('#project-topbar') | ||
240 | self.assertTrue(re.search("Import layer",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").text), 'Import layer tab in project topbar is misspelled') | ||
241 | try: | ||
243 | self.driver.find_element(By.XPATH, "//fieldset[@id='repo-select']") | 242 | self.driver.find_element(By.XPATH, "//fieldset[@id='repo-select']") |
244 | self.driver.find_element(By.XPATH, "//fieldset[@id='git-repo']") | 243 | self.driver.find_element(By.XPATH, "//fieldset[@id='git-repo']") |
245 | except: | 244 | except: |
@@ -247,11 +246,12 @@ class FuntionalTestBasic(SeleniumFunctionalTestCase): | |||
247 | 246 | ||
248 | try: | 247 | try: |
249 | self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").click() | 248 | self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").click() |
250 | self.wait_until_visible('#project-topbar', poll=10) | ||
251 | self.assertTrue(re.search("New custom image",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").text), 'New custom image tab in project topbar is misspelled') | ||
252 | self.assertTrue(re.search("Select the image recipe you want to customise",self.driver.find_element(By.XPATH, "//div[@class='col-md-12']/h2").text),'The new custom image tab is not loading correctly') | ||
253 | except: | 249 | except: |
254 | self.fail(msg='New custom image tab not loading properly') | 250 | self.fail(msg='New custom image tab not loading properly') |
255 | 251 | ||
252 | self.wait_until_visible('#project-topbar') | ||
253 | self.assertTrue(re.search("New custom image",self.driver.find_element(By.XPATH, "//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").text), 'New custom image tab in project topbar is misspelled') | ||
254 | self.assertTrue(re.search("Select the image recipe you want to customise",self.driver.find_element(By.XPATH, "//div[@class='col-md-12']/h2").text),'The new custom image tab is not loading correctly') | ||
255 | |||
256 | 256 | ||
257 | 257 | ||