Example #1
0
    def test_setup(self, datayaml):
        """
        首页---设置操作测试
        :param datayaml: 加载login_data登录测试数据
        :return:
        """
        log = Log()
        log.info("当前执行测试用例ID-> {0} ; 测试点-> {1}".format(datayaml['id'], datayaml['detail']))

        # 调用登录方法
        self.user_login_verify(ph, pwd)

        # 调用设置接口
        self.setup_test(datayaml['data']['name'], datayaml['data']['sign'])
        po = setup(self.driver)
        if datayaml['screenshot'] == 'name_empty':
            log.info("检查点-> {0}".format(po.nick_error_hint()))
            self.assertEqual(po.nick_error_hint(), datayaml['check'][0]), "返回实际结果是->: {0}".format(po.nick_error_hint())
            log.info("返回实际结果是->: {0}".format(po.nick_error_hint()))
            screenshot.insert_img(self.driver, datayaml['screenshot'] + '.jpg')
            self.exit_login_check()
        else:
            po.dig_check_setup()
            log.info("检查点-> {0}和{1}".format(po.nick_setup_success_hint(), po.sign_setup_success_hint()))
            self.assertEqual(po.nick_setup_success_hint(), datayaml['check'][0]), "返回实际结果是->: {0}".format(
                po.nick_setup_success_hint())
            self.assertEqual(po.sign_setup_success_hint(), datayaml['check'][1]), "返回实际结果是->: {0}".format(
                po.sign_setup_success_hint())
            log.info("返回实际结果是->: {0}和{1}".format(po.nick_setup_success_hint(), po.sign_setup_success_hint()))
            screenshot.insert_img(self.driver, datayaml['screenshot'] + '.jpg')
            self.exit_login_check()
Example #2
0
 def setup_test(self, *args):
     setup(self.driver).dig_setup(*args)