如何跑场景用例呢

    1.数据关联方法
    在上一个接口的数据内定义id,在下一个接口内使用dependent进行关联,举例

    1. # 接口1数据
    2. {
    3. "ins":{
    4. "card_type":"4",
    5. "scan_reference":"test_$2current_subtle_unix_str",
    6. "type":"1"
    7. },
    8. "id": "test_submit_card_type",
    9. "outs":{"id": "0"},
    10. "tags":[
    11. "au"
    12. ],
    13. "title":"添加证件类型及scanReference"
    14. }
    1. # 接口2数据
    2. {
    3. "ins":{
    4. },
    5. "dependent": "test_submit_card_type",
    6. "outs":{"id": "0"},
    7. "tags":[
    8. "au"
    9. ],
    10. "title":"添加证件类型及scanReference"
    11. }

    可以无限循环依赖下去,但是需要记得,当一个接口的数据被多个地方依赖的时候,该接口数据就会被执行多次

    2.如何使用上个接口的数据呢
    在上一个接口对应的case内使用data_conversion.append_tmp ,如

    1. def test_01(self, data_conversion, data):
    2. ins, outs = data_conversion.get('ins', 'outs')
    3. response = self.send_post_request("submit_card_type", ins)
    4. self.check_response(response, outs)
    5. data_conversion.append_tmp(response)

    在下一个接口对应的数据内可使用如下运用

    1. $1JSON[dpTmp] #append_tmp的内容
    2. $1JSON[lastTmp] #上一条用例的数据