~aelkner/schooltool.intervention/flourish

« back to all changes in this revision

Viewing changes to src/schooltool/intervention/browser/ftests/intervention_dashboard.txt

merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
 
100
100
    >>> principal.getLink('Intervention').click()
101
101
    >>> principal.getControl(name='SEARCH_STUDENT_BUTTON').click()
102
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
102
    >>> principal.printQuery("id('content-body')//table/tbody//a")
103
103
    <a href="http://localhost/schooltool.interventions/2005-2006/manager">SchoolTool</a>
104
104
    <a href="http://localhost/schooltool.interventions/2005-2006/manager">Administrator</a>
105
105
    <a href="http://localhost/schooltool.interventions/2005-2006/principal">Principal</a>
115
115
 
116
116
    >>> teacher1.getLink('Intervention').click()
117
117
    >>> teacher1.getControl(name='SEARCH_STUDENT_BUTTON').click()
118
 
    >>> teacher1.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
118
    >>> teacher1.printQuery("id('content-body')//table/tbody//a")
119
119
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
120
120
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
121
121
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
123
123
 
124
124
    >>> student1.getLink('Intervention').click()
125
125
    >>> student1.getControl(name='SEARCH_STUDENT_BUTTON').click()
126
 
    >>> student1.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
126
    >>> student1.printQuery("id('content-body')//table/tbody//a")
127
127
 
128
128
    >>> student2.getLink('Intervention').click()
129
129
    >>> student2.getControl(name='SEARCH_STUDENT_BUTTON').click()
130
 
    >>> student2.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
130
    >>> student2.printQuery("id('content-body')//table/tbody//a")
131
131
 
132
132
    >>> student3.getLink('Intervention').click()
133
133
    >>> student3.getControl(name='SEARCH_STUDENT_BUTTON').click()
134
 
    >>> student3.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
134
    >>> student3.printQuery("id('content-body')//table/tbody//a")
135
135
 
136
136
We note that the url has changed because we process the student searchs with
137
137
another view that doesn't even have am Inbox fieldset.  This is becuase we
141
141
 
142
142
    >>> principal.url
143
143
    'http://localhost/persons/principal/intervention_tab/search_students.html'
144
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset//legend/b")
 
144
    >>> principal.printQuery("id('content-body')//fieldset//legend/b")
145
145
    <b>Students</b>
146
146
 
147
147
Since the principal has access to more than one student, we'll test the search
150
150
 
151
151
    >>> principal.getControl(name='SEARCH_STUDENT_NAME').value = 'student'
152
152
    >>> principal.getControl(name='SEARCH_STUDENT_BUTTON').click()
153
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
153
    >>> principal.printQuery("id('content-body')//table/tbody//a")
154
154
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
155
155
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
156
156
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
164
164
 
165
165
    >>> principal.getControl(name='SEARCH_STUDENT_NAME').value = 'manager'
166
166
    >>> principal.getControl(name='SEARCH_STUDENT_BUTTON').click()
167
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
167
    >>> principal.printQuery("id('content-body')//table/tbody//a")
168
168
    <a href="http://localhost/schooltool.interventions/2005-2006/manager">SchoolTool</a>
169
169
    <a href="http://localhost/schooltool.interventions/2005-2006/manager">Administrator</a>
170
170
 
173
173
 
174
174
    >>> principal.getControl(name='CLEAR_STUDENT_SEARCH').click()
175
175
    >>> principal.getControl(name='SEARCH_STUDENT_BUTTON').click()
176
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
176
    >>> principal.printQuery("id('content-body')//table/tbody//a")
177
177
    <a href="http://localhost/schooltool.interventions/2005-2006/manager">SchoolTool</a>
178
178
    <a href="http://localhost/schooltool.interventions/2005-2006/manager">Administrator</a>
179
179
    <a href="http://localhost/schooltool.interventions/2005-2006/principal">Principal</a>
192
192
 
