Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【严重bug】测试用例的前置步骤中存在两个测试场景,入参时出现异常 #116

Open
huc141 opened this issue May 13, 2023 · 2 comments

Comments

@huc141
Copy link

huc141 commented May 13, 2023

复现步骤:

1、创建用例A:该用例A的【前置步骤】为一个python脚本,该脚本返回一个6位随机数code,【接口请求】里向接口api01发送post请求,请求格式json,请求内容为前置步骤中返回的6位随机数codeA,接口响应一个唯一 id-A;
请求:{ "api":"MES.Tunnel.CreateModel", "args":[ { "code":"codeA" }, { "token":"WLNMwPvFoT4Z=" } ], "cst":1683988554000, "rid":0, "service":"MES", "ttl":30000 }

2、创建用例B:该用例B的【前置步骤】为同一个python脚本,该脚本返回一个6位随机数code,【接口请求】里向接口api01发送post请求,请求格式json,请求内容为前置步骤中返回的6位随机数codeB,接口响应一个唯一 id-B;
请求:{ "api":"MES.Tunnel.CreateModel", "args":[ { "code":"codeB" }, { "token":"WLNMwPvFoT4Z=" } ], "cst":1683988554000, "rid":0, "service":"MES", "ttl":30000 }

3、创建用例C:该用例C的【前置步骤】类型为测试场景,分别是用例A和用例B,返回值分别是用例A和用例B的: A.id-A、B.id-B,【接口请求】里向接口api02发送post请求,请求格式json,请求内容为前置步骤中返回的A.id-A、B.id-B;

{ "api": "MES.CreateProcessChain", "args": [ { "category": "pcba", "name": "Auto_PCBA生产工序链1683986567", "supportedModels": [ { "modelId": ${A.id-A}, "modelLabel": "L3G09-EUX" }, { "modelId": ${B.id-B}, "modelLabel": "N29C04" } ] }, { "token": "WLNMwPvFoT4ZZyZN" } ], "cst": 1683986567000, "rid": 0, "service": "MES", "ttl": 30000 }

然而,执行用例C的时候,
用例C的执行日志显示:第一个前置步骤用例A执行正常,入参codeA;
第二个前置步骤用例B执行异常,入参仍为codeA!导致用例C执行失败。
(用例A和用例C单独执行是正常的)

@huc141
Copy link
Author

huc141 commented May 13, 2023

image

image

@wuranxu
Copy link
Owner

wuranxu commented Jun 21, 2023

暂时可以通过区分python脚本返回值(不要都叫code)解决此问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants