{
  "uid" : "bab371eff6794f2b",
  "name" : "正向用例",
  "fullName" : "test_case.test_mirZhang.test_bpm.TestBPM#test_bpm",
  "historyId" : "526f1fd519b78b4955668d6cfd277048",
  "time" : {
    "start" : 1716272637956,
    "stop" : 1716272638139,
    "duration" : 183
  },
  "status" : "failed",
  "statusMessage" : "AssertionError: assert '添加组织成功' == '添加组织成功！'\n  \n  - 添加组织成功！\n  ?       -\n  + 添加组织成功",
  "statusTrace" : "self = <InterfaceAutoTest.test_case.test_mirZhang.test_bpm.TestBPM object at 0x0000014F17992C70>\nreq_fix = <InterfaceAutoTest.requests_method.requsts_method.RequestsMethod object at 0x0000014F1923AE50>\ndb_fix = <InterfaceAutoTest.common.db.DB object at 0x0000014F1912F2B0>, module_name = '组织管理', api_name = '添加组织', case_title = '正向用例'\ncase_level = '高', method = 'POST', url = 'http://120.46.172.186:8080/api/org/v1/org/addOrg', mime = 'json'\ncase_data = {'code': 'test_add_org', 'demId': '1792803475629817856', 'exceedLimitNum': 0, 'grade': '', ...}\nexpect_data = {'message': '添加组织成功'}\nsql_data = {'delete': 'DELETE FROM uc_org WHERE `CODE_`=\"test_add_org\";', 'select': 'select ID_ FROM uc_demension WHERE `CODE_`=\"api_auto_test_add_dem\";'}\nsql_type = 'select|delete', update_key = 'demId'\n\n    @allure.epic(\"BPM系统-老张\")  # 测试系统的名称\n    # @allure.feature(\"模块名称\")  # 模块名称\n    # @allure.story(\"接口名称\")    # 接口\n    # @allure.title(\"标题名称\")    # 用例标题\n    # @allure.severity(\"用例的等级\")   # 用例等级\n    @pytest.mark.parametrize(\"module_name, api_name, case_title, case_level, method, url, mime, case_data, expect_data, sql_data, sql_type, update_key\", excel.get_data())\n    def test_bpm(self, req_fix, db_fix, module_name, api_name, case_title, case_level, method, url, mime, case_data, expect_data, sql_data, sql_type, update_key):\n        # 给allure输出的报告添加内容\n        allure.dynamic.feature(module_name)\n        allure.dynamic.story(api_name)\n        allure.dynamic.title(case_title)\n        allure.dynamic.severity(case_level)\n    \n        # 判断sql语句类型是否为select\n        if sql_type == \"select\":\n            # 使用DB类对象调用select_func方法执行查询的sql语句，并接收查询结果\n            select_result = db_fix.select_func(sql_data)\n            # 将查询结果更新到用例数据中\n            case_data[update_key] = select_result\n            # 将更新之后的用例数据发送给服务器。\n    \n        # 判断sql语句的类型是否为delete\n        elif sql_type == \"delete\":\n            # 使用DB类对象调用delete_func方法执行删除的sql语句\n            db_fix.delete_func(sql_data)\n            # 将数据库中的数据删除完之后，再发送请求\n    \n        # 判断sql语句类型是否为select|delete或者为delete|select\n        elif sql_type == \"select|delete\" or sql_type == \"delete|select\":\n            # 使用DB类对象调用delete_func方法执行删除的sql语句\n            db_fix.delete_func(sql_data[\"delete\"])\n            # 使用DB类对象调用select_func方法执行查询的sql语句，并接收查询结果\n            select_result = db_fix.select_func(sql_data[\"select\"])\n            # 将查询结果更新到用例数据中\n            case_data[update_key] = select_result\n            # 将更新之后的用例数据发送给服务器。\n    \n        # 使用RequestsMethod对象发送请求\n        res = req_fix.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)\n        # 断言\n        try:\n            for key in expect_data:\n                assert expect_data[key] == res.json().get(key)\n        except AssertionError as e:\n            logging.error(f\"断言失败， 用例数据为{case_data}, 期望数据为:{expect_data}, 服务器返回的数据为：{res.text}\")\n>           raise e\n\ntest_case\\test_mirZhang\\test_bpm.py:66: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <InterfaceAutoTest.test_case.test_mirZhang.test_bpm.TestBPM object at 0x0000014F17992C70>\nreq_fix = <InterfaceAutoTest.requests_method.requsts_method.RequestsMethod object at 0x0000014F1923AE50>\ndb_fix = <InterfaceAutoTest.common.db.DB object at 0x0000014F1912F2B0>, module_name = '组织管理', api_name = '添加组织', case_title = '正向用例'\ncase_level = '高', method = 'POST', url = 'http://120.46.172.186:8080/api/org/v1/org/addOrg', mime = 'json'\ncase_data = {'code': 'test_add_org', 'demId': '1792803475629817856', 'exceedLimitNum': 0, 'grade': '', ...}\nexpect_data = {'message': '添加组织成功'}\nsql_data = {'delete': 'DELETE FROM uc_org WHERE `CODE_`=\"test_add_org\";', 'select': 'select ID_ FROM uc_demension WHERE `CODE_`=\"api_auto_test_add_dem\";'}\nsql_type = 'select|delete', update_key = 'demId'\n\n    @allure.epic(\"BPM系统-老张\")  # 测试系统的名称\n    # @allure.feature(\"模块名称\")  # 模块名称\n    # @allure.story(\"接口名称\")    # 接口\n    # @allure.title(\"标题名称\")    # 用例标题\n    # @allure.severity(\"用例的等级\")   # 用例等级\n    @pytest.mark.parametrize(\"module_name, api_name, case_title, case_level, method, url, mime, case_data, expect_data, sql_data, sql_type, update_key\", excel.get_data())\n    def test_bpm(self, req_fix, db_fix, module_name, api_name, case_title, case_level, method, url, mime, case_data, expect_data, sql_data, sql_type, update_key):\n        # 给allure输出的报告添加内容\n        allure.dynamic.feature(module_name)\n        allure.dynamic.story(api_name)\n        allure.dynamic.title(case_title)\n        allure.dynamic.severity(case_level)\n    \n        # 判断sql语句类型是否为select\n        if sql_type == \"select\":\n            # 使用DB类对象调用select_func方法执行查询的sql语句，并接收查询结果\n            select_result = db_fix.select_func(sql_data)\n            # 将查询结果更新到用例数据中\n            case_data[update_key] = select_result\n            # 将更新之后的用例数据发送给服务器。\n    \n        # 判断sql语句的类型是否为delete\n        elif sql_type == \"delete\":\n            # 使用DB类对象调用delete_func方法执行删除的sql语句\n            db_fix.delete_func(sql_data)\n            # 将数据库中的数据删除完之后，再发送请求\n    \n        # 判断sql语句类型是否为select|delete或者为delete|select\n        elif sql_type == \"select|delete\" or sql_type == \"delete|select\":\n            # 使用DB类对象调用delete_func方法执行删除的sql语句\n            db_fix.delete_func(sql_data[\"delete\"])\n            # 使用DB类对象调用select_func方法执行查询的sql语句，并接收查询结果\n            select_result = db_fix.select_func(sql_data[\"select\"])\n            # 将查询结果更新到用例数据中\n            case_data[update_key] = select_result\n            # 将更新之后的用例数据发送给服务器。\n    \n        # 使用RequestsMethod对象发送请求\n        res = req_fix.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)\n        # 断言\n        try:\n            for key in expect_data:\n>               assert expect_data[key] == res.json().get(key)\nE               AssertionError: assert '添加组织成功' == '添加组织成功！'\nE                 \nE                 - 添加组织成功！\nE                 ?       -\nE                 + 添加组织成功\n\ntest_case\\test_mirZhang\\test_bpm.py:63: AssertionError",
  "flaky" : false,
  "newFailed" : false,
  "beforeStages" : [ ],
  "testStage" : {
    "status" : "failed",
    "statusMessage" : "AssertionError: assert '添加组织成功' == '添加组织成功！'\n  \n  - 添加组织成功！\n  ?       -\n  + 添加组织成功",
    "statusTrace" : "self = <InterfaceAutoTest.test_case.test_mirZhang.test_bpm.TestBPM object at 0x0000014F17992C70>\nreq_fix = <InterfaceAutoTest.requests_method.requsts_method.RequestsMethod object at 0x0000014F1923AE50>\ndb_fix = <InterfaceAutoTest.common.db.DB object at 0x0000014F1912F2B0>, module_name = '组织管理', api_name = '添加组织', case_title = '正向用例'\ncase_level = '高', method = 'POST', url = 'http://120.46.172.186:8080/api/org/v1/org/addOrg', mime = 'json'\ncase_data = {'code': 'test_add_org', 'demId': '1792803475629817856', 'exceedLimitNum': 0, 'grade': '', ...}\nexpect_data = {'message': '添加组织成功'}\nsql_data = {'delete': 'DELETE FROM uc_org WHERE `CODE_`=\"test_add_org\";', 'select': 'select ID_ FROM uc_demension WHERE `CODE_`=\"api_auto_test_add_dem\";'}\nsql_type = 'select|delete', update_key = 'demId'\n\n    @allure.epic(\"BPM系统-老张\")  # 测试系统的名称\n    # @allure.feature(\"模块名称\")  # 模块名称\n    # @allure.story(\"接口名称\")    # 接口\n    # @allure.title(\"标题名称\")    # 用例标题\n    # @allure.severity(\"用例的等级\")   # 用例等级\n    @pytest.mark.parametrize(\"module_name, api_name, case_title, case_level, method, url, mime, case_data, expect_data, sql_data, sql_type, update_key\", excel.get_data())\n    def test_bpm(self, req_fix, db_fix, module_name, api_name, case_title, case_level, method, url, mime, case_data, expect_data, sql_data, sql_type, update_key):\n        # 给allure输出的报告添加内容\n        allure.dynamic.feature(module_name)\n        allure.dynamic.story(api_name)\n        allure.dynamic.title(case_title)\n        allure.dynamic.severity(case_level)\n    \n        # 判断sql语句类型是否为select\n        if sql_type == \"select\":\n            # 使用DB类对象调用select_func方法执行查询的sql语句，并接收查询结果\n            select_result = db_fix.select_func(sql_data)\n            # 将查询结果更新到用例数据中\n            case_data[update_key] = select_result\n            # 将更新之后的用例数据发送给服务器。\n    \n        # 判断sql语句的类型是否为delete\n        elif sql_type == \"delete\":\n            # 使用DB类对象调用delete_func方法执行删除的sql语句\n            db_fix.delete_func(sql_data)\n            # 将数据库中的数据删除完之后，再发送请求\n    \n        # 判断sql语句类型是否为select|delete或者为delete|select\n        elif sql_type == \"select|delete\" or sql_type == \"delete|select\":\n            # 使用DB类对象调用delete_func方法执行删除的sql语句\n            db_fix.delete_func(sql_data[\"delete\"])\n            # 使用DB类对象调用select_func方法执行查询的sql语句，并接收查询结果\n            select_result = db_fix.select_func(sql_data[\"select\"])\n            # 将查询结果更新到用例数据中\n            case_data[update_key] = select_result\n            # 将更新之后的用例数据发送给服务器。\n    \n        # 使用RequestsMethod对象发送请求\n        res = req_fix.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)\n        # 断言\n        try:\n            for key in expect_data:\n                assert expect_data[key] == res.json().get(key)\n        except AssertionError as e:\n            logging.error(f\"断言失败， 用例数据为{case_data}, 期望数据为:{expect_data}, 服务器返回的数据为：{res.text}\")\n>           raise e\n\ntest_case\\test_mirZhang\\test_bpm.py:66: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <InterfaceAutoTest.test_case.test_mirZhang.test_bpm.TestBPM object at 0x0000014F17992C70>\nreq_fix = <InterfaceAutoTest.requests_method.requsts_method.RequestsMethod object at 0x0000014F1923AE50>\ndb_fix = <InterfaceAutoTest.common.db.DB object at 0x0000014F1912F2B0>, module_name = '组织管理', api_name = '添加组织', case_title = '正向用例'\ncase_level = '高', method = 'POST', url = 'http://120.46.172.186:8080/api/org/v1/org/addOrg', mime = 'json'\ncase_data = {'code': 'test_add_org', 'demId': '1792803475629817856', 'exceedLimitNum': 0, 'grade': '', ...}\nexpect_data = {'message': '添加组织成功'}\nsql_data = {'delete': 'DELETE FROM uc_org WHERE `CODE_`=\"test_add_org\";', 'select': 'select ID_ FROM uc_demension WHERE `CODE_`=\"api_auto_test_add_dem\";'}\nsql_type = 'select|delete', update_key = 'demId'\n\n    @allure.epic(\"BPM系统-老张\")  # 测试系统的名称\n    # @allure.feature(\"模块名称\")  # 模块名称\n    # @allure.story(\"接口名称\")    # 接口\n    # @allure.title(\"标题名称\")    # 用例标题\n    # @allure.severity(\"用例的等级\")   # 用例等级\n    @pytest.mark.parametrize(\"module_name, api_name, case_title, case_level, method, url, mime, case_data, expect_data, sql_data, sql_type, update_key\", excel.get_data())\n    def test_bpm(self, req_fix, db_fix, module_name, api_name, case_title, case_level, method, url, mime, case_data, expect_data, sql_data, sql_type, update_key):\n        # 给allure输出的报告添加内容\n        allure.dynamic.feature(module_name)\n        allure.dynamic.story(api_name)\n        allure.dynamic.title(case_title)\n        allure.dynamic.severity(case_level)\n    \n        # 判断sql语句类型是否为select\n        if sql_type == \"select\":\n            # 使用DB类对象调用select_func方法执行查询的sql语句，并接收查询结果\n            select_result = db_fix.select_func(sql_data)\n            # 将查询结果更新到用例数据中\n            case_data[update_key] = select_result\n            # 将更新之后的用例数据发送给服务器。\n    \n        # 判断sql语句的类型是否为delete\n        elif sql_type == \"delete\":\n            # 使用DB类对象调用delete_func方法执行删除的sql语句\n            db_fix.delete_func(sql_data)\n            # 将数据库中的数据删除完之后，再发送请求\n    \n        # 判断sql语句类型是否为select|delete或者为delete|select\n        elif sql_type == \"select|delete\" or sql_type == \"delete|select\":\n            # 使用DB类对象调用delete_func方法执行删除的sql语句\n            db_fix.delete_func(sql_data[\"delete\"])\n            # 使用DB类对象调用select_func方法执行查询的sql语句，并接收查询结果\n            select_result = db_fix.select_func(sql_data[\"select\"])\n            # 将查询结果更新到用例数据中\n            case_data[update_key] = select_result\n            # 将更新之后的用例数据发送给服务器。\n    \n        # 使用RequestsMethod对象发送请求\n        res = req_fix.request_all(req_method=method, req_url=url, req_mime=mime, case_data=case_data)\n        # 断言\n        try:\n            for key in expect_data:\n>               assert expect_data[key] == res.json().get(key)\nE               AssertionError: assert '添加组织成功' == '添加组织成功！'\nE                 \nE                 - 添加组织成功！\nE                 ?       -\nE                 + 添加组织成功\n\ntest_case\\test_mirZhang\\test_bpm.py:63: AssertionError",
    "steps" : [ ],
    "attachments" : [ {
      "uid" : "cf084e108e2df99e",
      "name" : "log",
      "source" : "cf084e108e2df99e.txt",
      "type" : "text/plain",
      "size" : 1193
    } ],
    "parameters" : [ ],
    "hasContent" : true,
    "stepsCount" : 0,
    "attachmentsCount" : 1,
    "shouldDisplayMessage" : true
  },
  "afterStages" : [ ],
  "labels" : [ {
    "name" : "feature",
    "value" : "组织管理"
  }, {
    "name" : "story",
    "value" : "添加组织"
  }, {
    "name" : "severity",
    "value" : "高"
  }, {
    "name" : "epic",
    "value" : "BPM系统-老张"
  }, {
    "name" : "parentSuite",
    "value" : "test_case.test_mirZhang"
  }, {
    "name" : "suite",
    "value" : "test_bpm"
  }, {
    "name" : "subSuite",
    "value" : "TestBPM"
  }, {
    "name" : "host",
    "value" : "LAPTOP-O09782E1"
  }, {
    "name" : "thread",
    "value" : "8968-MainThread"
  }, {
    "name" : "framework",
    "value" : "pytest"
  }, {
    "name" : "language",
    "value" : "cpython3"
  }, {
    "name" : "package",
    "value" : "test_case.test_mirZhang.test_bpm"
  }, {
    "name" : "resultFormat",
    "value" : "allure2"
  } ],
  "parameters" : [ {
    "name" : "api_name",
    "value" : "'添加组织'"
  }, {
    "name" : "case_data",
    "value" : "{'code': 'test_add_org', 'demId': '1792803475629817856', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}"
  }, {
    "name" : "case_level",
    "value" : "'高'"
  }, {
    "name" : "case_title",
    "value" : "'正向用例'"
  }, {
    "name" : "expect_data",
    "value" : "{'message': '添加组织成功'}"
  }, {
    "name" : "method",
    "value" : "'POST'"
  }, {
    "name" : "mime",
    "value" : "'json'"
  }, {
    "name" : "module_name",
    "value" : "'组织管理'"
  }, {
    "name" : "sql_data",
    "value" : "{'select': 'select ID_ FROM uc_demension WHERE `CODE_`=\"api_auto_test_add_dem\";', 'delete': 'DELETE FROM uc_org WHERE `CODE_`=\"test_add_org\";'}"
  }, {
    "name" : "sql_type",
    "value" : "'select|delete'"
  }, {
    "name" : "update_key",
    "value" : "'demId'"
  }, {
    "name" : "url",
    "value" : "'http://120.46.172.186:8080/api/org/v1/org/addOrg'"
  } ],
  "links" : [ ],
  "hidden" : true,
  "retry" : true,
  "extra" : {
    "categories" : [ ],
    "tags" : [ ]
  },
  "source" : "bab371eff6794f2b.json",
  "parameterValues" : [ "'添加组织'", "{'code': 'test_add_org', 'demId': '1792803475629817856', 'exceedLimitNum': 0, 'grade': '', 'limitNum': 0, 'name': '测试添加的组织', 'nowNum': 0, 'orderNo': 0, 'parentId': '0'}", "'高'", "'正向用例'", "{'message': '添加组织成功'}", "'POST'", "'json'", "'组织管理'", "{'select': 'select ID_ FROM uc_demension WHERE `CODE_`=\"api_auto_test_add_dem\";', 'delete': 'DELETE FROM uc_org WHERE `CODE_`=\"test_add_org\";'}", "'select|delete'", "'demId'", "'http://120.46.172.186:8080/api/org/v1/org/addOrg'" ]
}