193
193
    >>> principal.getControl(name='WITH_GOALS_ONLY').value = 'checked'
194
194
    >>> principal.getControl(name='SEARCH_STUDENT_BUTTON').click()
195
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
195
    >>> principal.printQuery("id('content-body')//table/tbody//a")
196
196
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
197
197
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
198
198
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
204
204
    >>> principal.getLink('Return to Inbox').click()
205
205
    >>> principal.url
206
206
    'http://localhost/persons/principal/intervention_tab'
207
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset//legend/b")
 
207
    >>> principal.printQuery("id('content-body')//fieldset//legend/b")
208
208
    <b>Search Students</b>
209
209
    <b>Inbox</b>
210
210
 
213
213
    >>> principal.getLink('Intervention').click()
214
214
    >>> principal.getControl(name='SEARCH_STUDENT_NAME').value = 'student'
215
215
    >>> principal.getControl(name='SEARCH_STUDENT_BUTTON').click()
216
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
216
    >>> principal.printQuery("id('content-body')//table/tbody//a")
217
217
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
218
218
    <a href="http://localhost/schooltool.interventions/2005-2006/student1">Student1</a>
219
219
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
224
224
    >>> principal.getLink('Intervention').click()
225
225
    >>> principal.getControl(name='WITH_GOALS_ONLY').value = 'checked'
226
226
    >>> principal.getControl(name='SEARCH_STUDENT_BUTTON').click()
227
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[1]/div/table/tbody//a")
 
227
    >>> principal.printQuery("id('content-body')//table/tbody//a")
228
228
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
229
229
    <a href="http://localhost/schooltool.interventions/2005-2006/student2">Student2</a>
230
230
    <a href="http://localhost/schooltool.interventions/2005-2006/student3">Student3</a>
240
240
The links are for the view only views.
241
241
 
242
242
    >>> principal.getLink('Intervention').click()
243
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
244
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
245
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1">x</a>
246
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2">x</a>
247
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1">x</a>
248
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
249
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">x</a>
 
243
    >>> principal.printQuery("id('content-body')//table/tbody//a")
 
244
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
 
245
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1...
 
246
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2...
 
247
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1...
 
248
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
 
249
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1...
250
250
 
251
251
    >>> teacher1.getLink('Intervention').click()
252
 
    >>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
253
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
254
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
 
252
    >>> teacher1.printQuery("id('content-body')//table/tbody//a")
 
253
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
 
254
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
255
255
 
256
256
    >>> student1.getLink('Intervention').click()
257
 
    >>> student1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
258
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">x</a>
 
257
    >>> student1.printQuery("id('content-body')//table/tbody//a")
 
258
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1...
259
259
 
260
260
    >>> student2.getLink('Intervention').click()
261
 
    >>> student2.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
262
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1">x</a>
263
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1">x</a>
 
261
    >>> student2.printQuery("id('content-body')//table/tbody//a")
 
262
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1...
 
263
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1...
264
264
 
265
265
    >>> student3.getLink('Intervention').click()
266
 
    >>> student3.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
267
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
 
266
    >>> student3.printQuery("id('content-body')//table/tbody//a")
 
267
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
268
268
 
269
269
There is a name filter that can limit the list to students whose name contains
270
270
a search string.
271
271
 
272
272
    >>> principal.getControl(name='SEARCH_NAME').value = 'student1'
273
273
    >>> principal.getControl(name='SEARCH_BUTTON').click()
274
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
275
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
276
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">x</a>
 
274
    >>> principal.printQuery("id('content-body')//table/tbody//a")
 
275
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
 
276
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1...
277
277
 
278
278
    >>> principal.getControl(name='SEARCH_NAME').value = 'student2'
279
279
    >>> principal.getControl(name='SEARCH_BUTTON').click()
280
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
281
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1">x</a>
282
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2">x</a>
283
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1">x</a>
 
280
    >>> principal.printQuery("id('content-body')//table/tbody//a")
 
