- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
以下是我的 cucumber 模板 java 文件。
package some.template;
import cucumber.api.CucumberOptions;
//import cucumber.api.junit.Cucumber;
import cucumber.api.testng.CucumberFeatureWrapper;
import cucumber.api.testng.PickleEventWrapper;
import cucumber.api.testng.TestNGCucumberRunner;
//import org.junit.runner.RunWith;
import org.testng.IRetryAnalyzer;
import org.testng.ITestResult;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
//@RunWith(Cucumber.class)
@CucumberOptions(
glue = "com.fifa.stepdefs",
features = {"target/parallel/features/[CUCABLE:FEATURE].feature"},
plugin = {"json:target/cucumber-report/[CUCABLE:RUNNER].json"}
)
public class CucableJavaTemplate implements IRetryAnalyzer {
private int count = 0;
private static int maxTry = 3;
@Override
public boolean retry(ITestResult iTestResult) {
if (!iTestResult.isSuccess()) { ;//Check if test not succeed
if (count < maxTry) { //Check if maxtry count is reached
count++; //Increase the maxTry count by 1
iTestResult.setStatus(ITestResult.FAILURE); //Mark test as failed
return true; //Tells TestNG to re-run the test
} else {
iTestResult.setStatus(ITestResult.FAILURE); //If maxCount reached,test marked as failed
}
} else {
iTestResult.setStatus(ITestResult.SUCCESS); //If test passes, TestNG marks it as passed
}
return false;
}
private TestNGCucumberRunner testNGCucumberRunner;
@BeforeClass(alwaysRun = true)
public void setUpClass() throws Exception {
System.out.println("Before Scenario ****");
testNGCucumberRunner = new TestNGCucumberRunner(this.getClass());
}
@Test(groups = "cucumber", description = "Runs Cucumber Scenarios", dataProvider = "scenarios",retryAnalyzer = CucableJavaTemplate.class)
public void scenario(PickleEventWrapper pickleEvent, CucumberFeatureWrapper cucumberFeature) throws Throwable {
testNGCucumberRunner.runScenario(pickleEvent.getPickleEvent());
}
@DataProvider
public Object[][] scenarios() {
return testNGCucumberRunner.provideScenarios();
}
@AfterClass(alwaysRun = true)
public void tearDownClass() throws Exception {
System.out.println("After Scenario ****");
testNGCucumberRunner.finish();
}
}
当我运行 mvn clean verify 时,会发生以下情况:
[Utils] [错误] [错误] java.lang.IllegalArgumentException:不是文件或目录:/projectpath/target/parallel/features/[CUCABLE:FEATURE].feature
最佳答案
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
我想我已经明白了这一点。添加了上述插件,现在将跳过这些测试。
关于java - Cucable插件: How can I avoid running the '[CUCABLE:FEATURE].feature' (java template file)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56531151/
好的,所以我刚刚开始尝试将 BDD 用于我们正在进行的一些新开发,并且我为日志查看器功能写了一个这样的故事: 故事:用户查看工作流执行日志 As a user I want to review the
我正在尝试使用 TensorFlow 编写一个简单的深度机器学习模型。我正在使用我在 Excel 中制作的玩具数据集,只是为了让模型工作并接受数据。我的代码如下: import pandas as p
我是机器学习的初学者。我很困惑如何将数据集的不同特征组合成一个特征。 例如,我在 Python Pandas 数据框架中有一个数据集,其特征如下: movie unknown actio
我正在做一项功能调查,为一个研究项目做准备。 说出难以优化的主流语言或语言功能,以及为什么该功能值得或不值得付出代价,或者只是用轶事证据驳斥我下面的理论。在有人将其标记为主观之前,我要求提供语言或功能
这是一个有点哲学问题。我正在为我的软件添加一个小功能,我认为大多数用户都会使用它,但他们使用该软件的次数可能只有 10%。换句话说,该软件没有它 3 个月就很好,但是有 4 或 5 个用户要求它,我同
我开始使用 git flow。我创建了一个功能: git flow feature start eval 然后我做了一些工作并添加并提交了更改: git add (files) git commit
pull 请求是内置在 Git 中还是 GitHub 虚构的概念? 最佳答案 概念和该概念的实现之间存在区别。 “请求 pull ”的概念是 DVCS 系统有别于传统版本控制系统的部分原因。使用传统的
研究该主题,可以找到作者使用“词袋”模型进行图像分类/检索的论文,而其他人则使用“特征袋”模型进行类似任务。 尽管我对所涉及的方法有基本的了解(检测和提取视觉词、构建视觉词典、使用机器学习训练分类器)
有时一首歌会有不止一个艺术家。例如,Jay-z 的新歌“A Star is Born”以艺术家 Cole 为主角,因此在目录中会被列为“Jay-z(以 Cole 为主角)- A Star is Bor
This question already has an answer here: How do I 'pass down' feature flags to subdependencies in C
This question and answer演示当使用 scikit-learn 的专用特征选择例程之一执行特征选择时,可以按如下方式检索所选特征的名称: np.asarray(vectorize
例如,我定义了 2 个没有依赖关系的特性: [features] default = [] py2 = [] py3 = [] 基于选定的功能 (--features py3) 我想为依赖项 (cpy
我正在完成一个小型 Wordpress“杂志”类型网站的定制。由于我是 PHP 的新手,我遇到了一些需要帮助的问题。 我有一个“首屏,主要特色区域,包含 3 张图片”和帖子标题的小摘录。在首屏下,我在
我已经为 Windows 10 创建了一个 C# 应用程序。它是通过使用 WIX 生成的 MSI 安装的。但是,当它为一台机器上的一个用户安装时,并非出于我的意图,它不会为同一台机器上的其他用户安装。
在 ArcGIS Runtime Java API 文档中,有一个 identifyLayersAsync() method . 来自文档: Asynchronously identifies the
我是 GIT 和 GIT-Flow 的新手。 [在我的 python-django 项目上] 我做了什么: git flow feature start new_feature # perform s
我是 Angular 的新手,我正在尝试使用 Angular/d3 构建德国 map 。 map 数据存储在 Topojson 文件 plz_map_ger.json 中: { "type": "To
我一直在使用 503 服务不可用 或停机维护。 但是一些 http 客户端库,即 axios 将 503 视为可重试错误。 如果由于高负载而产生响应,则重试它是有意义的,但 503 也适合功能切换情况
要列出您希望包含在生成的 features.xml 中的一堆包,文档说: bundles File A properties file that contains a list of bund
我在 Visual Studio 2010 下开发 C# T4 预处理模板时遇到以下编译错误: A template containing a class feature must end with
我是一名优秀的程序员,十分优秀!