Changeset 15545 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 14 Aug 2019, 19:55:53 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r15508 r15545 3812 3812 self.browser.open(facs_path) 3813 3813 self.browser.getLink("Export student data").click() 3814 self.browser.getControl(" Configure new export").click()3814 self.browser.getControl("Set export parameters").click() 3815 3815 self.browser.getControl(name="exporter").value = ['bursary'] 3816 3816 self.browser.getControl(name="session").value = ['2004'] … … 3861 3861 '- discarded: job_id=%s' % job_id in logcontent 3862 3862 ) 3863 # Officer can also enter student id and gets the same export file 3864 self.browser.open(facs_path) 3865 self.browser.getLink("Export student data").click() 3866 self.browser.getControl("Enter student ids or matric numbers").click() 3867 self.browser.getControl(name="exporter").value = ['bursary'] 3868 self.browser.getControl(name="students").value = 'K1000000' 3869 self.browser.getControl("Create CSV file").click() 3870 # When the job is finished and we reload the page... 3871 job_id = self.wait_for_export_job_completed() 3872 # ... the csv file can be downloaded ... 3873 self.browser.open('http://localhost/app/faculties/exports') 3874 self.browser.getLink("Download").click() 3875 self.assertEqual(self.browser.headers['content-type'], 3876 'text/csv; charset=UTF-8') 3877 self.assertTrue( 3878 'filename="WAeUP.Kofa_bursary_%s.csv' % job_id in 3879 self.browser.headers['content-disposition']) 3880 self.assertTrue( 3881 '666,12.12,2012-12-13 00:00:00#,schoolfee,1,my-id,p-item,100,2013,' 3882 'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,' 3883 'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents) 3863 3884 3864 3885 def test_faculty_export(self): … … 3867 3888 self.browser.open(fac1_path) 3868 3889 self.browser.getLink("Export student data").click() 3869 self.browser.getControl(" Configure new export").click()3890 self.browser.getControl("Set export parameters").click() 3870 3891 self.browser.getControl(name="exporter").value = ['students'] 3871 3892 self.browser.getControl(name="session").value = ['2004'] … … 3877 3898 self.browser.getControl(name="payments_end").value = '14/12/2012' 3878 3899 self.browser.getControl("Create CSV file").click() 3879 3880 3900 # When the job is finished and we reload the page... 3881 3901 job_id = self.wait_for_export_job_completed() … … 3922 3942 '- discarded: job_id=%s' % job_id in logcontent 3923 3943 ) 3944 # Officer can set export parameters but cannot enter student id 3945 # at faculty level 3946 self.browser.open(fac1_path + '/exports') 3947 self.assertTrue("Set export parameters" 3948 in self.browser.contents) 3949 self.assertFalse("Enter student ids or matric numbers" 3950 in self.browser.contents) 3924 3951 3925 3952 def test_department_export(self): … … 3928 3955 self.browser.open(dep1_path) 3929 3956 self.browser.getLink("Export student data").click() 3930 self.browser.getControl(" Configure new export").click()3957 self.browser.getControl("Set export parameters").click() 3931 3958 self.browser.getControl(name="exporter").value = ['students'] 3932 3959 self.browser.getControl(name="session").value = ['2004'] … … 3980 4007 self.browser.open(cert1_path) 3981 4008 self.browser.getLink("Export student data").click() 3982 self.browser.getControl(" Configure new export").click()4009 self.browser.getControl("Set export parameters").click() 3983 4010 self.browser.getControl(name="exporter").value = ['students'] 3984 4011 self.browser.getControl(name="session").value = ['2004'] … … 4028 4055 self.browser.open(course1_path) 4029 4056 self.browser.getLink("Export student data").click() 4030 self.browser.getControl(" Configure new export").click()4057 self.browser.getControl("Set export parameters").click() 4031 4058 self.browser.getControl(name="exporter").value = ['students'] 4032 4059 self.browser.getControl(name="session").value = ['2004'] … … 4081 4108 self.browser.open(course1_path) 4082 4109 self.browser.getLink("Export student data").click() 4083 self.browser.getControl(" Configure new export").click()4110 self.browser.getControl("Set export parameters").click() 4084 4111 self.assertTrue( 4085 4112 'Academic session not set. Please contact the administrator.' 4086 4113 in self.browser.contents) 4087 4114 self.app['configuration'].current_academic_session = 2004 4088 self.browser.getControl(" Configure new export").click()4115 self.browser.getControl("Set export parameters").click() 4089 4116 self.browser.getControl(name="exporter").value = ['lecturer'] 4090 4117 self.browser.getControl(name="session").value = ['2004'] … … 4148 4175 self.browser.open("http://localhost/app/faculties/fac1/dep1") 4149 4176 self.browser.getLink("Export student data").click() 4150 self.browser.getControl(" Configure new export").click()4177 self.browser.getControl("Set export parameters").click() 4151 4178 # Only the sfpaymentsoverview exporter is available for department officers 4152 4179 self.assertFalse('<option value="students">' in self.browser.contents) … … 4166 4193 4167 4194 def test_export_bursary_officers(self): 4195 self.add_payment(self.student) 4168 4196 # Create bursary officer 4169 4197 self.app['users'].addUser('mrbursary', SECRET) … … 4180 4208 self.browser.getLink("Academics").click() 4181 4209 self.browser.getLink("Export student data").click() 4182 self.browser.getControl(" Configure new export").click()4210 self.browser.getControl("Set export parameters").click() 4183 4211 # Only the bursary exporter is available for bursary officers 4184 4212 # not only at facultiescontainer level ... … … 4193 4221 self.browser.open('http://localhost/app/faculties/fac1/dep1') 4194 4222 self.browser.getLink("Export student data").click() 4195 self.browser.getControl(" Configure new export").click()4223 self.browser.getControl("Set export parameters").click() 4196 4224 self.assertFalse('<option value="students">' in self.browser.contents) 4197 4225 self.assertTrue('<option value="bursary">' in self.browser.contents) 4198 # Thew job can be d iscarded4226 # Thew job can be downloaded 4199 4227 self.assertEqual(len(self.app['datacenter'].running_exports), 1) 4200 self.wait_for_export_job_completed() 4228 job_id = self.wait_for_export_job_completed() 4229 self.browser.open('http://localhost/app/faculties/exports') 4230 self.browser.getLink("Download").click() 4231 self.assertEqual(self.browser.headers['content-type'], 4232 'text/csv; charset=UTF-8') 4233 self.assertTrue( 4234 'filename="WAeUP.Kofa_bursary_%s.csv' % job_id in 4235 self.browser.headers['content-disposition']) 4236 self.assertTrue( 4237 '666,12.12,2012-12-13 00:00:00#,schoolfee,1,my-id,p-item,100,2013,' 4238 'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,' 4239 'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents) 4240 # ... and discarded 4201 4241 self.browser.open('http://localhost/app/faculties/exports') 4202 4242 self.browser.getControl("Discard").click() 4203 4243 self.assertEqual(len(self.app['datacenter'].running_exports), 0) 4244 # At Academics level bursary officers can also enter student ids 4245 self.browser.getLink("Academics").click() 4246 self.browser.getLink("Export student data").click() 4247 self.browser.getControl("Enter student ids or matric numbers").click() 4248 self.assertFalse('<option value="students">' in self.browser.contents) 4249 self.browser.getControl(name="exporter").value = ['bursary'] 4250 self.browser.getControl(name="students").value = 'K1000000' 4251 self.browser.getControl("Create CSV file").click() 4252 # When the job is finished and we reload the page... 4253 job_id = self.wait_for_export_job_completed() 4254 # ... the csv file can be downloaded ... 4255 self.browser.open('http://localhost/app/faculties/exports') 4256 self.browser.getLink("Download").click() 4257 self.assertEqual(self.browser.headers['content-type'], 4258 'text/csv; charset=UTF-8') 4259 self.assertTrue( 4260 'filename="WAeUP.Kofa_bursary_%s.csv' % job_id in 4261 self.browser.headers['content-disposition']) 4262 self.assertTrue( 4263 '666,12.12,2012-12-13 00:00:00#,schoolfee,1,my-id,p-item,100,2013,' 4264 'paid,2012-12-13 00:00:00#,12.12,r-code,,K1000000,234,123,Anna,,' 4265 'Tester,created,2004,2004,,fac1,dep1,CERT1' in self.browser.contents) 4204 4266 4205 4267 def test_export_accommodation_officers(self): … … 4218 4280 self.browser.getLink("Academics").click() 4219 4281 self.browser.getLink("Export student data").click() 4220 self.browser.getControl(" Configure new export").click()4282 self.browser.getControl("Set export parameters").click() 4221 4283 # accommodationpayments and beds exporters are available 4222 4284 # not only at facultiescontainer level ... … … 4234 4296 self.browser.open('http://localhost/app/faculties/fac1/dep1') 4235 4297 self.browser.getLink("Export student data").click() 4236 self.browser.getControl(" Configure new export").click()4298 self.browser.getControl("Set export parameters").click() 4237 4299 self.assertFalse('<option value="students">' in self.browser.contents) 4238 4300 self.assertTrue('<option value="accommodationpayments">'
Note: See TracChangeset for help on using the changeset viewer.