281
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1...
 
282
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2...
 
283
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1...
284
284
 
285
285
    >>> principal.getControl(name='SEARCH_NAME').value = 'student3'
286
286
    >>> principal.getControl(name='SEARCH_BUTTON').click()
287
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
288
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
 
287
    >>> principal.printQuery("id('content-body')//table/tbody//a")
 
288
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
289
289
 
290
290
We have a Clear button that restores the search criteria to empty, thus
291
291
returning all messages and goals again.
292
292
 
293
293
    >>> principal.getControl(name='CLEAR_SEARCH').click()
294
 
    >>> principal.getControl(name='SEARCH_BUTTON').click()
295
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
296
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
297
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1">x</a>
298
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2">x</a>
299
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1">x</a>
300
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
301
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">x</a>
 
294
    >>> principal.printQuery("id('content-body')//table/tbody//a")
 
295
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
 
296
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1...
 
297
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2...
 
298
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1...
 
299
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
 
300
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1...
302
301
 
303
302
Finally, by clicking the Goals Only checkbox the search results will be limited
304
303
to students that have goals, in our case, student2 and student3.
305
304
 
306
305
    >>> principal.getControl(name='GOALS_ONLY').value = 'checked'
307
306
    >>> principal.getControl(name='SEARCH_BUTTON').click()
308
 
    >>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
309
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
310
 
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1">x</a>
 
307
    >>> principal.printQuery("id('content-body')//table/tbody//a")
 
308
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
 
309
    <a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1...
311
310
 
312
311
 
313
312
UpdatePersonResponsibleIndex() tests
323
322
    >>> ftests.addEditGoal(principal, edit_goal_url, ['principal', 'student3'])
324
323
 
325
324
    >>> teacher1.getLink('Intervention').click()
326
 
    >>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
327
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
 
325
    >>> teacher1.printQuery("id('content-body')//table/tbody//a")
 
326
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
328
327
 
329
328
    >>> ftests.addEditGoal(principal, edit_goal_url, ['principal', 'teacher1', 'student3'])
330
329
 
331
330
    >>> teacher1.getLink('Intervention').click()
332
 
    >>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
333
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
334
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
 
331
    >>> teacher1.printQuery("id('content-body')//table/tbody//a")
 
332
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
 
333
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
335
334
 
336
335
Now we need to test that the same behaviour will occur if an as yet non-existent
337
336
view (we'll provide a test-only version) changes a message's recipients or a
345
344
 
346
345
    >>> principal.open(message_url + '?remove=teacher1')
347
346
    >>> teacher1.getLink('Intervention').click()
348
 
    >>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
349
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
 
347
    >>> teacher1.printQuery("id('content-body')//table/tbody//a")
 
348
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
350
349
 
351
350
We'll add the teacher back to the message.  The teacher's inbox should now
352
351
have the message again.
353
352
 
354
353
    >>> principal.open(message_url + '?add=teacher1')
355
354
    >>> teacher1.getLink('Intervention').click()
356
 
    >>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
357
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
358
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
 
355
    >>> teacher1.printQuery("id('content-body')//table/tbody//a")
 
356
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
 
357
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
359
358
 
360
359
We'll do the same two sets of tests for the goal.
361
360
 
362
361
    >>> principal.open(goal_url + '?remove=teacher1')
363
362
    >>> teacher1.getLink('Intervention').click()
364
 
    >>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
365
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
 
363
    >>> teacher1.printQuery("id('content-body')//table/tbody//a")
 
364
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
366
365
 
367
366
    >>> principal.open(goal_url + '?add=teacher1')
368
367
    >>> teacher1.getLink('Intervention').click()
369
 
    >>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
370
 
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
371
 
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
 
368
    >>> teacher1.printQuery("id('content-body')//table/tbody//a")
 
369
    <a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
 
370
    <a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
372
371
 
373
372
 
374
373
Traversal adapter tests