def test_list4E_run(self):
     '''进入名称链接:下载 V1.0全文报告'''
     self.user_login_verify_run("collegecheck","f")
     time.sleep(1)
     T=TaskList(self.driver)
     # 进入名称链接
     T.taskNameLink("new_V")
     # 输入篇名点击搜索
     self.driver.find_element(*self.title_input_loc).send_keys("医学期刊简介")
     # 筛选检测成功的
     Select(self.driver.find_element_by_name("State")).select_by_visible_text("检测成功")
     self.driver.find_element(*self.task_search_loc).click()
     time.sleep(2)
     # 3对应全文报告
     report_type = T.downReport("3")
     str=report_type[:2]
     str_new="+论文相似性检测报告"+"(V1.0"+str+"版).pdf"
     title = T.loadReport()
     new_title = title+str_new
     print(new_title)
     # 判断文件夹中是否存在
     flag=T.downVerify1(new_title)
     if flag == True:
         # 修改文件名称
         T.renameFileName1(new_title)
     # 点击V1.0详细版链接
     self.driver.find_element_by_xpath("html/body/div[4]/div[2]/table/tbody/tr[2]/td[9]/a[5]").click()
     time.sleep(3)
     # 判断下载位置
     flag1 = T.downVerify1(new_title)
     self.assertTrue(flag1)
     imagetest = getResultImage()
     imagetest.insert_image(self.driver,"full_report_V1.0.jpg")
 def test_list3A_run(self):
     '''进入名称链接:篇名链接-上传论文可以点击下载到本地'''
     self.user_login_verify_run("collegecheck","f")
     time.sleep(1)
     T=TaskList(self.driver)
     # 进入名称链接
     T.taskNameLink("ncy")
     # 输入篇名点击搜索
     T.title_search("医学期刊")
     new_title = T.paperNameLink()
     # print(new_title)
     flag=T.downVerify1(new_title)
     if flag == True:
         # 修改文件名称
         T.renameFileName1(new_title)
     # 勾选复选框,点击下载按钮
     T.downloadReport()
     # 点击弹出框的“确定按钮”
     self.driver.find_element_by_xpath(".//*[@id='confirmDownload']").click()
     time.sleep(3)
     # 判断下载位置
     flag1=T.downVerify1(new_title)
     self.assertTrue(flag1)
     imagetest = getResultImage()
     imagetest.insert_image(self.driver,"click_name_link.jpg")
 def test_manual_text_null_4(self):
     '''文本为空,无法检测'''
     self.ManualOption("文本为空","作者","")
     manu = ManualEntry(self.driver)
     self.assertEqual(manu.text_null_mind(),"请输入内容")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver,"manual_text_null.jpg")
예제 #4
0
 def test_author_null_run_3(self):
     '''作者信息为空,无法上传论文'''
     sut = SingleUpload(self.driver)
     self.singleUploadOption("测试信息", "")
     self.assertEqual(sut.author_null_mind(), "请输入作者")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "single_author_null.jpg")
