예제 #1
0
 def teststeps(self):
     STEP(1, '先列出老师')
     r = steacher.teacher_list()
     listret = r.json()
     teacherlist = listret["retlist"]
     STEP(2, '添加一个老师')
     n_data = [{"id": GSTORE['g_classid']}]
     n_classid = json.dumps(n_data)
     r = steacher.add_teacher('hwd', '汉武帝', 1, n_classid, '13600000000',
                              '*****@*****.**', '3209251983090987899')
     addtret = r.json()
     self.addteacherid = addtret['id']
     addretcode = r.json()
     STEP(3, '验证参数返回值')
     CHECK_POINT('返回的retcode值=0', addretcode['retcode'] == 0)
     STEP(4, '检查系统数据')
     r = steacher.teacher_list()
     listrest = r.json()
     expected = {
         "retlist":
         teacherlist + [{
             "username": "******",
             "teachclasslist": [GSTORE['g_classid']],
             "realname": "汉武帝",
             "id": addtret['id'],
             "phonenumber": "13600000000",
             "email": "*****@*****.**",
             "idcardnumber": "3209251983090987899"
         }],
         "retcode":
         0
     }
     INFO(expected)
     CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #2
0
 def teststeps(self):
     STEP(1, "新建一个老师")
     data = [{"id": GSTORE["g_classid"]}]
     classid = json.dumps(data)
     r = steacher.add_teacher(
         "qsh",
         "秦始皇",
         1,
         classid,
         "13451813456",
         "*****@*****.**",
         "3209251983090987899",
     )
     addret = r.json()
     self.addtid = addret["id"]
     STEP(2, "老师账号登录")
     teacherOp.teacher_login("qsh", "888888")
     homeinfo = teacherOp.gethomepageinfo()
     expect = ["白月学院00002", "秦始皇", "初中数学", "0", "0", "0"]
     STEP(3, "验证主页信息")
     CHECK_POINT("主页信息显示正确", homeinfo == expect)
     STEP(4, "验证学生列表")
     classinfo = teacherOp.getclassstudentinfo_none()
     expect1 = "该班级还没有学生注册"
     CHECK_POINT("班级学生列表为空", classinfo == expect1)
예제 #3
0
    def teststeps(self):
        STEP(1, '添加一个班级')
        r = sclass.add_class(6, '高三23班', 50)
        addret = r.json()
        self.addcid = addret['id']
        STEP(2, '验证参数返回值')
        CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
        STEP(3, '检查系统数据')
        r = sclass.class_list()
        listrest = r.json()
        expected = {
            "gradeid":
            None,
            "retlist": [{
                "name": "高三23班",
                "grade__name": "高三",
                "invitecode": addret["invitecode"],
                "studentlimit": 50,
                "studentnumber": 0,
                "id": addret['id'],
                "teacherlist": []
            }],
            "retcode":
            0
        }

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #4
0
    def teststeps(self):
        STEP(1, "新建一个老师")
        data = [{"id": GSTORE['g_classid']}]
        classid = json.dumps(data)
        r = steacher.add_teacher('hwd', '汉武帝', 1, classid, '13600000000',
                                 '*****@*****.**', '3209251983090987899')
        addret = r.json()
        self.addteacherid = addret['id']
        STEP(2, '验证参数返回值')
        CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
        STEP(3, '新建一个学生')
        r = sstudent.add_student('cyj', '程咬金', 1, GSTORE['g_classid'],
                                 13451810000)
        addret = r.json()
        self.addstudentid = addret['id']
        CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
        STEP(4, '教师发布作业')
        teacherOp.teacher_login('hwd', '888888')
        teacherOp.pushtask()

        STEP(5, "学生账号登录")
        studentOp.student_login("cyj", "888888")
        info = studentOp.getMyTask()
        INFO(info)
        expect = ['汉武帝', '初中数学']
        CHECK_POINT("任务信息显示正确", info == expect)
