1 | from waeup.custom.testing import FunctionalLayer |
---|
2 | from waeup.sirp.students.tests.test_browser import StudentsFullSetup |
---|
3 | from waeup.custom.configuration import SessionConfiguration |
---|
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): |
---|
11 | |
---|
12 | # Set up SessionConfiguration object |
---|
13 | configuration = SessionConfiguration() |
---|
14 | configuration.academic_session = 2004 |
---|
15 | configuration.fee_1 = 20000 |
---|
16 | self.app['configuration'].addSessionConfiguration(configuration) |
---|
17 | |
---|
18 | # Managers can add online payment tickets |
---|
19 | self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') |
---|
20 | self.browser.open(self.payments_student_path) |
---|
21 | self.browser.getLink("Manage").click() |
---|
22 | self.browser.getControl("Add online payment ticket").click() |
---|
23 | self.browser.getControl("Create ticket").click() |
---|
24 | self.assertMatches('...Amount could not be determined...', |
---|
25 | self.browser.contents) |
---|
26 | self.browser.open(self.manage_student_path) |
---|
27 | self.browser.getControl(name="transition").value = ['admit'] |
---|
28 | self.browser.getControl("Save").click() |
---|
29 | self.browser.getControl(name="transition").value = ['start_clearance'] |
---|
30 | self.browser.getControl("Save").click() |
---|
31 | self.browser.getControl(name="transition").value = ['request_clearance'] |
---|
32 | self.browser.getControl("Save").click() |
---|
33 | self.browser.getControl(name="transition").value = ['clear'] |
---|
34 | self.browser.getControl("Save").click() |
---|
35 | self.browser.open(self.payments_student_path + '/addop') |
---|
36 | self.browser.getControl("Create ticket").click() |
---|
37 | self.assertMatches('...ticket created...', |
---|
38 | self.browser.contents) |
---|
39 | self.browser.open(self.manage_student_path) |
---|
40 | self.browser.getControl(name="transition").value = ['pay_first_school_fee'] |
---|
41 | self.browser.getControl("Save").click() |
---|
42 | self.browser.getControl(name="transition").value = ['reset6'] |
---|
43 | self.browser.getControl("Save").click() |
---|
44 | self.browser.open(self.payments_student_path + '/addop') |
---|
45 | self.browser.getControl("Create ticket").click() |
---|
46 | self.assertMatches('...ticket created...', |
---|
47 | self.browser.contents) |
---|