-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtestcases_users.py
600 lines (564 loc) · 27.3 KB
/
testcases_users.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
#=======================================================================
#
# USERS TESTS
#
#=======================================================================
#
# Includes the following test cases:
# 1. TestCase_AddNewAdmin_271
# 2. TestCase_AddNewUser_270
# 3. TestCase_EditUser_291
# 4. TestCase_DeleteUser_272
# 5. TestCase_CreateNewUserUsernameAndPassword_280
# 6. TestCase_CreateNewUserWithoutUsername_274
# 7. TestCase_CreateNewUserWithoutPassword_273
# 8. TestCase_UsernameDoesntAcceptMax1Chars_283
# 9. TestCase_NewUserUsernameMaxMax2MinChars_281
# 10. TestCase_EditUserProfile_539
# 11. TestCase_ViewProfile_540
# 12. TestCase_ViewUser_290
from selenium import selenium
import unittest, time, re, os, loginlogout, testvars, users, mclib, sitesettings
# ----------------------------------------------------------------------
class TestCase_AddNewAdmin_271(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_AddNewAdmin_271(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# This is information for add user edit fields
username = "newTestAdmin"
password = "123456"
email = "admin1@test.com"
role = "1" # "1"-Admin, "0"-User
# This function returns the row number for the desired username
# on /users page.
# Returns row number if the us username is found and 0 otherwise.
if users.UserRow(self,sel,username)!=0:
print "Duplicate user found. Deleting it..."
# This function delete user
users.DeleteUser(self,sel,username,0)
# This function add user
users.AddUser(self,sel,username,email,role,password)
print "Logging out..."
# This function log out
loginlogout.LogOut(self,sel)
print "Logging in as user: "+username
# This function login as just created user
loginlogout.LogInBasic(self,sel,username,password)
# Check user logon as admin
if sel.is_element_present(testvars.MCTestVariables["ViewAdmin"])==True or sel.is_element_present(testvars.MCTestVariables["ViewAdminBlueTheme"])==True:
print "Logged as Admin"
else:
mclib.AppendErrorMessage(self,sel,"User "+username+" does not have Administrator privileges")
# 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_AddNewUser_270(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_AddNewUser_270(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# This is information for add user edit fields
username = "newTestUser"
password = "123456"
email = "user1@test.com"
# To select User role type "0"
# To select Admin role type "1"
role = "0"
# This function returns the row number for the desired username
# on /users page.
# Returns row number if the us username is found and 0 otherwise.
if users.UserRow(self,sel,username)!=0:
print "Duplicate user found. Deleting it..."
# This function delete user
users.DeleteUser(self,sel,username,0)
# This function add user
users.AddUser(self,sel,username,email,role,password)
print "Logging out..."
# This function log out
loginlogout.LogOut(self,sel)
print "Logging in as user: "+username
# This function login as just created user
loginlogout.LogInBasic(self,sel,username,password)
# Check user logon as user
if sel.is_element_present(testvars.MCTestVariables["ViewAdmin"])==True:
print "Log in as User failed"
else:
print "Logged as 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_EditUser_291(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_EditUser_291(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# This is information for add user edit fields
username = "newTestUser2"
newusername = "modifiedTestUser2"
password = "123456"
name = "John Doe"
email = "john.doe@test.com"
# To select User role type "0"
# To select Admin role type "1"
role = "1"
location = "Greenland"
website = "www.google.ca"
logo = "photo3.jpg"
description = "Hello"
# Check if user appeared
if users.UserRow(self,sel,username)!=0:
print "Found user "+username+". Deleting it..."
users.DeleteUser(self,sel,username,0)
if newusername!="":
if users.UserRow(self,sel,newusername)!=0:
print "Found user "+newusername+". Deleting it..."
users.DeleteUser(self,sel,newusername,0)
# Add user <username>
users.AddUser(self,sel,username,email,role,password)
# Now modify this user account
users.EditUser(self,sel,username,newusername,name,email,role,location,website,description,logo,password)
# Attempt to login to the system with the modified account
if newusername!="":
userlogin = newusername
else:
userlogin = username
if users.UserRow(self,sel,userlogin)!=0:
print "User "+username+" successfully edited"
# Log out
loginlogout.LogOut(self,sel)
print "Logging in as user: "+userlogin+"..."
# Log in as just created user
loginlogout.LogInBasic(self,sel,userlogin,password)
# 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_DeleteUser_272(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_DeleteUser_272(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# Adding a new user withe the following parameters
username = "newTestUser3"
password = "123456"
email = "user3@test.com"
# To select User role type "0"
# To select Admin role type "1"
role = "0"
# This function add user
users.AddUser(self,sel,username,email,role,password)
# Now deleting the recently created user
users.DeleteUser(self,sel,username,0)
# 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_CreateNewUserUsernameAndPassword_280(unittest.TestCase):
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_CreateNewUserUsernameAndPassword_280(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# This is information for add user edit fields
username = "newTestUser3"
password = "123456"
email = ""
# To select User role type "0"
# To select Admin role type "1"
role = ""
# This function returns the row number for the desired username
# on /users page.
# Returns row number if the us username is found and 0 otherwise.
if users.UserRow(self,sel,username)!=0:
print "Duplicate user found. Deleting it..."
# This function delete user
users.DeleteUser(self,sel,username,0)
print "User deleted: "+username
# This function add user
users.AddUser(self,sel,username,email,role,password)
print "Logging out..."
# This function log out
loginlogout.LogOut(self,sel)
print "Logging in as user: "+username
# This function login as just created user
loginlogout.LogInBasic(self,sel,username,password)
# 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_CreateNewUserWithoutUsername_274(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_CreateNewUserWithoutUsername_274(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# This is information for add user edit fields
username = ""
password = "123456"
email = "test5@test.com"
role = "0" # "0" - User, "1" - Admin
website = "www.google.com"
# This function add user
users.FillAddUserPopUp(self,sel,username,email,role,password)
# Check if user appeared
if users.UserRow(self,sel,username)!=0:
mclib.AppendErrorMessage(self,sel,"Unexpectedly could create a user with username left blank. TEST FAILED")
else:
print "Could not create a user with Username (mandatory field) left blank. TEST PASSED"
# 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_CreateNewUserWithoutPassword_273(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_CreateNewUserWithoutPassword_273(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# This is information for add user edit fields
username = "newTestUser4"
password = ""
email = "test6@test.com"
role = "0" # "1" - Admin, "0" - User
website = "www.google.com"
# This function returns the row number for the desired username
# on /users page.
# Returns row number if the us username is found and 0 otherwise.
if users.UserRowInCompleteListOfAuthors(self,sel,username)!=0:
print "Duplicate user found. Deleting it..."
# This function delete user
users.DeleteUser(self,sel,username,1)
print "User deleted: "+username
# This function add user
users.FillAddUserPopUp(self,sel,username,email,role,password)
# Check if user appeared in the list
print "Checking if the user was successfully created..."
if users.UserRowInCompleteListOfAuthors(self,sel,username)==0:
mclib.AppendErrorMessage(self,sel,"Could not create a user with PASSWORD (optional field) blank")
else:
print "OK"
# Attempt to log in with the new account
loginlogout.LogOut(self,sel)
sel.open(testvars.MCTestVariables["LoginPage"])
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
time.sleep(1)
sel.click("id_username")
sel.type("id_username", username)
time.sleep(1)
sel.click("css=input.button[type='submit']")
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
if sel.is_text_present("This field is required.") and sel.is_element_present(testvars.MCTestVariables["LogoutFootlink"])==False:
print "Could not login as a 'non-human' (passwordless) user. TEST PASSED"
else:
mclib.AppendErrorMessage(self,sel,"Managed to login as a passwordless user "+username+". TEST FAILED")
# 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_UsernameDoesntAcceptMax1Chars_283(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_UsernameDoesntAcceptMax1Chars_283(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# This is information for add user edit fields
username = "1234567890123456789012345678901"
password = "123456"
email = "oversizeuser@test.com"
role = "0" # "1"-Admin, "0"-User
if users.UserRow(self,sel,username)!=0:
print "Duplicate user found. Deleting it..."
# This function delete user
users.DeleteUser(self,sel,username,0)
print "User deleted: "+username
# This function add user
# users.FillAddUserPopUp(self,sel,username,email,role,password)
print "Adding a new username "+username
sel.open(testvars.MCTestVariables["UserPage"])
buttonAddUser = "//div[@id='label_sidebar']/a/span"
if sel.is_element_present(buttonAddUser)==True:
sel.click(buttonAddUser)
time.sleep(2)
if sel.is_visible("//div[@id='label_sidebar']")==False:
mclib.AppendErrorMessage(self,sel,"Add user pop-up does not display")
else:
# Enter username
if sel.is_element_present("id_username")==True:
sel.click("id_username")
sel.type("id_username",username)
typedUsername = sel.get_value("id_username")
if typedUsername == username:
mclib.AppendErrorMessage(self,sel,"Username edit fields accepts strings longer than 30 characters.")
elif typedUsername == username[:-1]:
print "Username edit field trims all input to 30 permitted characters."
print "Attempted to type: "+username
print "-- Actually typed: "+typedUsername
else:
print "Unexpected string found in Username edit field"
print "Expected string: "+username
print "- Actual string: "+typedUsername
else:
mclib.AppendErrorMessage(self,sel,"Edit field for user's username not found")
# Enter user's email address
if sel.is_element_present("id_email")==True:
sel.click("id_email")
sel.type("id_email",email)
else:
mclib.AppendErrorMessage(self,sel,"Edit field for user's email not found")
# Enter user's role
if sel.is_element_present("id_role_0")==True:
if role=="":
sel.click("id_role_0")
else:
sel.click("id_role_"+role)
else:
mclib.AppendErrorMessage(self,sel,"Radio buttons for user's role not found")
# Enter user's password
if sel.is_element_present("id_password_f")==True:
sel.click("id_password_f")
sel.type("id_password_f",password)
else:
mclib.AppendErrorMessage(self,sel,"Edit field for user's password not found")
# Enter user's password confirmation
if sel.is_element_present("id_password_f2")==True:
sel.click("id_password_f2")
sel.type("id_password_f2",password)
else:
mclib.AppendErrorMessage(self,sel,"Edit field for user's password confirmation not found")
# Save changes
buttonSubmit = "submit"
if sel.is_element_present(buttonSubmit)==True:
sel.click("submit")
else:
mclib.AppendErrorMessage(self,sel,"Save button on Add User pop-up not found")
sel.wait_for_page_to_load(testvars.MCTestVariables["TimeOut"])
if users.UserRow(self,sel,username)!=0:
mclib.AppendErrorMessage(self,sel,"User with too long username found in the list: "+username+". TEST FAILED")
else:
print "Could not add a user with an excessively long username. TEST PASSED"
# 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_NewUserUsernameMaxMax2MinChars_281(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_NewUserUsernameMaxMax2MinChars_281(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# This is information for add user edit fields
username = "123456789012345678901234567890"
password = "123456"
email = "testuser@test.com"
# To select User role type "0"
# To select Admin role type "1"
role = "0"
# This function returns the row number for the desired username
# on /users page.
# Returns row number if the us username is found and 0 otherwise.
if users.UserRow(self,sel,username)!=0:
print "Duplicate user found. Deleting it..."
# This function delete user
users.DeleteUser(self,sel,username,0)
print "User deleted: "+username
# This function add user
users.AddUser(self,sel,username,email,role,password)
print "Logging out..."
# This function check and log out
if users.UserRow(self,sel,username)!=0:
loginlogout.LogOut(self,sel)
else:
users.AddUser(self,sel,username,email,role,password)
print "Logging in as user: "+username
# This function login as just created user
loginlogout.LogInBasic(self,sel,username,password)
sel.click("link=Logout "+username)
sel.wait_for_page_to_load("10000")
##### Creating user with 15 chars in the 'Username' field #####
loginlogout.LogInAsAdmin(self,sel)
username = "123456789012345"
if users.UserRow(self,sel,username)!=0:
print "Duplicate user found. Deleting it..."
users.DeleteUser(self,sel,username,0)
print "User deleted: "+username
users.AddUser(self,sel,username,email,role,password)
print "Logging out..."
if users.UserRow(self,sel,username)!=0:
loginlogout.LogOut(self,sel)
else:
users.AddUser(self,sel,username,email,role,password)
print "Logging in as user: "+username
loginlogout.LogInBasic(self,sel,username,password)
sel.click("link=Logout "+username)
sel.wait_for_page_to_load("10000")
##### Creating user with 1 chars in the 'Username' field #####
loginlogout.LogInAsAdmin(self,sel)
username = "1"
if users.UserRow(self,sel,username)!=0:
print "Duplicate user found. Deleting it..."
users.DeleteUser(self,sel,username,0)
print "User deleted: "+username
users.AddUser(self,sel,username,email,role,password)
print "Logging out..."
if users.UserRow(self,sel,username)!=0:
loginlogout.LogOut(self,sel)
else:
users.AddUser(self,sel,username,email,role,password)
print "Logging in as user: "+username
loginlogout.LogInBasic(self,sel,username,password)
sel.click("link=Logout "+username)
sel.wait_for_page_to_load("10000")
# 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_EditUserProfile_539(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_EditUserProfile_539(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# Check that user newTestUser exists. If not, create a new user
username = "newTestUser"
password = "123456"
if users.UserRow(self,sel,username)==0:
users.AddUser(self,sel,username,"","0",password)
# New settings for the user profile
name = "NewUser"
newusername = ""
password = "123456"
location = "North America"
website = "http://www.google.ca/"
description = "Miro Community QA"
photo = "photo5.jpg"
email = "user2@test.com"
print "Log in as "+username
loginlogout.LogInBasic(self,sel,username,password)
print "Editing the profile for "+username
users.EditUserProfile(self,sel,name,newusername,email,location,website,os.path.join(testvars.MCTestVariables["GraphicFilesDirectory"],photo),description)
users.ViewUserCheck(self,sel,username,name,location,website,description,photo)
# 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_ViewProfile_540(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_ViewProfile_540(self):
sel = self.selenium
# The profile to be viewed belongs to seleniumTestUser
username = testvars.MCTestVariables["UserLogin"]
name = testvars.MCTestVariables["UserName"]
description = "test user for selenium auto testing. Please don't delete."
location = "PCF"
website = "http://www.seleniumhq.org/"
image = "nest-test.jpg"
loginlogout.LogInAsUser(self,sel)
print "Checking profile"
users.ViewProfile(self,sel)
users.ViewUserCheck(self,sel,username,name,location,website,description,image)
loginlogout.LogOut(self,sel)
# 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_ViewUser_290(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_ViewUser_290(self):
sel = self.selenium
# Log in as Admin
loginlogout.LogInAsAdmin(self,sel)
# Viewing seleniumTestUser from /admin/users page
username = testvars.MCTestVariables["UserLogin"]
password = testvars.MCTestVariables["UserPassword"]
name = testvars.MCTestVariables["UserName"]
description = "test user for selenium auto testing. Please don't delete."
location = "PCF"
website = "http://www.seleniumhq.org/"
image = "nest-test.jpg"
role = "0" # "1" - Admin, "0" - User
if users.UserRow(self,sel,username)!=0:
users.ViewUser(self,sel,username,name,location,website,description,image)
else:
mclib.AppendErrorMessage(self,sel,"User "+username+" not found in the list")
# 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)