예제 #5
0
 def teststeps(self):
     STEP(1, '先列出学生')
     r = sstudent.student_list()
     listret = r.json()
     studentlist = listret["retlist"]
     STEP(2, '添加一个学生')
     r = sstudent.add_student('cyj', '程咬金', 6, GSTORE['g_classid'],
                              13400000000)
     addret = r.json()
     self.addstudentid = addret['id']
     STEP(3, '验证参数返回值')
     CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
     STEP(4, '修改新增的学员信息')
     r = sstudent.modify_student('addret["id"]', '程咬金', 13411111111)
     r = sstudent.student_list()
     listrest = r.json()
     CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
     expected = {
         "retlist":
         studentlist + [{
             "classid": GSTORE['g_classid'],
             "realname": "程咬金",
             "username": "******",
             "phonenumber": "13411111111",
             "id": addret['id']
         }],
         "retcode":
         0
     }
     CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #6
0
 def teststeps(self):
     STEP(1, "添加一个老师")
     data = [{"id": GSTORE["g_classid"]}]
     classid = json.dumps(data)
     r = steacher.add_teacher(
         "hwd",
         "汉武帝",
         1,
         classid,
         "13600000000",
         "*****@*****.**",
         "3209251983090987899",
     )
     addret = r.json()
     self.addteacherid = addret["id"]
     STEP(2, "验证参数返回值")
     CHECK_POINT("返回的retcode值=0", addret["retcode"] == 0)
     STEP(3, "老师账号登录")
     teacherOp.teacher_login("hwd", "888888")
     homeinfo = teacherOp.gethomepageinfo()
     expect = ["白月学院00002", "汉武帝", "初中数学", "0", "0", "0"]
     STEP(3, "验证主页信息")
     CHECK_POINT("主页信息显示正确", homeinfo == expect)
     STEP(4, "验证学生列表")
     classinfo = teacherOp.getclassstudentinfo()
     INFO(classinfo)
     expect1 = ["尉迟恭"]
     CHECK_POINT("班级学生数据", classinfo == expect1)
예제 #7
0
    def teststeps(self):
        STEP(1, '添加一个班级')
        r = sclass.add_class("", '高一一班', '50')
        addret = r.json()
        STEP(2, '验证参数返回值')
        CHECK_POINT('返回的retcode值=1', addret['retcode'] == 1)
        STEP(3, '检查系统数据')
        r = sclass.class_list()
        listrest = r.json()
        expected = {"gradeid": None, "retlist": [], "retcode": 0}

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #8
0
 def teststeps(self):
     STEP(1, '新建一个学生')
     r = sstudent.add_student('cyj', '程咬金', 1, GSTORE['g_classid'],
                              13451810000)
     addret = r.json()
     self.addstudentid = addret['id']
     CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
     STEP(2, "学生账号登录")
     studentOp.student_login("cyj", "888888")
     info = studentOp.getMyTask()
     INFO(info)
     expect = '没有发现作业任务'
     CHECK_POINT("内容显示正确", info == expect)
 def teststeps(self):
     STEP(1, "新建一个老师")
     data = [{"id": GSTORE['g_classid']}]
     classid = json.dumps(data)
     r = steacher.add_teacher('hwd', '汉武帝', 1, classid, '13600000000',
                              '*****@*****.**', '3209251983090987899')
     addret = r.json()
     self.addteacherid = addret['id']
     STEP(2, '验证参数返回值')
     CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
     STEP(4, '教师发布作业')
     teacherOp.teacher_login('hwd', '888888')
     task_name = teacherOp.pushtask0(0)
     expect = '请输入作业名称'
     CHECK_POINT("作业名称正确", task_name == expect)
 def teststeps(self):
     STEP(1, "新建一个老师")
     data = [{"id": GSTORE['g_classid']}]
     classid = json.dumps(data)
     r = steacher.add_teacher('hwd', '汉武帝', 1, classid, '13600000001',
                              '*****@*****.**', '3209251983090987899')
     addret = r.json()
     self.addteacherid = addret['id']
     STEP(2, '验证参数返回值')
     CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
     STEP(4, '查看试题')
     teacherOp.teacher_login('hwd', '888888')
     info = teacherOp.check_topic().strip()
     expect = "初中数学"
     CHECK_POINT("试题信息正确", expect == info)
