aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/tests_functional/test_project_detail_page.py
blob: 0dac7c7e8ce69185104a29b08006a1e5200c4bf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
import time
import re 

from base import ToasterFunctionalTests
from selenium.webdriver.common.action_chains import ActionChains

class ToasterProjectDetailPage(ToasterFunctionalTests):

        ##############
        #  CASE 1514 #
        ##############
    def test_1514(self):
        self.case_no = self.get_case_number()
        self.log.info(' CASE %s log: ' % str(self.case_no))
        self.driver.maximize_window()
        self.driver.get(self._url)
        self.driver.find_element_by_link_text("To start building, create your first Toaster project").click()
        self.driver.find_element_by_id("new-project-name").send_keys("selenium-project")
        self.driver.find_element_by_id('projectversion').click()
        self.driver.find_element_by_id("create-project-button").click()
        self.wait_until_visible('#project-created-notification')
        self.assertTrue(self.element_exists('#project-created-notification'),'Project creation notification not shown')




        ##############
        #  CASE 1515 #
        ##############
    def test_1515(self):
        self.case_no = self.get_case_number()
        self.log.info(' CASE %s log: ' % str(self.case_no))
        self.driver.maximize_window()
        self.driver.get(self._url)
        self.wait_until_visible('#projectstable')
        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()        


        self.assertTrue(self.element_exists('#config-nav'),'Configuration Tab does not exist')
        project_URL=self.get_URL()
        self.driver.find_element_by_xpath('//a[@href="'+project_URL+'"]').click()

        
        try:
            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'customimages/"'+"]").click()
            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')
        except:
            self.fail(msg='No Custom images tab available')



        try:
            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'images/"'+"]").click()
            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')
        except:
            self.fail(msg='No Compatible image tab available')


        try:
            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'softwarerecipes/"'+"]").click()
            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')
        except:
            self.fail(msg='No Compatible software recipe tab available') 
        
        
        try:
            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'machines/"'+"]").click()
            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')
        except:
            self.fail(msg='No Compatible machines tab available')
        

        try:
            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'layers/"'+"]").click()
            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')
        except:
            self.fail(msg='No Compatible layers tab available')
        
        try:
            self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'configuration"'+"]").click()
            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')
        except:
            self.fail(msg='No Bitbake variables tab available')





        ##############
        #  CASE 1516 #
        ##############

    def test_1516(self):

        self.case_no = self.get_case_number()
        project_URL=self.get_URL()
        self.log.info(' CASE %s log: ' % str(self.case_no))
        self.driver.maximize_window()
        self.driver.get(self._url)
        self.wait_until_visible('#projectstable')
        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()

        try:
           self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist')
           self.assertTrue(re.search("qemux86",self.driver.find_element_by_xpath("//span[@id='project-machine-name']").text),'The machine type is not assigned')
           self.driver.find_element_by_xpath("//span[@id='change-machine-toggle']").click()
           self.wait_until_visible('#select-machine-form')
           self.wait_until_visible('#cancel-machine-change') 
           self.driver.find_element_by_xpath("//form[@id='select-machine-form']/a[@id='cancel-machine-change']").click()
        except:
           self.fail(msg='The machine information is wrong in the configuration page')



        try:
           self.driver.find_element_by_xpath("//div[@id='no-most-built']")
        except:
           self.fail(msg='No Most built information in project detail page')


        try:
           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')
        except:
           self.fail(msg='No project release title information in project detail page')


        try:
           self.driver.find_element_by_xpath("//div[@id='layer-container']")
           self.assertTrue(re.search("3",self.driver.find_element_by_xpath("//span[@id='project-layers-count']").text),'There should be 3 layers listed in the layer count')
           self.assertTrue(re.search("openembedded-core",self.driver.find_element_by_xpath("//div[@id='layer-container']/ul[@id='layers-in-project-list']/li/a[@href="+'"'+project_URL+'layer/4"'+"]").text), 'openembedded-core layer should be present')
           self.assertTrue(re.search("meta-poky",self.driver.find_element_by_xpath("//div[@id='layer-container']/ul[@id='layers-in-project-list']/li/a[@href="+'"'+project_URL+'layer/211"'+"]").text), 'meta-poky layer should be present')
           self.assertTrue(re.search("meta-yocto-bsp",self.driver.find_element_by_xpath("//div[@id='layer-container']/ul[@id='layers-in-project-list']/li/a[@href="+'"'+project_URL+'layer/31"'+"]").text), 'meta-yocto-bsp layer should be present')

           self.driver.find_element_by_xpath("//input[@id='layer-add-input']")
           self.driver.find_element_by_xpath("//button[@id='add-layer-btn']")

        except:
           self.fail(msg='No Layer information in project detail page')


        ##############
        #  CASE 1517 #
        ##############
    def test_1517(self):
        self.case_no = self.get_case_number()
        self.log.info(' CASE %s log: ' % str(self.case_no))
        self.driver.maximize_window()
        self.driver.get(self._url)
        self.wait_until_visible('#projectstable')
        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
        try:
            self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist')
            self.assertTrue(re.search("qemux86",self.driver.find_element_by_xpath("//span[@id='project-machine-name']").text),'The machine type is not assigned')
            self.driver.find_element_by_xpath("//span[@id='change-machine-toggle']").click()
            self.wait_until_visible('#select-machine-form')
            self.wait_until_visible('#cancel-machine-change')
            self.driver.find_element_by_xpath("//form[@id='select-machine-form']/a[@id='cancel-machine-change']").click()
        except:
            self.fail(msg='The machine information is wrong in the configuration page')



        ##############
        #  CASE 1518 #
        ##############


    def test_1518(self):
        self.case_no = self.get_case_number()
        project_URL=self.get_URL()
        self.log.info(' CASE %s log: ' % str(self.case_no))
        self.driver.maximize_window()
        self.driver.get(self._url)
        self.wait_until_visible('#projectstable')
        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
        try:
            self.assertTrue(re.search("You haven't built any recipes yet",self.driver.find_element_by_xpath("//div[@id='no-most-built']").text),'Default message of no builds is not present')
            self.driver.find_element_by_xpath("//div[@id='no-most-built']/p/a[@href="+'"'+project_URL+'images/"'+"]").click()
            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')            

        except:
            self.fail(msg='No Most built information in project detail page')




        ##############
        #  CASE 1519 #
        ##############


    def test_1519(self):
        self.case_no = self.get_case_number()
        self.log.info(' CASE %s log: ' % str(self.case_no))
        self.driver.maximize_window()
        self.driver.get(self._url)
        self.wait_until_visible('#projectstable')
        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()

        try:
            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')
        except:
            self.fail(msg='No project release title information in project detail page')




        ##############
        #  CASE 1520 #
        ##############


    def test_1520(self):
        self.case_no = self.get_case_number()
        self.log.info(' CASE %s log: ' % str(self.case_no))
        self.driver.maximize_window()
        self.driver.get(self._url)
        self.wait_until_visible('#projectstable')
        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
        project_URL=self.get_URL()
        
        try:
            self.driver.find_element_by_xpath("//div[@id='layer-container']")
            self.assertTrue(re.search("3",self.driver.find_element_by_xpath("//span[@id='project-layers-count']").text),'There should be 3 layers listed in the layer count')
            self.assertTrue(re.search("openembedded-core",self.driver.find_element_by_xpath("//div[@id='layer-container']/ul[@id='layers-in-project-list']/li/a[@href="+'"'+project_URL+'layer/4"'+"]").text), 'openembedded-core layer should be present')
            self.assertTrue(re.search("meta-poky",self.driver.find_element_by_xpath("//div[@id='layer-container']/ul[@id='layers-in-project-list']/li/a[@href="+'"'+project_URL+'layer/211"'+"]").text), 'meta-poky layer should be present')
            self.assertTrue(re.search("meta-yocto-bsp",self.driver.find_element_by_xpath("//div[@id='layer-container']/ul[@id='layers-in-project-list']/li/a[@href="+'"'+project_URL+'layer/31"'+"]").text), 'meta-yocto-bsp layer should be present')

            self.driver.find_element_by_xpath("//input[@id='layer-add-input']")
            self.driver.find_element_by_xpath("//button[@id='add-layer-btn']")
            self.driver.find_element_by_xpath("//div[@id='layer-container']/form[@class='form-inline']/p/a[@id='view-compatible-layers']")
            self.driver.find_element_by_xpath("//div[@id='layer-container']/form[@class='form-inline']/p/a[@href="+'"'+project_URL+'importlayer"'+"]")

        except:
            self.fail(msg='No Layer information in project detail page')




        ##############
        #  CASE 1521 #
        ##############


    def test_1521(self):
        self.case_no = self.get_case_number()
        self.log.info(' CASE %s log: ' % str(self.case_no))
        self.driver.maximize_window()
        self.driver.get(self._url)
        self.wait_until_visible('#projectstable')
        self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
        project_URL=self.get_URL()


        
        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()
        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')
        time.sleep(5)

        try:
            self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").click()
            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')
            self.driver.find_element_by_xpath("//div[@id='empty-state-projectbuildstable']")
        except:
            self.fail(msg='Builds tab information is not present')



        time.sleep(5)


        try:
            self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").click()
            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')
            
            self.driver.find_element_by_xpath("//fieldset[@id='repo-select']")
            self.driver.find_element_by_xpath("//fieldset[@id='git-repo']")
        except:
            self.fail(msg='Import layer tab not loading properly')


        time.sleep(5)

        try:
            self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").click()
            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')

            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')

        except:
            self.fail(msg='New custom image tab not loading properly')



        time.sleep(5)