Ignore:
Timestamp:
15 Aug 2011, 07:13:58 (13 years ago)
Author:
Henrik Bettermann
Message:

Further increase test coverage. Henrik's code is now nearly 100% covered (except some raised exceptions).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt

    r6611 r6613  
    470470  ...
    471471
     472We can grant local roles:
     473
     474  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/manage')
     475  >>> browser.getControl(name="user").value = ['bob']
     476  >>> browser.getControl(name="local_role").value = ['waeup.local.DepartmentOfficer']
     477  >>> browser.getControl("Add local role").click()
     478  >>> print browser.contents
     479  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     480  ...<td>bob</td>
     481  ...
     482
     483The local role can be removed again:
     484
     485  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/manage')
     486  >>> ctrl = browser.getControl(name='role_id')
     487  >>> browser.getControl("Remove selected local roles").click()
     488  >>> print browser.contents
     489  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     490  ...No local role selected...
     491  ...
     492
     493  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/manage')
     494  >>> ctrl = browser.getControl(name='role_id')
     495  >>> ctrl.getControl(value='bob|waeup.local.DepartmentOfficer').selected = True
     496  >>> browser.getControl("Remove selected local roles").click()
     497  >>> print browser.contents
     498  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     499  ...Successfully removed:...
     500  ...
     501
    472502Deleting departments
    473503--------------------
     
    519549
    520550  >>> dept_url = 'http://localhost/myuniversity/faculties/TF/TD'
    521   >>> browser.open(dept_url + '/addcourse')
     551  >>> browser.open(dept_url + '/manage')
     552  >>> browser.getControl('Add course').click()
    522553  >>> print browser.contents
    523554  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    651682  True
    652683
     684  >>> browser.getControl('Cancel', index=0).click()
     685  >>> browser.getLink('Manage department').click()
     686  >>> browser.getControl('Remove selected courses').click()
     687  >>> 'No course selected' in browser.contents
     688  True
     689
    653690  >>> browser.getControl(name='val_id').getControl(value='COURSE1').selected = True
    654691  >>> browser.getControl('Remove selected courses').click()
     
    681718
    682719  >>> dept_url = 'http://localhost/myuniversity/faculties/TF/TD'
    683   >>> browser.open(dept_url + '/addcertificate')
     720  >>> browser.open(dept_url + '/manage')
     721  >>> browser.getControl('Add certificate').click()
    684722  >>> print browser.contents
    685723  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    794832  >>> browser.open('http://localhost/myuniversity/faculties/TF/TD/@@manage#tab-3')
    795833  >>> 'My renamed cert' in browser.contents
     834  True
     835
     836  >>> browser.getControl('Remove selected certificates').click()
     837  >>> 'No certificate selected' in browser.contents
    796838  True
    797839
     
    859901
    860902  >>> cert_url = dept_url + '/certificates/CERT1'
    861   >>> browser.open(cert_url + '/addcertificatecourse')
     903  >>> browser.open(cert_url + '/manage')
     904  >>> browser.getControl('Add course referrer').click()
    862905  >>> print browser.contents
    863906  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
     
    887930  'http://localhost/my...sity/faculties/TF/TD/certificates/CERT1/COURSE1_100'
    888931
     932We can't add the same certificatecourse twice:
     933
     934  >>> cert_url = dept_url + '/certificates/CERT1'
     935  >>> browser.open(cert_url + '/manage')
     936  >>> browser.getControl('Add course referrer').click()
     937  >>> ctrl = browser.getControl(name='form.course')
     938  >>> ctrl.getControl('COURSE1').selected = True
     939  >>> browser.getControl(name='form.level').value = ['100']
     940  >>> browser.getControl('Add course referrer').click()
     941  >>> 'The chosen course referrer is already' in browser.contents
     942  True
     943
    889944When we started to add a new certificatecourse, we can also cancel the
    890945process before submitting. This will bring us back to the certificate
     
    906961  >>> browser.getLink('Edit course referrer').click()
    907962
     963If we just click 'Save and return' nothing will change:
     964
     965  >>> browser.getControl("Save and return").click()
     966  >>> browser.getLink('COURSE1_100').click()
     967  >>> browser.url
     968  'http://localhost/myun.../TF/TD/certificates/CERT1/COURSE1_100'
     969
    908970Let's set a new level (it was 100 before) and save the form. This will
    909971bring us to the certificate index page afterwards:
    910972
     973  >>> browser.open(cert_url + '/COURSE1_100/manage')
    911974  >>> browser.getControl(name='form.level').value = ['200']     
    912   >>> ctrl = browser.getControl("Save and return")
    913   >>> ctrl.click()
     975  >>> browser.getControl("Save and return").click()
    914976
    915977As we changed the level, also the URL will change:
     
    9441006  >>> 'COURSE1_200</a>' in browser.contents
    9451007  True
    946 
     1008  >>> browser.getControl('Remove selected course referrers').click()
     1009  >>> 'No course referrer selected' in browser.contents
     1010  True
    9471011  >>> browser.getControl(name='val_id').getControl(value='COURSE1_200').selected = True
    9481012  >>> browser.getControl('Remove selected course referrers').click()
Note: See TracChangeset for help on using the changeset viewer.