예제 #5
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)
예제 #6
0
    def test_checkCount_more_run(self):
        '''批量生成学生账户-分配检测篇数超过剩余检测篇数'''
        #登录系统
        login = UserVer(self.driver)
        login.userLogin("collegeuser", "f")
        sleep(2)

        stu = StudentAccount(self.driver)
        stu.in_batchstudent()
        sleep(2)
        stu.choose_existBatch()
        stu.expirydate()
        sleep(2)
        a = stu.checkcount_surplus() + 1
        print(a)
        stu.checkcount_input(checkcount=a)
        sleep(2)
        stu.upload_stuaccount()
        sleep(3)

        #调用autoIt生成的上传文件应用
        stu.uploadFile_para("chrome", stu.getFilePath("学生账户1.xlsx"))
        sleep(5)
        errorMessage = "为1个学生账户分配" + str(a) + "篇检测数量,共需分配" + str(
            a) + "篇,您的可分配篇数不足,请充值后,再导入学生账户表格"

        self.assertEqual(stu.uploaderror_remind(), errorMessage)
        print("批量生成学生账户-分配检测篇数超过剩余检测篇数测试成功")
        #获取页面截图
        imagetest = getResultImage()
        imagetest.insert_image(self.driver, "chooseexistBatch.jpg")
 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)
 def test_accountNumLink9_run(self):
     '''信息列表:学生详情-转移批次'''
     self.user_login_verify_run("collegeuser","f")
     time.sleep(1)
     S=StuAccountList(self.driver)
     S.batchSearch("lytest123")
     # 点击搜索按钮
     self.driver.find_element_by_id("searchBtn").click()
     time.sleep(1)
     # 点击数量链接
     self.driver.find_element_by_xpath(".//*[@id='container']/table/tbody/tr[2]/td[4]/a/b").click()
     # 返回第一行的子账户
     sub_account = self.driver.find_element(*self.fist_sub_account).text
     # 转移批次
     S.optionBtn("转移批次","1")
     # 2对应批次lytest111
     i = 2
     S.transferBatch(i)
     time.sleep(2)
     # 进入对应批次查询
     S.batchAccount(i, sub_account)
     # 点击查询按钮
     S.searchBtn()
     # 返回第一行的子账户
     sub_account1 = self.driver.find_element(*self.fist_sub_account).text
     self.assertEqual(sub_account,sub_account1)
     # 获取页面截图
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "stu_transferBatch_success.jpg")
 def test_accountNumLinkA_run(self):
     '''信息列表:进入个人详情-题名链接-下载'''
     self.user_login_verify_run("collegeuser","f")
     time.sleep(1)
     S=StuAccountList(self.driver)
     S.batchSearch("lytest123")
     # 点击搜索按钮
     self.driver.find_element_by_id("searchBtn").click()
     time.sleep(1)
     # 点击数量链接
     self.driver.find_element_by_xpath(".//*[@id='container']/table/tbody/tr[2]/td[4]/a/b").click()
     # 根据相似比和检测次数进行查询
     # 批次和学生账户查询
     S.similarTest("60","65","2","5")
     # 点击查询按钮
     S.searchBtn()
     # 点击名称链接
     self.driver.find_element(*self.fist_sub_account).click()
     time.sleep(1)
     # 点击第一行名称链接 2对应第一行
     row = 2
     file_name = S.personalPaper(row)
     new_title= "%s.pdf" % file_name
     # print(new_title)
     flag = S.downVerify1(new_title)
     if flag == True:
         S.renameFileName1(new_title,".pdf")
     # 点击名称链接进行下载论文
     self.driver.find_element_by_xpath(".//*[@id='container']/tbody/tr[%s]/td[1]/a" % row).click()
     time.sleep(3)
     flag1 = S.downVerify1(new_title)
     self.assertTrue(flag1)
     # 获取页面截图
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "personal_download_success.jpg")
    def test_queryUseAll_run(self):
        '''使用账户、任务名称、创建时间,进行多条件检索'''
        # 登录本科生系统
        login = UserVer(self.driver)
        login.userLogin("collegecheck", "f")

        im = InformationManagement(self.driver)
        # 选择账户(下拉列表第一个账户)
        im.accountSelectLi1()
        sleep(2)
        # 输入任务名称
        im.inputTaskName("ncy")
        sleep(2)
        # 选择创建时间
        im.queryBeginTime(2016, 5, 11)
        sleep(5)
        im.queryEndTime(2017, 12, 25)
        # 点击查询按钮
        im.queryButtonClick()
        sleep(2)
        firstAccount = im.queryFirstAccountName()
        self.assertEqual(firstAccount, "collegecheck")
        firstTaskName = im.queryFirstTaskName()
        self.assertEqual(firstTaskName, "ncy")
        print("测试用例执行完成:使用账户、任务名称、创建时间,进行多条件检索。")

        # 对当前页面截图
        imagetest = getResultImage()
        imagetest.insert_image(self.driver, "queryUseAll.jpg")
    def test_inDetectResultPage_run(self):
        '''点击检测结果中第一条记录的任务名,进入任务检测结果页面。
        返回任务检测结果页面的面包屑:任务检测结果
        '''
        # 登录本科生系统
        login = UserVer(self.driver)
        login.userLogin("collegecheck", "f")

        im = InformationManagement(self.driver)
        # 选择账户(下拉列表第一个账户)
        im.accountSelectLi1()
        sleep(2)
        # 输入任务名称
        im.inputTaskName("ncy")
        sleep(2)
        # 点击查询按钮
        im.queryButtonClick()
        sleep(2)
        # 点击任务名,进入检测结果页面
        result = im.inDetectResult()
        self.assertEqual(result, "任务检测结果")
        print("测试用例执行完成:点击检测结果中第一条记录的任务名,进入任务检测结果页面。")

        # 对当前页面截图
        imagetest = getResultImage()
        imagetest.insert_image(self.driver, "inDetectResultPage.jpg")
