from waeup.custom.testing import FunctionalLayer from waeup.sirp.students.tests.test_browser import StudentsFullSetup from waeup.custom.configuration import SessionConfiguration class StudentUITests(StudentsFullSetup): # Tests for customized student class views and pages layer = FunctionalLayer def test_manage_payments(self): # Managers can add online payment tickets self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') self.browser.open(self.payments_student_path) self.browser.getLink("Manage").click() self.browser.getControl("Add online payment ticket").click() self.browser.getControl("Create ticket").click() self.assertMatches('...Session configuration object is not available...', self.browser.contents) # Set up SessionConfiguration object configuration = SessionConfiguration() configuration.academic_session = 2004 configuration.fee_1 = 20000 self.app['configuration'].addSessionConfiguration(configuration) self.browser.open(self.payments_student_path) self.browser.getLink("Manage").click() self.browser.getControl("Add online payment ticket").click() self.browser.getControl("Create ticket").click() self.assertMatches('...Amount could not be determined...', self.browser.contents) self.browser.open(self.manage_student_path) self.browser.getControl(name="transition").value = ['admit'] self.browser.getControl("Save").click() self.browser.getControl(name="transition").value = ['start_clearance'] self.browser.getControl("Save").click() self.browser.getControl(name="transition").value = ['request_clearance'] self.browser.getControl("Save").click() self.browser.getControl(name="transition").value = ['clear'] self.browser.getControl("Save").click() self.browser.open(self.payments_student_path + '/addop') self.browser.getControl("Create ticket").click() self.assertMatches('...ticket created...', self.browser.contents) self.browser.open(self.manage_student_path) self.browser.getControl(name="transition").value = ['pay_first_school_fee'] self.browser.getControl("Save").click() self.browser.getControl(name="transition").value = ['reset6'] self.browser.getControl("Save").click() self.browser.open(self.payments_student_path + '/addop') self.browser.getControl("Create ticket").click() self.assertMatches('...ticket created...', self.browser.contents) self.browser.open(self.payments_student_path + '/addop') self.browser.getControl(name="form.p_category").value = ['gown'] self.browser.getControl("Create ticket").click() self.browser.open(self.payments_student_path + '/addop') self.browser.getControl(name="form.p_category").value = ['transfer'] self.browser.getControl("Create ticket").click() self.browser.open(self.payments_student_path + '/addop') self.browser.getControl(name="form.p_category").value = ['hostel_maintenance'] self.browser.getControl("Create ticket").click() self.certificate.study_mode = 'ug_pt' self.browser.open(self.payments_student_path + '/addop') self.browser.getControl(name="form.p_category").value = ['schoolfee'] self.browser.getControl("Create ticket").click() self.assertMatches('...Amount could not be determined...', self.browser.contents)