예제 #11
0
 def teststeps(self):
     STEP(1, '新建一个学生')
     r = sstudent.add_student('cyj', '程咬金', 1, GSTORE['g_classid'],
                              13451810000)
     addret = r.json()
     self.addstudentid = addret['id']
     CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
     STEP(2, "学生账号登录")
     studentOp.student_login("cyj", "888888")
     info = studentOp.get_Personal_Info()
     INFO(info)
     expect = [
         'cyj', '13451810000', '程咬金', '七年级 高三25班', '白月学院00002', '广东省深圳市南山区'
     ]
     CHECK_POINT("内容显示正确", info == expect)
 def teststeps(self):
     STEP(1, "新建一个老师")
     data = [{"id": GSTORE['g_classid']}]
     classid = json.dumps(data)
     r = steacher.add_teacher('hwd', '汉武帝', 1, classid, '13600000000',
                              '*****@*****.**', '3209251983090987899')
     addret = r.json()
     self.addteacherid = addret['id']
     STEP(2, '验证参数返回值')
     CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
     STEP(4, '查看统计分析-任务(没有发布作业)')
     teacherOp.teacher_login('hwd', '888888')
     info = teacherOp.get_analysis_task()
     expect = ['初中数学', '0']
     CHECK_POINT("统计分析主页信息正确", info == expect)
 def teststeps(self):
     STEP(1, "教师登录")
     teacherOp.teacher_login('qsh', '888888')
     classinfo = teacherOp.getclassstudentinfo()
     INFO(classinfo)
     expect1 = ['尉迟恭']
     CHECK_POINT("班级列表学员正确", classinfo == expect1)
예제 #14
0
    def teststeps(self):
        STEP(1, '先列出学生')
        r = sstudent.student_list()
        listret = r.json()
        studentlist = listret["retlist"]
        STEP(2, '修改一个不存在的学生')
        r = sstudent.modify_student('0', '尉迟恭', '13451810000')
        addret = r.json()
        STEP(3, '验证参数返回值')
        CHECK_POINT('返回的retcode值=404', addret['retcode'] == 404)
        STEP(4, '检查系统数据')
        r = sstudent.student_list()
        listrest = r.json()
        expected = {"retlist": studentlist, "retcode": 0}

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #15
0
    def teststeps(self):
        STEP(1, '先列出老师')
        r = steacher.teacher_list()
        listret = r.json()
        teacherlist = listret["retlist"]
        STEP(2, '删除不存在的老师')
        r = steacher.del_teacher(0)
        addret = r.json()
        STEP(3, '验证参数返回值')
        CHECK_POINT('返回的retcode值=404', addret['retcode'] == 404)
        STEP(4, '检查系统数据')
        r = steacher.teacher_list()
        listrest = r.json()
        expected = {"retlist": teacherlist, "retcode": 0}

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #16
0
    def teststeps(self):
        STEP(1, '先列出学生')
        r = sstudent.student_list()
        listret = r.json()
        studentlist = listret["retlist"]
        STEP(2, '删除不存在的学生')
        r = sstudent.del_student(0)
        addret = r.json()
        STEP(4, '验证参数返回值')
        CHECK_POINT('返回的retcode值=404', addret['retcode'] == 404)
        STEP(5, '检查系统数据')
        r = sstudent.student_list()
        listrest = r.json()
        expected = {"retlist": studentlist, "retcode": 0}

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
 def teststeps(self):
     STEP(1, "新建一个老师")
     data = [{"id": GSTORE['g_classid']}]
     classid = json.dumps(data)
     r = steacher.add_teacher('hwd', '汉武帝', 1, classid, '13600000001',
                              '*****@*****.**', '3209251983090987899')
     addret = r.json()
     self.addteacherid = addret['id']
     STEP(2, '验证参数返回值')
     CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
     STEP(4, '个人信息')
     teacherOp.teacher_login('hwd', '888888')
     teacherOp.modify_Personal()
     info = teacherOp.get_Personal_Center()
     expect = ['hwd', '13600000001', '刘邦', '白月学院00002', '广东省深圳市南山区']
     CHECK_POINT("发布作业信息正确", info == expect)
