空手道赛跑者与执行挂钩侦听器 [英] Karate Runner with ExecutionHook listener

查看:56
本文介绍了空手道赛跑者与执行挂钩侦听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

@Peter-根据您先前查询的建议,我使用了ExecutionHooks来实现ReportPortal.在将所有必需的值从Runner传递到Base Runner时,我发现困难.以下是我的配置-

@Peter - As per your suggestion from my previous queries, I have used ExecutionHooks to implement ReportPortal. I am finding difficulties in passing all the required values from my Runner to Base Runner. Below is my configuration-

BaseRunner.java
Results results = Runner.parallel(tags,path,ScenarioName,Collections.singletonList(new 
ScenarioReporter()),threads,karateOutputPath);

Runner.java
@KarateOptions(tags = { "@Shakedown" },
features = "classpath:tests/Shakedown"
 )

我想了解如何传递方案名称",路径"和标签"之类的属性. ScenarioReporter()是我实现了Execution Hook的类.我有一个将提供所有详细信息的基础跑步者,以及一个将具有最少信息的普通跑步者.我刚刚提供了摘要,请不要介意是否存在一些语法错误.

I want to understand how can I pass the attributes like Scenario Name, path and tags. ScenarioReporter() is my class where I have implemented Execution Hook. I have a base runner that will have all the details and a normal runner that will have minimal information. I have just given snippets, please don't mind if there are some syntactical errors.

推荐答案

您不再需要注释,并且可以使用Runner上的新"builder"(流利接口)设置包括标签在内的所有参数. .请参阅文档: https://github.com/intuit/karate#parallel-execution

You don't need the annotations any more, and you can set all parameters including tags using the new "builder" (fluent interface) on the Runner. Refer the docs: https://github.com/intuit/karate#parallel-execution

Results results = Runner.path("classpath:some/package").tags("~@ignore").parallel(5);

因此从基类等中继承应该更容易.只需找出一种传递标签List<String>并使用它的方法即可.

So it should be easier to inherit from base classes etc. just figure out a way to pass a List<String> of tags and use it.

请小心此错误,已在0.9.6.RC1中修复: https://github.com/intuit/karate/issues/1061

Just watch out for this bug, fixed in 0.9.6.RC1: https://github.com/intuit/karate/issues/1061

这篇关于空手道赛跑者与执行挂钩侦听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