예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 def test_addContent_authorName_isnull_run15(self):
     '''必填项作者未填写,点击开始检测,检测提示信息'''
     self.login()
     me = ManualEntry(self.driver)
     me.clickMyTes()
     me.manualEntryProcess()
     me.inputPaperName("手工录入")
     me.readAndInputContent("detect_file.txt")
     me.clickBeginDetectBtn()
     papaerName_alert = me.verifyExistAlert()
     try:
         self.assertEqual(papaerName_alert, '请输入作者。', '-----作者为空未提示-----')
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver,
                                "addContent_authorName_isnull.jpg")
         sleep(3)
예제 #4
0
 def test_addContent_content_isnull_run16(self):
     '''必填项录入内容未填写,点击开始检测,检测提示信息'''
     self.login()
     me = ManualEntry(self.driver)
     me.clickMyTes()
     me.manualEntryProcess()
     me.inputPaperName("手工录入")
     me.inputAuthorName("海鸣威")
     me.clickBeginDetectBtn()
     papaerName_alert = me.verifyExistAlert()
     try:
         self.assertEqual(papaerName_alert, '请输入待检测内容。',
                          '-----录入内容为空未提示-----')
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver,
                                "addContent_content_isnull.jpg")
         sleep(3)
예제 #5
0
 def test_addContent_authorName_overlength_run19(self):
     '''作者输入内容过长,点击开始检测,检测提示信息'''
     self.login()
     me = ManualEntry(self.driver)
     me.clickMyTes()
     me.manualEntryProcess()
     me.inputPaperName("手工录入")
     me.readAndInputBigData("content_21.txt", "authorName")
     me.readAndInputContent("detect_file.txt")
     me.clickBeginDetectBtn()
     papaerName_alert = me.verifyExistAlert()
     try:
         self.assertEqual(papaerName_alert, '作者长度不能超过20字符',
                          '-----作者长度过长未提示-----')
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver,
                                "addContent_authorName_overlength.jpg")
         sleep(3)
예제 #6
0
 def test_addContent_content_less200_run17(self):
     '''必填项录入内容填写少于200字符,点击开始检测,检测提示信息'''
     self.login()
     me = ManualEntry(self.driver)
     me.clickMyTes()
     me.manualEntryProcess()
     me.inputPaperName("手工录入")
     me.inputAuthorName("海鸣威")
     me.readAndInputContent("detect_file_less200.txt")
     me.clickBeginDetectBtn()
     papaerName_alert = me.verifyExistAlert()
     try:
         self.assertEqual(papaerName_alert, '待检测内容不得少于200字',
                          '-----录入内容少于200字未提示-----')
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver,
                                "addContent_content_less200.jpg")
         sleep(3)
예제 #7
0
 def test_addContent_tutor_overlength_run22(self):
     '''导师输入内容过长,点击开始检测,检测提示信息'''
     self.login()
     me = ManualEntry(self.driver)
     me.clickMyTes()
     me.manualEntryProcess()
     me.inputPaperName("手工录入")
     me.inputAuthorName("海鸣威")
     me.readAndInputBigData("content_21.txt", "tutor")
     me.readAndInputContent("detect_file.txt")
     me.clickBeginDetectBtn()
     try:
         alert_exist = me.is_alert_exist()
         self.assertTrue(alert_exist, "-----导师长度过长未提示-----")
         papaerName_alert = me.verifyExistAlert()
         self.assertEqual(papaerName_alert, '导师长度不能超过100字符',
                          '-----导师长度过长未提示-----')
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver,
                                "addContent_tutor_overlength.jpg")
         sleep(3)
예제 #8
0
 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)
예제 #9
0
 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)