From 60471443578385f156d76bc76bbe0dec32b3021c Mon Sep 17 00:00:00 2001 From: Mike McGrath Date: Thu, 1 Oct 2009 13:50:08 -0500 Subject: [PATCH] further updates to fas --- scripts/site-tests/fas.py | 48 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/scripts/site-tests/fas.py b/scripts/site-tests/fas.py index 973aaa3..0ef7efc 100644 --- a/scripts/site-tests/fas.py +++ b/scripts/site-tests/fas.py @@ -25,7 +25,7 @@ parser.add_option('-p', '--password', help = 'Password to connect with (Will prompt if not specified') parser.add_option('-b', '--baseurl', dest = 'baseurl', - default = 'https://admin.fedoraproject.org/accounts/', + default = 'https://admin.fedoraproject.org/accounts/login', metavar = 'baseurl', help = 'Url to fas (default: %default)') parser.add_option('-d', '--debug', @@ -46,7 +46,7 @@ del getpass print print -print "Starting tests on MirrorManager" +print "Starting tests on FAS" print " Note: Results shown in terms of test success. Anything not OK should be looked at" print @@ -77,3 +77,47 @@ else: print OK headers.check(r._headers, 3000000) +print 'Testing Links:' +link_list = ['Home', 'My Account', 'New Group', 'Group List', 'Join a Group', 'About'] +for link in link_list: + print '\t %s:' % link, + try: + r = b.follow_link(text_regex=r'^%s$' % link) + except LinkNotFoundError: + print FAILED + print OK + headers.check(r._headers, 3000000) + +print 'Editing Account:' +r = b.follow_link(text_regex=r'^My Account$') +r = b.follow_link(text_regex=r'edit') +headers.check(r._headers, 3000000) +b.select_form(nr=1) +print '\tHuman Name: %s' % b['human_name'] +print '\temail: %s' % b['email'] +print '\tTelephone: %s' % b['telephone'] +print '\tComments: %s' % b['comments'] +old_comments = b['comments'] +print '\tChanging Comments Field', +b['comments'] = 'Changing for FAS test by %s' % username +r = b.submit() +print OK +headers.check(r._headers, 4000000) +r = b.follow_link(text_regex=r'edit') +headers.check(r._headers, 3000000) +print '\tVerifying comments field:', +b.select_form(nr=1) +if b['comments'] == 'Changing for FAS test by %s' % username: + print OK +else: + print '%s - Old comment was: %s' % (FAILED - old_comments) +r = b.submit() +headers.check(r._headers, 3000000) +print '\tResetting comments field to old value:', +r = b.follow_link(text_regex=r'edit') +b.select_form(nr=1) +b['comments'] = old_comments +r = b.submit() +print OK +headers.check(r._headers, 4000000) +print "\t**This should have generated an email to you. Please verify that" \ No newline at end of file