예제 #18
0
    def teststeps(self):
        STEP(1, '先列出学生')
        r = sstudent.student_list()
        listret = r.json()
        studentlist = listret["retlist"]
        STEP(2, '添加一个学生')
        r = sstudent.add_student('yuchigong', '尉迟恭', 6, GSTORE['g_classid'],
                                 13451810000)
        addret = r.json()
        STEP(3, '验证参数返回值')
        CHECK_POINT('返回的retcode值=1', addret['retcode'] == 1)
        STEP(4, '检查系统数据')
        r = sstudent.student_list()
        listrest = r.json()
        expected = {"retlist": studentlist, "retcode": 0}

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #19
0
    def teststeps(self):
        STEP(1, '先列出客户')
        r = sclass.class_list()
        listret1 = r.json()
        classlist1 = listret1["retlist"]
        STEP(2, '删除不存在的班级')
        r = sclass.del_class(0)
        delret = r.json()
        INFO('')
        STEP(4, '验证返回值')
        CHECK_POINT('返回的retcode值=404', delret['retcode'] == 404)
        STEP(4, '检查系统数据')
        r = sclass.class_list()
        listrest = r.json()
        expected = {"gradeid": None, "retlist": classlist1, "retcode": 0}

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #20
0
 def teststeps(self):
     STEP(1, "新建一个学生")
     r = sstudent.add_student("yuchigong", "尉迟恭", 3, GSTORE["g_classid"],
                              13451810000)
     addret = r.json()
     self.addtid = addret["id"]
     STEP(2, "学生账号登录")
     studentOp.student_login("yuchigong", "888888")
     homeinfo = studentOp.gethomepageinfo()
     expect = ['尉迟恭', '白月学院00002', '0', '0']
     STEP(3, "验证主页信息")
     CHECK_POINT("主页信息显示正确", homeinfo == expect)
     STEP(4, "验证学生列表")
     classinfo = studentOp.getwrong_questionsinfo_none()
     expect1 = "您尚未有错题入库哦"
     INFO(expect1)
     CHECK_POINT("班级学生列表为空", classinfo == expect1)
예제 #21
0
    def teststeps(self):
        STEP(1, '先列出学生')
        r = sstudent.student_list()
        listret = r.json()
        studentlist = listret["retlist"]
        STEP(2, '添加一个学生')
        r = sstudent.add_student('cyj', '程咬金', 6, GSTORE['g_classid'],
                                 13451810000)
        addret = r.json()
        STEP(3, '删除新增的学生')
        r = sstudent.del_student(addret['id'])
        STEP(4, '验证参数返回值')
        CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
        STEP(5, '检查系统数据')
        r = sstudent.student_list()
        listrest = r.json()
        expected = {"retlist": studentlist, "retcode": 0}

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #22
0
    def teststeps(self):
        STEP(1, '先列出老师')
        r = steacher.teacher_list()
        listret = r.json()
        teacherlist = listret["retlist"]
        STEP(2, '修改不存在老师')
        data = [{"id": GSTORE['g_classid']}]
        classid = json.dumps(data)
        r = steacher.modify_teacher('0', '秦始皇', 1, classid, '13600000000',
                                    '*****@*****.**', '3209251983090987899')
        addret = r.json()
        STEP(3, '验证参数返回值')
        CHECK_POINT('返回的retcode值=1', addret['retcode'] == 1)
        STEP(4, '检查系统数据')
        r = steacher.teacher_list()
        listrest = r.json()
        expected = {"retlist": teacherlist, "retcode": 0}

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
    def teststeps(self):
        STEP(1, "新建一个老师")
        data = [{"id": GSTORE['g_classid']}]
        classid = json.dumps(data)
        r = steacher.add_teacher('hwd', '汉武帝', 1, classid, '13600000000',
                                 '*****@*****.**', '3209251983090987899')
        addret = r.json()
        self.addteacherid = addret['id']
        STEP(2, '验证参数返回值')
        CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
        STEP(3, '新建一个学生')
        r = sstudent.add_student('cyj', '程咬金', 1, GSTORE['g_classid'],
                                 13451810000)
        addret = r.json()
        self.addstudentid = addret['id']
        CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
        STEP(4, '教师发布作业')
        teacherOp.teacher_login('hwd', '888888')
        teacherOp.pushtask()

        STEP(5, "学生账号登录")
        studentOp.student_login("cyj", "888888")
        student_info = studentOp.submittask()
        INFO(student_info)
        STEP(6, "教师登录检查错题")
        time.sleep(2)
        teacherOp.teacher_login('hwd', '888888')
        info = teacherOp.get_analysis_error()
        expect = '共有3道错题上榜'
        CHECK_POINT('错题数目正确', info == expect)