예제 #12
0
 def test_title_null_run_2(self):
     '''标题信息为空,无法上传论文'''
     sut = SingleUpload(self.driver)
     self.singleUploadOption("", "测试")
     self.assertEqual(sut.title_null_mind(), "请输入题名")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "single_title_null.jpg")
 def test_manual_author_null_3(self):
     '''作者为空,无法检测'''
     self.ManualOption("作者为空","","文本")
     manu = ManualEntry(self.driver)
     self.assertEqual(manu.author_null_mind(),"请输入作者")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver,"manual_author_null.jpg")
 def test_manual_title_null_2(self):
     '''标题为空,无法检测'''
     self.ManualOption("","作者","文本")
     manu = ManualEntry(self.driver)
     self.assertEqual(manu.title_null_mind(),"请输入题名")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver,"manual_title_null.jpg")
예제 #15
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)
    def test_queryResultUseAll_run(self):
        '''使用所有的检测条件,进行多条件检索'''
        # 登录本科生系统
        self.loginBegin()

        dr = DetectionResultPage(self.driver)
        # 输入相似比
        dr.inputRatioBegin(10)
        dr.inputRatioEnd(70)
        # 输入篇名
        dr.inputFileTitle("相似性检测本科生论文")
        # 输入作者
        dr.inputAuthor("李硕")
        # 选择检测时间
        dr.queryBeginTime(2017, 5, 10)
        dr.queryEndTime(2017, 5, 17)
        # 选择任务名称
        dr.taskNameSelectLi1()
        sleep(2)

        dr.queryButtonClick()
        sleep(2)
        title = dr.resultListFileTitle1()
        print(title)
        self.assertEqual(title, "相似性检测本科生论文")
        author = dr.resultListAuthor()
        self.assertEqual(author, "李硕")
        print("测试用例执行完成:使用所有的检测条件,进行多条件检索。")

        # 对当前页面截图
        imagetest = getResultImage()
        imagetest.insert_image(self.driver, "queryResultUseAll.jpg")
