コード例 #1
0
 def test_detectpaper_wordnum_among10to15W_run23(self):
     '''检测大于10W字少于15W字的论文,验证扣除篇数是否为3'''
     self.login()
     bd = BatchDetection(self.driver)
     remainnum_befdetect = int(bd.getRemainArticleNum())
     bd.clickMyTes()
     bd.batchDetectProcess()
     bd.clickAddPaperBtn()
     bd.uploadFile("detect_file_among10-15w.docx")
     bd.clickBeginUploadBtn()
     try:
         is_upload_over = bd.isBeginDetectBtnExist()
         self.assertTrue(is_upload_over, '-----上传失败-----')
         bd.clickBeginDetectBtn()
         is_detect_over = bd.isCheckResultBtnExist()
         self.assertTrue(is_detect_over, "------检测未完成--------")
         succeed = bd.getDetectSimilarity()
         self.assertIn('%', succeed, "-------检测未成功--------")
         remainnum_aftdetect = int(bd.getRemainArticleNum())
         self.assertEqual(remainnum_befdetect - remainnum_aftdetect,
                          int('3'), '-----扣除篇数错误,10w-15w字应扣除3篇-----')
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver,
                                "detectpaper_wordnum_among10to15W.jpg")
         sleep(3)
コード例 #2
0
 def test_uploadfile_rtf_detectsucceed_run16(self):
     '''上传rtf文件,点击开始检测按钮'''
     self.login()
     bd = BatchDetection(self.driver)
     bd.clickMyTes()
     bd.batchDetectProcess()
     bd.clickAddPaperBtn()
     bd.uploadFile("detect_file_rtf")
     bd.clickBeginUploadBtn()
     try:
         is_upload_over = bd.isBeginDetectBtnExist()
         self.assertTrue(is_upload_over, '-----上传失败-----')
         bd.clickBeginDetectBtn()
         is_detect_over = bd.isCheckResultBtnExist()
         self.assertTrue(is_detect_over, "------检测未完成--------")
         succeed = bd.getDetectSimilarity()
         self.assertIn('%', succeed, "-------检测未成功--------")
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver,
                                "uploadfile_rtf_detectsucceed.jpg")
         sleep(3)
コード例 #3
0
 def test_toReCreat_run26(self):
     '''检测成功后跳转至创建任务页面'''
     self.login()
     bd = BatchDetection(self.driver)
     bd.clickMyTes()
     bd.batchDetectProcess()
     bd.clickAddPaperBtn()
     bd.uploadFile("detect_file_docx.docx")
     bd.clickBeginUploadBtn()
     try:
         is_upload_over = bd.isBeginDetectBtnExist()
         self.assertTrue(is_upload_over, '-----上传失败-----')
         bd.clickBeginDetectBtn()
         is_detect_over = bd.isCheckResultBtnExist()
         self.assertTrue(is_detect_over, "------检测未完成--------")
         succeed = bd.getDetectSimilarity()
         self.assertIn('%', succeed, "-------检测未成功--------")
         bd.clickReCreatBtn()
         confirm_exist = bd.isConfirmTaskBtnExist()
         self.assertTrue(confirm_exist, "-----未跳转至新建任务或选择已有任务页面-----")
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver, "toCheckResult.jpg")
         sleep(3)
コード例 #4
0
 def test_toCheckResult_run25(self):
     '''检测成功后跳转至查看检测结果页面'''
     self.login()
     bd = BatchDetection(self.driver)
     bd.clickMyTes()
     task_name = bd.batchDetectProcess()
     bd.clickAddPaperBtn()
     bd.uploadFile("detect_file_docx.docx")
     bd.clickBeginUploadBtn()
     try:
         is_upload_over = bd.isBeginDetectBtnExist()
         self.assertTrue(is_upload_over, '-----上传失败-----')
         bd.clickBeginDetectBtn()
         is_detect_over = bd.isCheckResultBtnExist()
         self.assertTrue(is_detect_over, "------检测未完成--------")
         succeed = bd.getDetectSimilarity()
         self.assertIn('%', succeed, "-------检测未成功--------")
         bd.clickCheckResultBtn()
         vertify_name = bd.getTaskName()
         self.assertEqual(vertify_name, task_name, "-----未跳转至检测结果页-----")
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver, "toCheckResult.jpg")
         sleep(3)