Ignore:
Timestamp:
20 Oct 2011, 16:48:59 (13 years ago)
Author:
Henrik Bettermann
Message:

Increase test coverage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r6900 r6914  
    337337        self.browser.getControl("Add study level").click()
    338338        self.assertMatches('...<span>100</span>...', self.browser.contents)
     339        self.browser.getControl("Add study level").click()
     340        self.assertMatches('...This level exists...', self.browser.contents)
     341        self.browser.getControl("Remove selected").click()
     342        self.assertMatches('...No study level selected...', self.browser.contents)
    339343        self.browser.getControl(name="val_id").value = ['100']
    340344        self.browser.getControl("Remove selected").click()
    341345        self.assertMatches('...Successfully removed...', self.browser.contents)
    342         # Add again level again
     346        # Add level again
    343347        self.browser.getControl(name="addlevel").value = ['100']
    344348        self.browser.getControl("Add study level").click()
     349        self.browser.getControl(name="addlevel").value = ['100']
    345350
    346351        # Managers can view and manage course lists
     
    350355        self.browser.getControl(name="form.level_session").value = ['2002']
    351356        self.browser.getControl("Save").click()
     357        self.browser.getControl("Remove selected").click()
     358        self.assertMatches('...No ticket selected...', self.browser.contents)
    352359        ctrl = self.browser.getControl(name='val_id')
    353360        ctrl.getControl(value='COURSE1').selected = True
     
    358365        self.browser.getControl("Add course ticket").click()
    359366        self.assertTrue('Successfully added' in self.browser.contents)
     367        self.browser.getControl("Add course ticket").click()
     368        self.browser.getControl(name="form.course").value = ['COURSE1']
     369        self.browser.getControl("Add course ticket").click()
     370        self.assertTrue('The ticket exists' in self.browser.contents)
     371        self.browser.getControl("Cancel").click()
    360372        self.browser.getLink("COURSE1").click()
    361373        self.browser.getLink("Manage").click()
     
    564576        self.browser.getLink("Clearance Data").click()
    565577        self.browser.getLink("Start clearance").click()
     578        self.browser.getControl(name="ac_series").value = '3'
     579        self.browser.getControl(name="ac_number").value = '4444444'
     580        self.browser.getControl("Start clearance now").click()
     581        self.assertMatches('...Access code is invalid...',
     582                           self.browser.contents)
    566583        self.browser.getControl(name="ac_series").value = self.existing_clrseries
    567584        self.browser.getControl(name="ac_number").value = self.existing_clrnumber
     
    585602        self.assertMatches('...The requested form is locked...',
    586603                           self.browser.contents)
     604        # Student can't add study level if not in state 'school fee paid'
     605        self.browser.open(self.student_path + '/studycourse/add')
     606        self.assertMatches('...The requested form is locked...',
     607                           self.browser.contents)
     608        # ... and must be transferred first
    587609        IWorkflowInfo(student).fireTransition('clear')
    588610        IWorkflowInfo(student).fireTransition('pay_first_school_fee')
    589         # Students can add the current study level
     611        # Now students can add the current study level
    590612        self.browser.getLink("Study Course").click()
    591613        self.browser.getLink("Add course list").click()
     
    613635        self.assertMatches('...Successfully added COURSE1...',
    614636                           self.browser.contents)
     637        self.browser.getControl("Remove selected", index=0).click()
     638        self.assertTrue('No ticket selected' in self.browser.contents)
    615639        ctrl = self.browser.getControl(name='val_id')
    616640        ctrl.getControl(value='COURSE1').selected = True
     
    636660        self.assertMatches('...Amount Authorized...',
    637661                           self.browser.contents)
    638         self.browser.open(self.payments_student_path + '/manage')
     662        self.browser.open(self.payments_student_path)
     663        self.browser.getLink('Manage').click()
     664        self.browser.getControl("Remove selected").click()
     665        self.assertMatches('...No payment selected...', self.browser.contents)
    639666        ctrl = self.browser.getControl(name='val_id')
    640667        value = ctrl.options[0]
Note: See TracChangeset for help on using the changeset viewer.