예제 #17
0
 def test_repeatSelectExistingTasks_succeed_run11(self):
     '''选择已有任务,重新选择后,验证是否成功'''
     self.login()
     me = ManualEntry(self.driver)
     me.clickMyTes()
     me.clickManualDetectButton()
     sleep(2)
     me.clickChooseBtn()
     me.clickDropDownBtn()
     me.clickOldTaskchoise()
     me.clickConfirmTaskBtn()
     me.clickRechoiseBtn()
     try:
         self.assertTrue(me.isRechoiseClickable(), "-----重新选择不可点击------")
         me.clickDropDownBtn()
         rechoise_name = me.clickSecendOldTaskchoise()
         me.clickConfirmTaskBtn()
         confirm_name = me.getCreatTaskName()
         self.assertEqual(rechoise_name, confirm_name,
                          "-----重新选择已有任务失败-----")
     finally:
         imagetest = getResultImage()
         imagetest.insert_image(self.driver,
                                "repeatSelectExistingTasks_succeed.jpg")
         sleep(3)
 def test_myAccount_info_2(self):
     '''查看账户信息是否为当前登录用户'''
     self.UserEnterMange()
     accm = AccountMgmt(self.driver)
     self.assertEqual(accm.look_account_info(), accm.login_info())
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "userinfo_right_ok.jpg")
예제 #19
0
    def test_downloadtemplate_run(self):
        '''下载学生账户模板成功'''
        #登录系统
        login = UserVer(self.driver)
        login.userLogin("collegeuser", "f")
        sleep(2)

        stu = StudentAccount(self.driver)
        stu.in_batchstudent()
        sleep(2)

        flag = stu.verifyExist()

        if flag is True:
            stu.renameFileName()
            stu.downloadaccount_template()
            sleep(5)
            print("模板已存在,模板下载成功!")

        else:
            #单击导出按钮
            stu.downloadaccount_template()
            sleep(5)
            print("模板下载成功!")
        print("下载学生账户信息模板测试成功!")
        sleep(5)
        #获取页面截图
        imagetest = getResultImage()
        imagetest.insert_image(self.driver,
                               "download_studentaccount_template.jpg")
 def test_login_userpwdNull_run(self):
     '''用户名、密码为空登录'''
     time.sleep(2)
     self.user_login_verify_run("", "")
     userver = UserVer(self.driver)
     self.assertEqual(userver.uname_error_remind(), "用户名不能为空")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "user_pwd_empty.jpg")
 def test_login_userNull_run(self):
     '''用户名为空,密码正确'''
     time.sleep(2)
     self.user_login_verify_run(username="", password="******")
     userver = UserVer(self.driver)
     self.assertEqual(userver.uname_error_remind(), "用户名不能为空")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "uname_empty.jpg")
 def test_login_pwdNull_run(self):
     '''用户名正确,密码为空登录'''
     time.sleep(2)
     self.user_login_verify_run('collegecheck.student2233', "")
     userver = UserVer(self.driver)
     self.assertEqual(userver.pwd_error_remind(), "密码不能为空")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "pwd_empty.jpg")
 def test_list0_run(self):
     ''' 任务列表:按照任务名称查询 '''
     self.user_login_verify_run("collegecheck","f")
     T=TaskList(self.driver)
     # T.list_search("批量检测")
     self.assertTrue(T.list_search("批量检测"))
     imagetest = getResultImage()
     imagetest.insert_image(self.driver,"task_name_search.jpg")
 def test_listB_run(self):
     '''任务列表:检测状态-操作判断'''
     self.user_login_verify_run("collegecheck","f")
     time.sleep(1)
     T=TaskList(self.driver)
     self.assertTrue(T.statusOp())
     imagetest = getResultImage()
     imagetest.insert_image(self.driver,"task_status_operation.jpg")
 def test_myWallet_info_1(self):
     '''查看充值链接是否正确'''
     self.UserEnterMange()
     accm = AccountMgmt(self.driver)
     self.assertEqual(accm.chongzhi_info(),
                      "http://tran.test.wanfangdata.com.cn/Charge.aspx")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "chongzhi_href_ok.jpg")
 def test_modifyPassword_nosame_4(self):
     '''两次密码输入不一样'''
     newp = "123456"
     repwd = "12345678"
     self.ModifyPwdOption(newp, repwd)
     accm = AccountMgmt(self.driver)
     self.assertEqual(accm.pwd_error_mind(), "两次输入密码必须一致")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "pwd_no_same.jpg")
 def test_modifyPassword_null_5(self):
     '''必填信息为空'''
     newp = ""
     repwd = ""
     self.ModifyPwdOption(newp, repwd)
     accm = AccountMgmt(self.driver)
     self.assertEqual(accm.pwd_error_mind(), "必填项皆不能为空。")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "pwd_null.jpg")
 def test_paging2_run(self):
     '''任务列表:表单测试-默认每页显示50条'''
     self.user_login_verify_run("collegecheck","f")
     T=StuAccountList(self.driver)
     list_n=T.pageChoose("3")
     self.assertEqual(list_n, 50)
     time.sleep(1)
     imagetest = getResultImage()
     imagetest.insert_image(self.driver,"stuList_50_num.jpg")
 def test_paging_run(self):
     '''任务列表:表单测试-默认每页显示10条'''
     self.user_login_verify_run("collegecheck","f")
     list_num=len(self.driver.find_elements_by_xpath(".//*[@id='container']/table/tbody/tr/td[3]"))
     # list_n=str(list_num)
     self.assertEqual(list_num, 10)
     time.sleep(1)
     imagetest = getResultImage()
     imagetest.insert_image(self.driver,"stuList_default_num.jpg")
 def test_login_success_run(self):
     '''用户名,密码正确'''
     self.user_login_verify_run(username="******", password="******")
     sleep(2)
     userver = UserVer(self.driver)
     self.assertEqual(userver.user_login_success_verify(),
                      "collegecheck服务站")
     imagetest = getResultImage()
     imagetest.insert_image(self.driver, "user_login_ok.jpg")