~replaceafill/ubuntu/trusty/schooltool/2.8

« back to all changes in this revision

Viewing changes to src/schooltool/contact/browser/ftests/contact.txt

  • Committer: Gediminas Paulauskas
  • Date: 2013-10-10 16:53:33 UTC
  • mfrom: (1.1.27)
  • Revision ID: menesis@pov.lt-20131010165333-knsk88i2od7b8o70
Tags: 1:2.6.0-0ubuntu1
* New upstream release.
* debian/redis.conf: save redis databases less often.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
    >>> browser = Browser('manager', 'schooltool')
5
5
    >>> browser.getLink('Manage').click()
6
6
 
7
 
    >>> from schooltool.contact.browser.ftests import addPerson
8
 
    >>> addPerson('Bill Student', 'student', 'pwd')
 
7
    >>> from schooltool.basicperson.browser.ftests.setup import addPerson
 
8
    >>> addPerson('Bill', 'Student', 'student', 'pwd')
9
9
 
10
10
Let's try and add a contact:
11
11
 
15
15
    >>> browser.getControl('Prefix').value = 'Mr'
16
16
    >>> browser.getControl('First name').value = 'John'
17
17
    >>> browser.getControl('Middle name').value = 'J'
18
 
    >>> browser.getControl('Last name').value = 'Administrator'
 
18
    >>> browser.getControl('Last name').value = 'Manager'
19
19
    >>> browser.getControl('Suffix').value = 'Jr'
20
20
    >>> browser.getControl('Address line 1').value = 'Frog lane 13'
21
21
    >>> browser.getControl('Address line 2').value = ''
44
44
        <td>
45
45
          <a href="http://localhost/persons/student/contact">Bill</a>
46
46
        </td>
47
 
      </tr>
 
47
    </tr>
48
48
    <tr class="even"><td>
 
49
        </td>
 
50
        <td>
 
51
          <a href="http://localhost/persons/manager/contact">Manager</a>
 
52
        </td>
 
53
        <td>
 
54
          <a href="http://localhost/persons/manager/contact">Default</a>
 
55
        </td>
 
56
    </tr>
 
57
    <tr class="odd"><td>
49
58
          <input type="checkbox" name="delete.contacts.Contact-..."
50
59
                                 id="delete.contacts.Contact-..." /></td>
51
60
        <td>
52
 
          <a href="http://localhost/contacts/Contact">Administrator</a>
 
61
          <a href="http://localhost/contacts/Contact">Manager</a>
53
62
        </td>
54
63
        <td>
55
64
          <a href="http://localhost/contacts/Contact">John</a>
56
65
        </td>
57
66
    </tr>
58
 
    <tr class="odd"><td>
59
 
        </td>
60
 
        <td>
61
 
          <a href="http://localhost/persons/manager/contact">Administrator</a>
62
 
        </td>
63
 
        <td>
64
 
          <a href="http://localhost/persons/manager/contact">SchoolTool</a>
65
 
        </td>
66
 
      </tr>
67
67
 
68
68
If you click on the contact and click edit - you can change the
69
69
information:
88
88
    >>> browser.printQuery("id('content-body')")
89
89
    <div id="content-body">
90
90
      <h1>Contact information for
91
 
          <a href="http://localhost/persons/manager">Administrator, SchoolTool</a>
 
91
          <a href="http://localhost/persons/manager">Default Manager</a>
92
92
      </h1>
93
93
      <div class="info-block">
94
94
      </div>
121
121
    button-neutral
122
122
    button-neutral
123
123
 
124
 
    >>> browser.getControl('Administrator').click()
 
124
    >>> browser.getControl('Manager').click()
125
125
    >>> browser.getControl('Assign').click()
126
126
 
127
127
Both contacts should be assigned now:
136
136
    <tr class="odd"><td>
137
137
          <input type="checkbox" name="remove_item.contacts.Contact-..." id="remove_item.contacts.Contact-..." /></td>
138
138
        <td>
