def test_15_CheckWrongReason(self): RES().click_submit_button() photo().take_screeshot() for reason in RES().wrong_list: if findsomething().find_by_message(self._driver, reason, 2, 1): print '错题原因' + reason + '存在' else: print '错题原因' + reason + '不存在'
def test_11_NoWork(self): _exp_student_name = u'无学生' _act_student_name = self._driver.find_element_by_id(RES.ID_STUDENT_NAME).text.encode('utf-8') print u'请查看没有待批改作业的批改截图:' # 给截图加上时间戳,防止重复命名的覆盖 photo().take_screeshot() assert _exp_student_name == _act_student_name, \ '期望的没作业时候的学生名字与设计不符,exp=%s, act=%s' % (_exp_student_name, _act_student_name)
def test_18_ClickCancelButton(self): RES().click_submit_button() photo().take_screeshot() cancel_button = self._driver.find_element_by_id(RES.ID_CANCEl) cancel_button.click() if findsomething().find_by_message(self._driver, u'提交', 2, 1): print u'取消功能正常,弹出框关闭' else: print u'取消功能不正常,弹出框没有关闭'
def test_13_GetStudentInfoandPaperInfo(self): # 获取提交作业的学生姓名 _act_student_name = self._driver.find_element_by_id(RES.ID_STUDENT_NAME).text.encode('utf-8') print u'提交作业的学生名字:' + _act_student_name # 获取提交作业的试卷名字 _act_paper_name = self._driver.find_element_by_id(RES.ID_PAPER_NAME).text.encode('utf-8') print u'提交作业的试卷名字:' + _act_paper_name # 获取提交作业的试卷题号 _act_question_no = self._driver.find_element_by_id(RES.ID_QUESTION_NO).text.encode('utf-8') print U'提交作业的试卷题号:' + _act_question_no # 截图 photo().take_screeshot()