Changeset 4425
- Timestamp:
- 23 Jul 2009, 21:50:05 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/browser.txt
r4414 r4425 108 108 ... 109 109 110 We 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 120 Modifying faculties 121 ------------------- 122 123 A faculty can directly be reached by its code: 124 125 >>> browser.open('http://localhost/myuniversity/faculties/TF') 126 127 We can change the settings for a faculty by clicking on the 128 provided 'settings' link: 129 130 >>> browser.getLink('Settings').click() 131 132 Let'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 137 Clicking 'Save' we will stay on the settings form. So we can change 138 the department again. This time we will return to the overview page 139 afterwards: 140 141 >>> browser.getControl(name='form.title').value = "My renamed faculty" 142 >>> ctrl = browser.getControl("Save and return") 143 >>> ctrl.click() 144 145 If we go to the settings page and click ``Cancel`` nothing will be 146 changed: 147 148 >>> browser.getLink('Settings').click() 149 >>> browser.getControl(name='form.title').value = "Blah" 150 >>> browser.getControl('Cancel').click() 151 152 Our 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 110 162 111 163 Departments … … 137 189 138 190 >>> browser.getControl('Add department').click() 191 192 If we try to register a department under the same code twice we will 193 get 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 ... 139 204 140 205 We can view a department by browsing a URL like this:
Note: See TracChangeset for help on using the changeset viewer.