Changeset 6626 for main/waeup.sirp/trunk/src/waeup/sirp/students/tests
- Timestamp:
- 25 Aug 2011, 12:01:37 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students/tests
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6622 r6626 73 73 self.container_path = 'http://localhost/app/students' 74 74 self.manage_container_path = self.container_path + '/@@manage' 75 self.add_student_path = self.container_path + '/ @@add'75 self.add_student_path = self.container_path + '/addstudent' 76 76 77 77 # Populate university … … 121 121 return 122 122 123 def test_add_s tudents(self):124 # Managers can add s tudents123 def test_add_search_delete_students(self): 124 # Managers can add search and remove students 125 125 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 126 self.add_student_path = self.container_path + '/addstudent' 127 self.container_manage_path = self.container_path + '/@@manage' 128 self.browser.open(self.container_manage_path) 129 self.browser.getControl("Add student").click() 126 self.browser.open(self.manage_container_path) 127 self.browser.getLink("Add student").click() 130 128 self.assertEqual(self.browser.headers['Status'], '200 Ok') 131 129 self.assertEqual(self.browser.url, self.add_student_path) … … 133 131 self.browser.getControl(name="form.name").value = 'Bob Tester' 134 132 self.browser.getControl("Create student record").click() 133 self.assertTrue('Student record created' in self.browser.contents) 134 135 self.browser.open(self.container_path) 136 self.browser.getControl("Search").click() 137 self.assertTrue('Empty search string' in self.browser.contents) 138 self.browser.getControl(name="searchtype").value = ['student_id'] 139 self.browser.getControl(name="searchterm").value = 'A123456' 140 self.browser.getControl("Search").click() 141 self.assertTrue('Bob Tester' in self.browser.contents) 142 # The old searchterm will be used again 143 self.browser.getControl("Search").click() 144 self.assertTrue('Bob Tester' in self.browser.contents) 145 146 self.browser.open(self.manage_container_path) 147 self.browser.getControl("Search").click() 148 self.assertTrue('Empty search string' in self.browser.contents) 149 self.browser.getControl(name="searchtype").value = ['name'] 150 self.browser.getControl(name="searchterm").value = 'Bob Tester' 151 self.browser.getControl("Search").click() 152 self.assertTrue('A123456' in self.browser.contents) 153 ctrl = self.browser.getControl(name='entries') 154 ctrl.getControl(value='A123456').selected = True 155 self.browser.getControl("Remove selected", index=0).click() 156 self.assertTrue('Successfully removed' in self.browser.contents) 157 self.browser.getControl(name="searchtype").value = ['student_id'] 158 self.browser.getControl(name="searchterm").value = 'A123456' 159 self.browser.getControl("Search").click() 160 self.assertTrue('No student found' in self.browser.contents) 161 162 self.browser.open(self.container_path) 163 self.browser.getControl(name="searchtype").value = ['student_id'] 164 self.browser.getControl(name="searchterm").value = 'A123456' 165 self.browser.getControl("Search").click() 166 self.assertTrue('No student found' in self.browser.contents) 167
Note: See TracChangeset for help on using the changeset viewer.