如何解决在 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
但无法解决问题。有什么解决方案或修复方法吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。