大佬教程收集整理的这篇文章主要介绍了我想检查一个字符串是否在我的空手道场景中的预定义列表中,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
如果我为每个排列创建单独的场景,这些场景就可以工作,但是我想避免多次读取文件,因为它可能会变成一个相当大的文件。
Scenario Outline: Mass_A is correct for STD and PCE
* def row =
"""
{
Artikeltyp: '<Artikeltyp>',MinBestellmengeEinheit: '<MinBestellmengeEinheit>',Mass_A: '<Mass_A>'
}
"""
* def tempArtikeltyp = '<Artikeltyp>'
* def tempMinBestellmengeEinheit = '<MinBestellmengeEinheit>'
* def tempMass_A = '<Mass_A>'
* def ListMinBestTypes = ['PCE','PR','DZN']
* def expected = (tempArtikeltyp == 'STD' && (karate.match(ListMinBestTypes,tempMinBestellmengeEinheit).pass) && (tempMass_A.length <= 0)) ? 'Mass_A is NOT populated for STD and PCE' : 'Mass_A is correct for STD and PCE'
* match expected == karate.info.scenarioname
Examples:
| read('input.csv')|
任何指导将不胜感激。
这是一个建议。请重新考虑您的整个方法。从 CSV 文件开始,将其转换为 JSON,然后运行您想要的所有排列或组合。下面的例子:
Scenario:
* def isValid = function(X){ return true }
* def data = read('input.csv')
* match each data == '#? isValid(_)'
,
#noinspection CucumberTableInspection
Feature: Artikelcsv file
Scenario Outline: Mass_A is correct for <Artikeltyp> and <MinBestellmengeEinheit>
* def tempArtikeltyp = '<Artikeltyp>'
* def tempMinBestellmengeEinheit = '<MinBestellmengeEinheit>'
* def tempMass_A = '<Mass_A>'
# if (condition ? true : falsE)
* def expected = ((tempArtikeltyp == 'ERA' || tempArtikeltyp == 'STD' || tempArtikeltyp == 'ERB') && (tempMinBestellmengeEinheit == 'PR' || tempMinBestellmengeEinheit == 'PCE' || tempMinBestellmengeEinheit == 'DZN' || tempMinBestellmengeEinheit == 'SET') && (tempMass_A.length <= 0)) ? 'Mass_A is Not correct for <Artikeltyp> and <MinBestellmengeEinheit>' : 'Mass_A is correct for <Artikeltyp> and <MinBestellmengeEinheit>'
* match expected == karate.info.scenarioName
Examples:
| read('input.csv')|
以上是大佬教程为你收集整理的我想检查一个字符串是否在我的空手道场景中的预定义列表中全部内容,希望文章能够帮你解决我想检查一个字符串是否在我的空手道场景中的预定义列表中所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。