139
 
          <label for="remove_item.contacts.Contact-...">Administrator</label>
 
139
          <label for="remove_item.contacts.Contact-...">Manager</label>
140
140
        </td>
141
141
        <td>
142
142
          <a href="http://localhost/contacts/Contact">John</a>
165
165
    >>> browser.printQuery("id('content-body')")
166
166
    <div id="content-body">
167
167
      <h1>Contact information for
168
 
          <a href="http://localhost/persons/manager">Administrator, SchoolTool</a>
 
168
          <a href="http://localhost/persons/manager">Default Manager</a>
169
169
      </h1>
170
170
      <div class="info-block">
171
171
      </div>
187
187
      <div>
188
188
      <div class="person-info">
189
189
        <fieldset><div class="person-info">
190
 
          <h2> Mr John J Administrator Jr </h2>
 
190
          <h2> Mr John J Manager Jr </h2>
191
191
          <a href="http://localhost/contacts/Contact">(View Details)</a>
192
192
          <div class="info-block">
193
193
            <h4>Address</h4>
218
218
 
219
219
    >>> browser.getControl('Clear').click()
220
220
 
221
 
    >>> browser.getControl('Administrator', index=0).click()
 
221
    >>> browser.getControl('Manager', index=1).click()
222
222
    >>> browser.getControl('Assign').click()
223
223
 
224
224
Now we can see two persons when we navigate to contact's view.
231
231
    ...First name...
232
232
    ...John...
233
233
    ...Last name...
234
 
    ...Administrator...
 
234
    ...Manager...
235
235
    ...
236
236
    <div class="row">
237
237
      Contact of
238
 
      <a href="http://localhost/persons/manager">Administrator, SchoolTool</a>
 
238
      <a href="http://localhost/persons/manager">Default Manager</a>
239
239
    </div>
240
240
    <div class="row">
241
241
      Contact of
242
 
      <a href="http://localhost/persons/student">Student, Bill</a>
 
242
      <a href="http://localhost/persons/student">Bill Student</a>
243
243
    </div>
244
244
 
245
245
Let's change the relationship with Bill.
256
256
    ...
257
257
    <div class="row">
258
258
      Contact of
259
 
      <a href="http://localhost/persons/manager">Administrator, SchoolTool</a>
 
259
      <a href="http://localhost/persons/manager">Default Manager</a>
260
260
    </div>
261
261
    <div class="row">
262
262
      Parent of
263
 
      <a href="http://localhost/persons/student">Student, Bill</a>
 
263
      <a href="http://localhost/persons/student">Bill Student</a>
264
264
    </div>
265
265
 
266
266
Let's test contact deletion.
284
284
    <title> Delete items </title>
285
285
    <li>
286
286
      <span>John</span>
287
 
      <a href="http://localhost/contacts/Contact">Administrator</a>
 
287
      <a href="http://localhost/contacts/Contact">Manager</a>
288
288
    </li>
289
289
    <li>
290
290
      <span>Peter</span>
325
325
        <td>
326
326
          <a href="http://localhost/persons/student/contact">Bill</a>
327
327
        </td>
328
 
      </tr>
 
328
    </tr>
329
329
    <tr class="even"><td>
 
330
        </td>
 
331
        <td>
 
332
          <a href="http://localhost/persons/manager/contact">Manager</a>
 
333
        </td>
 
334
        <td>
 
335
          <a href="http://localhost/persons/manager/contact">Default</a>
 
336
        </td>
 
337
    </tr>
 
338
    <tr class="odd"><td>
330
339
          <input type="checkbox" name="delete.contacts.Contact-..."
331
340
                                 id="delete.contacts.Contact-..." /></td>
332
341
        <td>
333
 
          <a href="http://localhost/contacts/Contact">Administrator</a>
 
342
          <a href="http://localhost/contacts/Contact">Manager</a>
334
343
        </td>
335
344
        <td>
336
345
          <a href="http://localhost/contacts/Contact">John</a>
337
346
        </td>
338
347
    </tr>
