-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtestcases_manage.py
629 lines (542 loc) · 27.4 KB
/
testcases_manage.py
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
#=======================================================================
#
# MANAGE SOURCES TESTS
#
#=======================================================================
#
# Includes the following test cases:
# 1. TestCase_AddSourceFeed_257
# 2. TestCase_AddDuplicateFeed_258
# 3. TestCase_AddSourceWithDuplicateVideos_259
# 4. TestCase_EditSource_479
# 5. TestCase_BulkEditSources_264
# 6. TestCase_BulkDeleteSources_265
# 7. TestCase_SearchForVideos_260
# 8. TestCase_SearchVideoByNonASCIITerm_261
# 9. TestCase_AddSearchFeed_262
# 10. TestCase_SortSources_266
# 11. TestCase_SearchInSources_267
# 12. TestCase_FilterSources_268
from selenium import selenium
import unittest, time, re, sys
import mclib, loginlogout, categories, sources, queue, testvars
# ----------------------------------------------------------------------
class TestCase_AddSourceFeed_257(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_AddSourceFeed_257(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
# Check if the source exists. If yes, delete it
# source = "Al Jazeera Arts World - Video"
# sourceURL = "http://feeds2.feedburner.com/video/artsworld"
source = "Reel Science"
sourceURL = "http://blip.tv/reelscience"
currentSourceLocation = sources.SourceLocation(self,sel,source)
# if currentSourceLocation!=[0,0]:
sources.DeleteSource(self,sel,source)
# Add the source with the specified URL and Approve All parameter set to true
# Associate it with a category and "Selene Test-Admin" user
sources.AddSource(self,sel,sourceURL,0,testvars.newCategories[3],"Selene Test-Admin")
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_AddDuplicateFeed_258(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_AddDuplicateFeed_258(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
#sourceURL = "http://feeds2.feedburner.com/video/artsworld"
sourceURL = "http://blip.tv/reelscience"
sources.AddDuplicateSource(self,sel,sourceURL)
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_AddSourceWithDuplicateVideos_259(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_AddSourceWithDuplicateVideos_259(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
# Delete existing source, if appropriate
source = "Yahoo Media TEST"
if sources.SourceLocation(self,sel,source)!=[0,0]:
sources.DeleteSource(self,sel,source)
# Add new source
sources.AddSource(self,sel,"http://participatoryculture.org/feeds_test/feed1.rss",1,"","")
# Now check the videos imported
sel.open(testvars.MCTestVariables["ManageSourcesPage"])
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
sourceLoc = sources.SourceLocation(self,sel,source)
page = sourceLoc[0]
rowNo = sourceLoc[1]
if rowNo == 0:
row = ""
else:
row = "["+str(rowNo)+"]"
print "Viewing source "+source+"..."
sel.open(testvars.MCTestVariables["ManageSourcesPage"]+"/?page="+str(page))
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
viewLink="//div[@id='labels']/form[2]/table/tbody/tr"+str(row)+"/td[2]/div/a[3]"
if sel.is_element_present(viewLink)==True:
sel.click(viewLink)
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
print "Counting imported videos..."
cnt = sel.get_xpath_count("//a[@class='thumbnail']")
print str(cnt)+" videos found"
else:
mclib.AppendErrorMessage(self,sel,"Could not find View link for source: "+source)
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_EditSource_479(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_EditSource_479(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
#oldSourceName = "Al Jazeera Arts World - Video"
oldSourceName = "Reel Science"
oldSourceURL = "http://blip.tv/reelscience"
# Does source to be edited exist? If not, add it
if sources.SourceLocation(self,sel,oldSourceName)==[0,0]:
print oldSourceName+" feed not found - adding it..."
sources.AddSource(self,sel,oldSourceURL,0,"","")
newSourceName = "Best of Attenborough"
# Does the target source exist? If yes, delete it
if sources.SourceLocation(self,sel,newSourceName)!=[0,0]:
print "Target feed "+newSourceName+" already exists - deleting it..."
sources.DeleteSource(self,sel,newSourceName)
# If the pre-defined category is missing in the system,
# pick the first category from the list of existing categories
newcat = testvars.newCategories[6]
if categories.CategoryRow(self,sel,newcat)==0:
newcat = categories.GetCategoryList(self,sel)[0]
print "New category: "+newcat
sources.EditSource(self,sel,oldSourceName,newSourceName,"http://www.youtube.com/user/BestofAttenborough","http://delicious.com/BestofAttenborough",newcat,"selene test-user")
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_BulkEditSources_264(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_BulkEditSources_264(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
# List all the available sources
sourcelist = sources.GetSourceList(self,sel)
print sourcelist
# Pick two sources
editList = sourcelist[8:10]
print editList
# If the pre-defined category is missing in the system, pick the last
# category from the list of existing categories
newcat = "family"
if categories.CategoryRow(self,sel,newcat)==0:
categoryList = categories.GetCategoryList(self,sel)
q= len(categoryList)
newcat = categoryList[q-1]
print "New category: "+newcat
# Bulk edit the selected sources
sources.BulkEditSource(self,sel,editList,1,newcat,"selene test-user")
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_BulkDeleteSources_265(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_BulkDeleteSources_265(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
sourcelist = sources.GetSourceList(self,sel)
print "Full list of available sources:"
print sourcelist
deleteList = sourcelist[4:6]
print "The following sources will be deleted:"
print deleteList
sources.BulkDeleteSource(self,sel,deleteList)
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_SearchForVideos_260(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_SearchForVideos_260(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
searchterm = "tango"
sortby = 0 # Latest
if sources.SearchForVideos(self,sel,searchterm,sortby)==0:
print "0 videos found - cannot approve, feature or add to queue items"
else:
# Approve video No.1
video1title = sel.get_text("//div[@id='admin_videolisting_row']/div[1]/div[1]/h3/a")
print "Approving video \""+video1title+"\"..."
approveLink = "//div[@id='admin_videolisting_row']/div[1]/div[2]/a[2]/span"
if sel.is_element_present(approveLink)==True:
sel.click(approveLink)
time.sleep(8)
print "OK"
else:
mclib.AppendErrorMessage(self,sel,"Approve link not found for the video")
# Feature video No.2 (as video 1 disappears from the list, )
video2title = sel.get_text("//div[@id='admin_videolisting_row']/div[1]/div[1]/h3/a")
print "Featuring video \""+video2title+"\"..."
featureLink = "//div[@id='admin_videolisting_row']/div[1]/div[2]/a[1]/span"
if sel.is_element_present(featureLink)==True:
sel.click(featureLink)
time.sleep(8)
print "OK"
else:
mclib.AppendErrorMessage(self,sel,"Feature link not found for the video")
# Add to Queue video No.3
video3title = sel.get_text("//div[@id='admin_videolisting_row']/div[1]/div[1]/h3/a")
print "Adding video \""+video3title+"\" to the queue..."
queueLink = "//div[@id='admin_videolisting_row']/div[1]/div[2]/a[3]/span"
if sel.is_element_present(queueLink)==True:
sel.click(queueLink)
time.sleep(5)
#sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
print "OK"
else:
mclib.AppendErrorMessage(self,sel,"Add to Queue link not found for the video")
#Checking the new videos in the lists
#Searching for the approved video
queue.CheckVideoStatus(self,sel,video1title,"Approved")
# Navigate to Manage Sources page to prevent freezing if the script
sel.click(testvars.MCUI["AdminManageSources"])
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
print " "
#Searching for the featured video
queue.CheckVideoStatus(self,sel,video2title,"Featured")
print " "
print "Searching for the video in the queue..."
# Looking for the last page in the queue
try:
sel.open(testvars.MCTestVariables["ReviewQueuePage"]+"/?page=1000000")
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
except: pass
if sel.is_element_present("//a[contains(text(),video3title)]")==True:
print "Found video \""+video3title+"\" in the queue on the last page - OK"
else:
mclib.AppendErrorMessage(self,sel,"Could not find video "+video3title+" on the last page of the queue")
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_SearchVideoByNonASCIITerm_261(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_SearchVideoByNonASCIITerm_261(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
searchterm = u"\u0442\u0443\u0440\u0438\u0437\u043C" #'tourism' in Cyrillic alphabet
# searchterm = u"\u0414\u0443\u0431\u0440\u043E\u0432\u043D\u0438\u043A" #'Dubrovnik' in Cyrillic alphabet
sortby = 1 # sort by Relevance
if sources.SearchForVideos(self,sel,searchterm,sortby)==0:
print "0 videos found - cannot approve, feature or add to queue items"
else:
# Approve video No.1
video1title = sel.get_text("//div[@id='admin_videolisting_row']/div[1]/div[1]/h3/a")
print "Approving video \""+video1title+"\"..."
approveLink = "//div[@id='admin_videolisting_row']/div[1]/div[2]/a[2]/span"
if sel.is_element_present(approveLink)==True:
sel.click(approveLink)
time.sleep(10)
print "OK"
else:
mclib.AppendErrorMessage(self,sel,"Approve link not found for the video")
# Feature video No.2 (as video 1 disappears from the list, )
video2title = sel.get_text("//div[@id='admin_videolisting_row']/div[1]/div[1]/h3/a")
print "Featuring video \""+video2title+"\"..."
featureLink = "//div[@id='admin_videolisting_row']/div[1]/div[2]/a[1]/span"
if sel.is_element_present(featureLink)==True:
sel.click(featureLink)
time.sleep(5)
#sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
print "OK"
else:
mclib.AppendErrorMessage(self,sel,"Feature link not found for the video")
# Add to Queue video No.3
video3title = sel.get_text("//div[@id='admin_videolisting_row']/div[1]/div[1]/h3/a")
print "Adding video \""+video3title+"\" to the queue..."
queueLink = "//div[@id='admin_videolisting_row']/div[1]/div[2]/a[3]/span"
if sel.is_element_present(queueLink)==True:
sel.click(queueLink)
time.sleep(5)
print "OK"
else:
mclib.AppendErrorMessage(self,sel,"Add to Queue link not found for the video")
#Checking the new videos in the lists
#Searching for the approved video
queue.CheckVideoStatus(self,sel,video1title,"Approved")
# Navigate to Manage Sources page to prevent freezing if the script
sel.click(testvars.MCUI["AdminManageSources"])
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
print " "
#Searching for the featured video
queue.CheckVideoStatus(self,sel,video2title,"Featured")
print ""
print "Searching for the video in the queue..."
# Looking for the last page in the queue
try:
sel.open(testvars.MCTestVariables["ReviewQueuePage"]+"/?page=1000000")
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
except: pass
if sel.is_element_present("//a[contains(text(),video3title)]")==True:
print "Found video \""+video3title+"\" in the queue on the last page - OK"
else:
mclib.AppendErrorMessage(self,sel,"Could not find video "+video3title+" on the last page of the queue")
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_AddSearchFeed_262(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_AddSearchFeed_262(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
# Add search feed with sorting by date
searchterm = "Croatia"
if sources.SourceLocation(self,sel,searchterm)!=[0,0]:
sources.DeleteSource(self,sel,searchterm)
sources.AddSearchFeed(self,sel,searchterm,0)
# Add search feed with sorting by relevance
searchterm = "Dalmatia"
if sources.SourceLocation(self,sel,searchterm)!=[0,0]:
sources.DeleteSource(self,sel,searchterm)
sources.AddSearchFeed(self,sel,searchterm,1)
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_SortSources_266(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# Auxiliary subroutine which retrieves the list of values for the selected parameter
# for the purpose of verifying the sorting
def GetSourceParameterList(self,sel,parameter):
if parameter=="Name": col="2]/span"
elif parameter=="Type": col="5]"
elif parameter=="AutoApprove": col="6]"
else:
print "Wrong value of list parameter passed to function"
return ['-1']
page = 1 # page number
sourceList=['']
no = 1
baseURL = sel.get_location()
# print baseURL
while sel.is_text_present("Page not found")==False:
row = 0 # row number
tempSource=""
# Only one source on the page? If not, go ahead
sourceTableCell="//div[@id='labels']/form[2]/table/tbody/tr/td["+col # no row number in the link
if sel.is_element_present(sourceTableCell):
if parameter=="Name" or parameter=="Type":
tempSource = sel.get_text(sourceTableCell)
else:
if sel.is_visible(sourceTableCell+"/a[1]")==True: tempSource = "On"
elif sel.is_visible(sourceTableCell+"/a[2]")==True: tempSource = "Off"
else: tempSource = ""
sourceList.append(tempSource)
no = no + 1
# Name of the first source in the list - for multiple rows on the page
row = 2
sourceTableCell="//div[@id='labels']/form[2]/table/tbody/tr["+str(row)+"]/td["+col
while sel.is_element_present(sourceTableCell):
if parameter=="Name" or parameter=="Type":
tempSource = sel.get_text(sourceTableCell)
else:
if sel.is_visible(sourceTableCell+"/a[1]")==True: tempSource = "On"
elif sel.is_visible(sourceTableCell+"/a[2]")==True: tempSource = "Off"
else: tempSource = ""
row=row+1
sourceList.append(tempSource)
no = no + 1
sourceTableCell="//div[@id='labels']/form[2]/table/tbody/tr["+str(row)+"]/td["+col
# End of page reached?
page = page+1
try:
sel.open(baseURL+"&page="+str(page))
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
except: pass
# If list not empty, remove the blank item
if no>1:
sourceList.remove("")
return sourceList
# The user actions executed in the test scenario
def test_SortSources_266(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
print ""
sources.SortSources(self,sel,"Name","Asc")
resultList = TestCase_SortSources_266.GetSourceParameterList(self,sel,"Name")
print resultList
sortedList = sorted(resultList,key=unicode.lower)
if resultList==sortedList:
print "Sorting checked - CORRECT"
else:
mclib.AppendErrorMessage(self,sel,"Sorting by NAME ASCENDING was incorrect")
print ""
sources.SortSources(self,sel,"Name","Desc")
resultList = TestCase_SortSources_266.GetSourceParameterList(self,sel,"Name")
print resultList
sortedList = sorted(resultList,key=unicode.lower,reverse=True)
if resultList==sortedList:
print "Sorting checked - CORRECT"
else:
mclib.AppendErrorMessage(self,sel,"Sorting by NAME DESCENDING was incorrect")
print ""
sources.SortSources(self,sel,"Type","Asc")
resultList = TestCase_SortSources_266.GetSourceParameterList(self,sel,"Type")
print resultList
sortedList = sorted(resultList,key=unicode.lower)
if resultList==sortedList:
print "Sorting checked - CORRECT"
else:
mclib.AppendErrorMessage(self,sel,"Sorting by TYPE ASCENDING was incorrect")
print ""
sources.SortSources(self,sel,"Type","Desc")
resultList = TestCase_SortSources_266.GetSourceParameterList(self,sel,"Type")
print resultList
sortedList = sorted(resultList,key=unicode.lower,reverse=True)
if resultList==sortedList:
print "Sorting checked - CORRECT"
else:
mclib.AppendErrorMessage(self,sel,"Sorting by TYPE DESCENDING was incorrect")
print ""
sources.SortSources(self,sel,"AutoApprove","Asc")
resultList = TestCase_SortSources_266.GetSourceParameterList(self,sel,"AutoApprove")
print resultList
sortedList = sorted(resultList,key=str.lower)
if resultList==sortedList:
print "Sorting checked - CORRECT"
else:
mclib.AppendErrorMessage(self,sel,"Sorting by AUTOAPPROVE ASCENDING was incorrect")
print ""
sources.SortSources(self,sel,"AutoApprove","Desc")
resultList = TestCase_SortSources_266.GetSourceParameterList(self,sel,"AutoApprove")
print resultList
sortedList = sorted(resultList,key=str.lower,reverse=True)
if resultList==sortedList:
print "Sorting checked - CORRECT"
else:
mclib.AppendErrorMessage(self,sel,"Sorting by AUTOAPPROVE DESCENDING was incorrect")
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_SearchInSources_267(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_SearchInSources_267(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
# Search by query in particular user and category
print "Search 1"
sources.SearchInSources(self,sel,"art","Selene Test-Admin","Attenborough")
print ""
# Search in all feeds by query
print "Search 2"
sources.SearchInSources(self,sel,"","","Yahoo")
print ""
# Search in feeds by category
print "Search 3"
sources.SearchInSources(self,sel,"film","","")
print ""
# Search in feeds by user
print "Search 4"
sources.SearchInSources(self,sel,"","selene test-user","")
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)
class TestCase_FilterSources_268(unittest.TestCase):
# Open the desired browser and set up the test
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", testvars.MCTestVariables["Port"], testvars.MCTestVariables["Browser"], testvars.MCTestVariables["TestSite"])
self.selenium.start()
# The user actions executed in the test scenario
def test_FilterSources_268(self):
sel = self.selenium
loginlogout.LogInAsAdmin(self,sel)
print "Show All sources"
sources.FilterSources(self,sel,"All")
print ""
print "Show Video Site Users only"
sources.FilterSources(self,sel,"Users")
print ""
print "Show Video Site Searches only"
sources.FilterSources(self,sel,"Searches")
print ""
print "Show RSS Feeds only"
sources.FilterSources(self,sel,"Feeds")
# Close the browser, log errors, perform cleanup
def tearDown(self):
self.selenium.stop()
# the command on the previous line should close the browser
self.assertEqual([], self.verificationErrors)