Changeset 4425


Ignore:
Timestamp:
23 Jul 2009, 21:50:05 (15 years ago)
Author:
uli
Message:

Complete functional browser tests for faculties.

File:
1 edited

Legend:

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

    r4414 r4425  
    108108  ...
    109109
     110We can 'visit' each faculty by clicking on the appropriate link:
     111
     112  >>> browser.getLink('TF').click()
     113  >>> print browser.contents
     114  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     115  ...Name of Faculty...
     116  ...TestFac...
     117  ...
     118
     119
     120Modifying faculties
     121-------------------
     122
     123A faculty can directly be reached by its code:
     124
     125  >>> browser.open('http://localhost/myuniversity/faculties/TF')
     126
     127We can change the settings for a faculty by clicking on the
     128provided 'settings' link:
     129
     130  >>> browser.getLink('Settings').click()
     131
     132Let's set a new title and save the form:
     133
     134  >>> browser.getControl(name='form.title').value = "My test faculty"
     135  >>> browser.getControl(name='form.actions.save').click()
     136
     137Clicking 'Save' we will stay on the settings form. So we can change
     138the department again. This time we will return to the overview page
     139afterwards:
     140
     141  >>> browser.getControl(name='form.title').value = "My renamed faculty"
     142  >>> ctrl = browser.getControl("Save and return")
     143  >>> ctrl.click()
     144
     145If we go to the settings page and click ``Cancel`` nothing will be
     146changed:
     147
     148  >>> browser.getLink('Settings').click()
     149  >>> browser.getControl(name='form.title').value = "Blah"
     150  >>> browser.getControl('Cancel').click()
     151
     152Our faculty was indeed renamed to ``My renamed faculty`` and not to
     153``Blah``:
     154
     155  >>> browser.open('http://localhost/myuniversity/faculties')
     156  >>> print browser.contents
     157  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     158  ...<h2>Registered faculties:</h2>
     159  ...<td><a href="TF">TF</a></td><td>Faculty of My renamed faculty</td>
     160  ...
     161
    110162
    111163Departments
     
    137189
    138190  >>> browser.getControl('Add department').click()
     191
     192If we try to register a department under the same code twice we will
     193get an error:
     194
     195  >>> browser.open('http://localhost/myuniversity/faculties/TF/add')
     196  >>> ctrl = browser.getControl(name='form.title')
     197  >>> ctrl.value = 'Another TestDept with same code'
     198  >>> browser.getControl(name='form.code').value = 'TD'
     199  >>> browser.getControl('Add department').click()
     200  >>> print browser.contents
     201  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     202  ...<div>The name chosen already exists in the database</div>
     203  ...
    139204
    140205We can view a department by browsing a URL like this:
Note: See TracChangeset for help on using the changeset viewer.