def test_uploadfile_size0kb_run24(self):
     '''上传文件大小为0kb的文件'''
     self.login()
     bd = BatchDetection(self.driver)
     bd.clickMyTes()
     bd.batchDetectProcess()
     bd.clickAddPaperBtn()
     bd.uploadFile("uploadfile_blank.docx")
     try:
         is_alert = bd.is_alert_exist()
         self.assertTrue(is_alert, '-----上传0kb的文件时,未做相应提示-----')
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver, "uploadfile_size0kb.jpg")
         sleep(3)
 def test_uploadfile_wrongtype_xls_run17(self):
     '''上传不符合上传文件类型的文件'''
     self.login()
     bd = BatchDetection(self.driver)
     bd.clickMyTes()
     bd.batchDetectProcess()
     bd.clickAddPaperBtn()
     bd.uploadFile("excel_file_fail")
     try:
         is_alert = bd.is_alert_exist()
         self.assertTrue(is_alert, '-----上传不符合要求的文件类型时,未做提示-----')
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver, "uploadfile_wrongtype_xls.jpg")
         sleep(3)
 def test_uploadfile_oversize_run18(self):
     '''上传超过30M的文件'''
     self.login()
     bd = BatchDetection(self.driver)
     bd.clickMyTes()
     bd.batchDetectProcess()
     bd.clickAddPaperBtn()
     bd.uploadFile("uploadfile_over30m")
     try:
         is_alert = bd.is_alert_exist()
         self.assertTrue(is_alert, '-----上传不符合要求的文件类型时,未做提示-----')
         sleep(5)
         alert_info = bd.getAlertInfo()
         self.assertIn("文件过大,上传失败!", alert_info, "-----文件超过30M,未做提示-----")
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver, "uploadfile_oversize.jpg")
         sleep(3)