在 Jenkins 上运行时,groovy 脚本无法识别测试步骤的断言

问题描述

对于测试用例中的测试步骤,我有一个属性内容”JsonPath 存在匹配断言。它是一个 REST 服务,并具有如下断言:

$.recommendedFood[0].calories

我有以下代码 #include <string.h> int countConsistentStrings(char *allowed,char **words,int wordsSize) { int count = 0; for(int i = 0; i < wordsSize; i++) { char *word = words[i]; if(word[strspn(word,allowed)] == '\0') count++; } return count; }

当我打印出在 SOAP UI(本地)上运行 groovy 脚本时,这很好用def assertsize = testStep.getAssertionList().size() 输出为 1

但在Jenkins上运行时一样,大小打印为0(脚本没有变化,但它不识别测试步骤。

我也看到错误 log.info (testStep.getAssertionList().size())

我尝试了解决方案:SoapUI Testrunner giving error about TestAssertionRegistry

https://community.smartbear.com/t5/API-Functional-Security-Testing/Maven-Soapui-Plugin-with-json-assertions-does-not-work-well-in/td-p/106777

但无法解决问题。有什么解决方案或修复方法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)