339
 
    <tr class="odd"><td>
340
 
        </td>
341
 
        <td>
342
 
          <a href="http://localhost/persons/manager/contact">Administrator</a>
343
 
        </td>
344
 
        <td>
345
 
          <a href="http://localhost/persons/manager/contact">SchoolTool</a>
346
 
        </td>
347
 
      </tr>
348
348
 
349
349
 
350
350
Let's enter the contact information of an existing system user -
351
 
SchoolTool Administrator.
 
351
Default Manager.
352
352
 
353
353
    >>> browser.getLink('Home').click()
354
354
    >>> browser.getLink('Contacts').click()
366
366
    >>> browser.printQuery("id('content-body')")
367
367
    <div id="content-body">
368
368
      <h1>Contact information for
369
 
        <a href="http://localhost/persons/manager">Administrator, SchoolTool</a>
 
369
        <a href="http://localhost/persons/manager">Default Manager</a>
370
370
      </h1>
371
371
      <div class="info-block">
372
372
        <h4>Address</h4>
379
379
      <br /><h1>Contacts</h1>
380
380
    ...
381
381
 
382
 
And assign SchoolTool Administrator user as contact of a student.
 
382
And assign Default Manager user as contact of a student.
383
383
 
384
384
    >>> browser.getLink('Manage').click()
385
385
    >>> browser.getLink('Persons').click()
389
389
    >>> browser.getLink('Manage Contacts').click()
390
390
 
391
391
    >>> browser.getControl('Clear').click()
392
 
    >>> browser.getControl('Administrator', index=1).click()
 
392
    >>> browser.getControl('Manager', index=1).click()
393
393
    >>> browser.getControl('Assign').click()
394
394
 
395
395
    >>> browser.getLink('Contacts').click()
396
396
    >>> browser.printQuery("//h1 | //fieldset//h2 | //fieldset//a")
397
397
    <h1>Contact information for
398
 
      <a href="http://localhost/persons/student">Student, Bill</a>
 
398
      <a href="http://localhost/persons/student">Bill Student</a>
399
399
    </h1>
400
400
    <h1>Contacts</h1>
401
401
    <h2>
402
 
      Parent, Mr John J Administrator Jr
 
402
      Parent, Mr John J Manager Jr
403
403
    </h2>
404
404
    <a href="http://localhost/contacts/Contact">(View Details)</a>
405
405
    <h2>
406
 
      SchoolTool Administrator
 
406
      Default Manager
407
407
    </h2>
408
408
    <a href="http://localhost/persons/manager/contact">(View Details)</a>
409
409
 
413
413
    >>> browser.printQuery("id('content-body')")
414
414
    <div id="content-body">
415
415
    <h1>Contact information for
416
 
      <a href="http://localhost/persons/manager">Administrator, SchoolTool</a>
 
416
      <a href="http://localhost/persons/manager">Default Manager</a>
417
417
    </h1>
418
418
    <div>
419
419
      Contact of
420
 
      <a href="http://localhost/persons/student">Student, Bill</a>
 
420
      <a href="http://localhost/persons/student">Bill Student</a>
421
421
    </div>
422
422
    ...
423
423
 
424
 
And of course we can change Administrator's relationship with Bill.
 
424
And of course we can change Manager's relationship with Bill.
425
425
 
426
426
    >>> browser.getLink('Edit').click()
427
427
    >>> relationship = browser.getControl('Relationship')
432
432
    >>> browser.printQuery("id('content-body')")
433
433
    <div id="content-body">
434
434
    <h1>Contact information for
435
 
      <a href="http://localhost/persons/manager">Administrator, SchoolTool</a>
 
435
      <a href="http://localhost/persons/manager">Default Manager</a>
436
436
    </h1>
437
437
    <div>
438
438
      Sibling of
439
 
      <a href="http://localhost/persons/student">Student, Bill</a>
 
439
      <a href="http://localhost/persons/student">Bill Student</a>
440
440
    </div>
441
441
    ...