Changeset 4382 for waeup/branches


Ignore:
Timestamp:
27 Jun 2009, 16:19:18 (16 years ago)
Author:
uli
Message:

Add functional tests for departments (100% coverage now).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/browser.txt

    r4374 r4382  
    108108  ...
    109109
     110
    110111Departments
    111112===========
     113
     114Adding departments
     115------------------
    112116
    113117Departments are stored in :class:`IFaculty` instances with their code
     
    146150  ...<a href="http://localhost/myuniversity/faculties/TF/TD">TestDept</a>
    147151  ...
     152
     153
     154Modifying departments
     155---------------------
     156
     157We can change the settings for a department by clicking on the
     158provided 'settings' link:
     159
     160  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD')
     161  >>> browser.getLink('Settings').click()
     162
     163Let's set a new title and save the form:
     164
     165  >>> browser.getControl(name='form.title').value = "My test dept"
     166  >>> browser.getControl(name='form.actions.save').click()
     167
     168Clicking 'Save' we will stay on the settings form. So we can change
     169the department again. This time we will return to the overview page
     170afterwards:
     171
     172  >>> browser.getControl(name='form.title').value = "My renamed dept"
     173  >>> ctrl = browser.getControl("Save and return")
     174  >>> ctrl.click()
     175
     176If we go to the settings page and click ``Cancel`` nothing will be
     177changed:
     178
     179  >>> browser.getLink('Settings').click()
     180  >>> browser.getControl(name='form.title').value = "Blah"
     181  >>> browser.getControl('Cancel').click()
     182
     183Our department was indeed renamed to ``My renamed dept`` and not to
     184``Blah``:
     185
     186  >>> browser.open('http://localhost/myuniversity/faculties/TF')
     187  >>> print browser.contents
     188  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     189  ...<h2>Registered Departments:</h2>
     190  ...<a href="http://localhost/myuniversity/faculties/TF/TD">My renamed dept</a>
     191  ...
     192
    148193
    149194Data Center
Note: See TracChangeset for help on using the changeset viewer.