예제 #24
0
 def teststeps(self):
     STEP(1, "新建一个老师")
     data = [{"id": GSTORE['g_classid']}]
     classid = json.dumps(data)
     r = steacher.add_teacher('hwd', '汉武帝', 1, classid, '13600000000',
                              '*****@*****.**', '3209251983090987899')
     addret = r.json()
     self.addteacherid = addret['id']
     STEP(2, '验证参数返回值')
     CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
     STEP(3, '新建一个学生')
     r = sstudent.add_student('cyj', '程咬金', 1, GSTORE['g_classid'],
                              13451810000)
     addret = r.json()
     self.addstudentid = addret['id']
     CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
     STEP('4', '有班主任')
     studentOp.student_login("cyj", "888888")
     info = studentOp.get_Personal_Info()
     INFO(info)
     expect = '初中数学老师:汉武帝'
     CHECK_POINT("班主任信息显示正确", info == expect)
예제 #25
0
    def teststeps(self):
        STEP(1, '先列出老师')
        r = steacher.teacher_list()
        listret = r.json()
        teacherlist = listret["retlist"]
        STEP(2, '添加一个老师')
        data = [{"id": GSTORE['g_classid']}]
        classid = json.dumps(data)
        r = steacher.add_teacher('hwd', '汉武帝', 1, classid, '13600000000',
                                 '*****@*****.**', '3209251983090987899')
        addret = r.json()
        STEP(3, '删除老师')
        r = steacher.del_teacher(addret['id'])
        delret = r.json()
        STEP(3, '验证参数返回值')
        CHECK_POINT('返回的retcode值=0', delret['retcode'] == 0)
        STEP(4, '检查系统数据')
        r = steacher.teacher_list()
        listrest = r.json()
        expected = {"retlist": teacherlist, "retcode": 0}

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #26
0
    def teststeps(self):
        STEP(1, '新增一个学生 ')
        r = sstudent.add_student('yuchigong', '尉迟恭', 6, GSTORE['g_classid'],
                                 13451810000)
        addret = r.json()
        self.addstudentret = addret['id']
        STEP(3, '验证参数返回值')
        CHECK_POINT('返回的retcode值=0', addret['retcode'] == 0)
        STEP(4, '检查系统数据')
        r = sstudent.student_list()
        listrest = r.json()
        expected = {
            "retlist": [{
                "classid": GSTORE['g_classid'],
                "realname": "尉迟恭",
                "username": "******",
                "phonenumber": "13451810000",
                "id": addret['id']
            }],
            "retcode":
            0
        }

        CHECK_POINT('返回的消息体数据正确', expected == listrest)
예제 #27
0
 def teststeps(self):
     STEP(1, "使用不存的教师账号登录")
     logininfo = teacherOp.teacher_loginno()
     expect = '登录失败 : 用户或者密码错误'
     CHECK_POINT("给出错误提示", logininfo == expect)
예제 #28
0
 def teststeps(self):
     STEP(1, "使用不存的学生账号登录")
     info = studentOp.student_loginno()
     expect = '登录失败 : 用户或者密码错误'
     CHECK_POINT("给出错误提示", info == expect)