Ignore:
Timestamp:
14 Aug 2011, 13:42:13 (13 years ago)
Author:
Henrik Bettermann
Message:

Further increase test coverage.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/browser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/batchprocessing.txt

    r6510 r6608  
    543543
    544544
     545Log Files
     546=========
     547
     548    >>> browser.open('http://localhost/app/datacenter/logs')
     549    >>> 'datacenter.log' in browser.contents
     550    True
     551
     552
    545553Clean up:
    546554
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt

    r6607 r6608  
    148148  ...
    149149
     150Users can't be added twice:
     151
     152  >>> browser.open('http://localhost/myuniversity/users/add')
     153  >>> browser.getControl(name="form.name").value = 'bob'
     154  >>> browser.getControl(name="form.password").value = 'secret'
     155  >>> browser.getControl("Add user").click()
     156  >>> 'The userid chosen already exists' in browser.contents
     157  True
     158
     159Users can be deleted:
     160
     161  >>> browser.open('http://localhost/myuniversity/users')
     162  >>> browser.getControl("delete").click()
     163  >>> 'User bob successfully deleted' in browser.contents
     164  True
     165
    150166
    151167Contact Form
     
    261277  ...
    262278
     279We can grant local roles:
     280
     281  >>> root['myuniversity']['users'].addUser('bob', 'secret',title='Bob',
     282  ...                               description='A sample user')
     283  >>> browser.open('http://localhost/myuniversity/faculties/TF/manage')
     284  >>> browser.getControl(name="user").value = ['bob']
     285  >>> browser.getControl(name="local_role").value = ['waeup.local.DepartmentOfficer']
     286  >>> browser.getControl("Add local role").click()
     287  >>> print browser.contents
     288  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     289  ...<td>bob</td>
     290  ...
     291
     292On the portal user page the new local role is displayed:
     293
     294  >>> browser.getLink("Portal Users").click()
     295  >>> print browser.contents
     296  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     297  ...<td>Department Officer:...
     298  ...
     299
     300The local role can be removed again:
     301
     302  >>> browser.open('http://localhost/myuniversity/faculties/TF/manage')
     303  >>> ctrl = browser.getControl(name='role_id')
     304  >>> browser.getControl("Remove selected local roles").click()
     305  >>> print browser.contents
     306  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     307  ...No local role selected...
     308  ...
     309
     310  >>> browser.open('http://localhost/myuniversity/faculties/TF/manage')
     311  >>> ctrl = browser.getControl(name='role_id')
     312  >>> ctrl.getControl(value='bob|waeup.local.DepartmentOfficer').selected = True
     313  >>> browser.getControl("Remove selected local roles").click()
     314  >>> print browser.contents
     315  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     316  ...Successfully removed:...
     317  ...
     318
     319Deleting faculties
     320------------------
     321
     322  >>> browser.open('http://localhost/myuniversity/faculties/manage')
     323  >>> browser.getControl('Cancel').click()
     324  >>> print browser.url
     325  http://localhost/myuniversity/faculties
     326  >>> browser.getLink('Manage academic section').click()
     327  >>> browser.getControl('Add faculty').click()
     328  >>> ctrl = browser.getControl(name='form.title')
     329  >>> ctrl.value = 'Second Faculty'
     330  >>> browser.getControl(name='form.code').value = 'TF2'
     331  >>> browser.getControl('Add faculty').click()
     332  >>> browser.open('http://localhost/myuniversity/faculties/manage')
     333  >>> browser.getControl("Remove selected", index=0).click()
     334  >>> 'No faculty selected' in browser.contents
     335  True
     336  >>> browser.open('http://localhost/myuniversity/faculties/manage')
     337  >>> ctrl = browser.getControl(name='val_id')
     338  >>> ctrl.getControl(value='TF2').selected = True
     339  >>> browser.getControl("Remove selected", index=0).click()
     340  >>> print browser.contents
     341  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     342  ...Successfully removed:...
     343  ...
    263344
    264345Departments
     
    352433  ...
    353434
     435Deleting departments
     436--------------------
     437
     438  >>> browser.open('http://localhost/myuniversity/faculties/TF/manage')
     439  >>> browser.getControl('Cancel', index=0).click()
     440  >>> print browser.url
     441  http://localhost/myuniversity/faculties/TF
     442  >>> browser.getLink('Manage faculty').click()
     443  >>> browser.getControl('Add department').click()
     444  >>> ctrl = browser.getControl(name='form.title')
     445  >>> ctrl.value = 'Second Department'
     446  >>> browser.getControl(name='form.code').value = 'TD2'
     447  >>> browser.getControl('Add department').click()
     448  >>> browser.open('http://localhost/myuniversity/faculties/TF/manage')
     449  >>> browser.getControl("Remove selected", index=0).click()
     450  >>> 'No department selected' in browser.contents
     451  True
     452  >>> browser.open('http://localhost/myuniversity/faculties/TF/manage')
     453  >>> ctrl = browser.getControl(name='val_id')
     454  >>> ctrl.getControl(value='TD2').selected = True
     455  >>> browser.getControl("Remove selected", index=0).click()
     456  >>> print browser.contents
     457  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     458  ...Successfully removed:...
     459  ...
     460
    354461
    355462Courses
     
    481588  ...
    482589
     590Searching courses
     591-----------------
     592
     593  >>> browser.open('http://localhost/myuniversity/faculties/search')
     594  >>> browser.getControl(name='query').value = "My renamed course"
     595  >>> browser.getControl('Search').click()
     596  >>> print browser.contents
     597  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     598  ...faculties/TF/TD/courses/COURSE1">COURSE1</a>
     599  ...
     600
     601  >>> browser.getControl(name='query').value = "Nonsense"
     602  >>> browser.getControl('Search').click()
     603  >>> 'Search Results' in browser.contents
     604  False
    483605
    484606Deleting courses
Note: See TracChangeset for help on using the changeset viewer.