Can we append custom text with match in Karate DSL like * match city == 'Pune', 'City Name matching'

huangapple go评论61阅读模式
英文:

Can we append custom text with match in Karate DSL like * match city == 'Pune', 'City Name matching'

问题

可以在Karate DSL中像这样附加自定义文本与匹配吗:

  • match city == 'Pune', '与城市名匹配'

在这里,它试图匹配整个文本'Pune City Name matching'。但我想只匹配'Pune'并附加文本'City Name matching'。

类似于以下方式:
Assert.assertEquals(city, "Pune", "城市名检查已完成");

英文:

Can we append custom text with match in Karate DSL like:

  • match city == 'Pune', 'City Name matching'

Here, it is trying to match whole text 'Pune City Name matching'. But I want to match only 'Pune' and need to append text like 'City Name matching'

Something like below:
Assert.assertEquals(city, "Pune", "City Name Check Completed");

答案1

得分: 1

这不受支持。您可以查看karate.fail()以满足非常定制的需求或贡献代码。还可以参考:https://stackoverflow.com/a/54108755/143475

英文:

No this is not supported. You can look at karate.fail() for very custom needs or contribute code. Also see: https://stackoverflow.com/a/54108755/143475

huangapple
  • 本文由 发表于 2023年5月10日 15:12:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76215792.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定