def test_detectpaper_wordnum_among10to15W_run24(self): '''检测大于10W字少于15W字的论文,验证扣除篇数是否为3''' self.login() me = ManualEntry(self.driver) remainnum_befdetect = int(me.getRemainArticleNum()) me.clickMyTes() me.manualEntryProcess() me.inputPaperName("手工录入_10-15W") me.inputAuthorName("海鸣威") me.readAndInputContent("detect_file_among10-15w.txt") me.clickBeginDetectBtn() state = me.getDetectState() try: self.assertEqual(state, "开始检测", "-----论文未开始检测-----") finish = me.isCheckResultBtnExist() self.assertTrue(finish, "-----论文检测未完成-----") succeed = me.getDetectSimilarity() self.assertIn('%', succeed, "-----论文检测未成功-----") remainnum_aftdetect = int(me.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)
def test_addContent_allField_succeed_run12(self): '''添加全部检测内容,点击开始检测''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.manualEntryProcess() me.inputPaperName("手工录入") me.inputAuthorName("海鸣威") me.inputAuthorCompany("文学出版社") me.inputMajority("文学专业") me.inputTutor("修导师") me.readAndInputContent("detect_file.txt") me.clickBeginDetectBtn() state = me.getDetectState() try: self.assertEqual(state, "开始检测", "-------论文未开始检测--------") finish = me.isCheckResultBtnExist() self.assertTrue(finish, "------检测未完成--------") succeed = me.getDetectSimilarity() self.assertIn('%', succeed, "-------检测未成功--------") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "addContent_allField_succeed.jpg") sleep(3)
def test_toReCreat_run26(self): '''检测成功后跳转至创建任务页面''' self.login() me = ManualEntry(self.driver) me.clickMyTes() me.manualEntryProcess() me.inputPaperName("手工录入") me.inputAuthorName("海鸣威") me.readAndInputContent("detect_file.txt") me.clickBeginDetectBtn() state = me.getDetectState() try: self.assertEqual(state, "开始检测", "-----论文未开始检测-----") finish = me.isCheckResultBtnExist() self.assertTrue(finish, "-----论文检测未完成-----") succeed = me.getDetectSimilarity() self.assertIn('%', succeed, "-----论文检测未成功-----") me.clickReCreatBtn() confirm_exist = me.isConfirmTaskBtnExist() self.assertTrue(confirm_exist, "-----未跳转至新建任务或选择已有任务页面-----") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "toReCreat.jpg") sleep(3)
def test_toCheckResult_run25(self): '''检测成功后跳转至查看检测结果页面''' self.login() me = ManualEntry(self.driver) me.clickMyTes() task_name = me.manualEntryProcess() me.inputPaperName("手工录入") me.inputAuthorName("海鸣威") me.readAndInputContent("detect_file.txt") me.clickBeginDetectBtn() state = me.getDetectState() try: self.assertEqual(state, "开始检测", "-----论文未开始检测-----") finish = me.isCheckResultBtnExist() self.assertTrue(finish, "-----论文检测未完成-----") succeed = me.getDetectSimilarity() self.assertIn('%', succeed, "-----论文检测未成功-----") me.clickCheckResultBtn() vertify_name = me.getTaskName() self.assertEqual(vertify_name, task_name, "-----未跳转至检测结果页-----") finally: imagetest = getResultImage() imagetest.insert_image(self.driver, "toCheckResult.jpg") sleep(3)