[6903] | 1 | from waeup.custom.testing import FunctionalLayer |
---|
[6902] | 2 | from waeup.sirp.students.tests.test_browser import StudentsFullSetup |
---|
[6925] | 3 | from waeup.custom.configuration import SessionConfiguration |
---|
[6902] | 4 | |
---|
| 5 | class StudentUITests(StudentsFullSetup): |
---|
| 6 | # Tests for customized student class views and pages |
---|
| 7 | |
---|
| 8 | layer = FunctionalLayer |
---|
| 9 | |
---|
| 10 | def test_manage_payments(self): |
---|
[6925] | 11 | |
---|
[6926] | 12 | # Managers can add online payment tickets |
---|
| 13 | self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') |
---|
| 14 | self.browser.open(self.payments_student_path) |
---|
| 15 | self.browser.getControl("Add online payment ticket").click() |
---|
| 16 | self.browser.getControl("Create ticket").click() |
---|
| 17 | self.assertMatches('...Session configuration object is not available...', |
---|
| 18 | self.browser.contents) |
---|
| 19 | |
---|
[6925] | 20 | # Set up SessionConfiguration object |
---|
| 21 | configuration = SessionConfiguration() |
---|
| 22 | configuration.academic_session = 2004 |
---|
| 23 | configuration.fee_1 = 20000 |
---|
| 24 | self.app['configuration'].addSessionConfiguration(configuration) |
---|
| 25 | |
---|
[6902] | 26 | self.browser.open(self.payments_student_path) |
---|
| 27 | self.browser.getControl("Add online payment ticket").click() |
---|
| 28 | self.browser.getControl("Create ticket").click() |
---|
[6925] | 29 | self.assertMatches('...Amount could not be determined...', |
---|
[6902] | 30 | self.browser.contents) |
---|
| 31 | self.browser.open(self.manage_student_path) |
---|
| 32 | self.browser.getControl(name="transition").value = ['admit'] |
---|
| 33 | self.browser.getControl("Save").click() |
---|
| 34 | self.browser.getControl(name="transition").value = ['start_clearance'] |
---|
| 35 | self.browser.getControl("Save").click() |
---|
| 36 | self.browser.getControl(name="transition").value = ['request_clearance'] |
---|
| 37 | self.browser.getControl("Save").click() |
---|
| 38 | self.browser.getControl(name="transition").value = ['clear'] |
---|
| 39 | self.browser.getControl("Save").click() |
---|
| 40 | self.browser.open(self.payments_student_path + '/addop') |
---|
| 41 | self.browser.getControl("Create ticket").click() |
---|
| 42 | self.assertMatches('...ticket created...', |
---|
| 43 | self.browser.contents) |
---|
[6925] | 44 | self.browser.open(self.manage_student_path) |
---|
| 45 | self.browser.getControl(name="transition").value = ['pay_first_school_fee'] |
---|
| 46 | self.browser.getControl("Save").click() |
---|
| 47 | self.browser.getControl(name="transition").value = ['reset6'] |
---|
| 48 | self.browser.getControl("Save").click() |
---|
| 49 | self.browser.open(self.payments_student_path + '/addop') |
---|
| 50 | self.browser.getControl("Create ticket").click() |
---|
| 51 | self.assertMatches('...ticket created...', |
---|
| 52 | self.browser.contents) |
---|
[6926] | 53 | self.browser.open(self.payments_student_path + '/addop') |
---|
| 54 | self.browser.getControl(name="form.p_category").value = ['gown'] |
---|
| 55 | self.browser.getControl("Create ticket").click() |
---|
| 56 | self.browser.open(self.payments_student_path + '/addop') |
---|
| 57 | self.browser.getControl(name="form.p_category").value = ['transfer'] |
---|
| 58 | self.browser.getControl("Create ticket").click() |
---|
| 59 | self.browser.open(self.payments_student_path + '/addop') |
---|
| 60 | self.browser.getControl(name="form.p_category").value = ['hostel_maintenance'] |
---|
| 61 | self.browser.getControl("Create ticket").click() |
---|
[6950] | 62 | self.browser.open(self.payments_student_path + '/addop') |
---|
| 63 | self.browser.getControl(name="form.p_category").value = ['clearance'] |
---|
| 64 | self.browser.getControl("Create ticket").click() |
---|
[6926] | 65 | self.certificate.study_mode = 'ug_pt' |
---|
| 66 | self.browser.open(self.payments_student_path + '/addop') |
---|
| 67 | self.browser.getControl(name="form.p_category").value = ['schoolfee'] |
---|
| 68 | self.browser.getControl("Create ticket").click() |
---|
| 69 | self.assertMatches('...Amount could not be determined...', |
---|
| 70 | self.browser.contents) |
---|
| 71 | |
---|
| 72 | |
---|