问题标签 [cucumber-junit]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1049 浏览

cucumber - 黄瓜小黄瓜中的相同步骤定义

我有以下小黄瓜:

" I select the option to proceed Next" 出现 3 次。这应该如何写在 Step Definitions Java 类文件中?

0 投票
6 回答
13151 浏览

java - Rerunning failed cucumber tests using cucumber-jvm

I have a Cucumber-JVM, JUnit, Selenium setup. I initiate the run by running RunSmokeTests.java using JUnit within Eclipse. I have also set up a maven profile to run the tests from command line, and possibly Jenkins in the future.

When the tests are run then some of them may fail sometimes, mainly due to the application taking longer than expected. I would then have to re-run these scenarios. At the moment I run them by manually attaching @rerun tag to the ones that failed and then running RunReruns.java, which is similar to RunSmokeTest.java but with @rerun tag.

With the increasing number of automated tests it is time consuming to tag the tests and start the run and clear the tags. Is there a automated way with Cucumber-JVM to re-run failed tests?

RunSmokeTests.java

Maven snippet:

0 投票
3 回答
55747 浏览

java - 如何使用 maven 运行 cucumber-jvm 测试

如何使用 Maven 在以下位置运行黄瓜测试。

源文件夹“src/main/java”和“src/main/resources”包括在每个源文件夹中创建的包“com.testing.TestProject.login”中的步骤定义和功能文件。

我在 POM 文件中包含了插件和依赖项,但是当我运行 maven 阶段集成测试时,黄瓜测试没有被执行。

我是Maven的新手。请让我知道在 POM 文件中包含哪些内容以使用 Maven 运行黄瓜测试。

这是我的 POM 文件:

提前致谢。

0 投票
2 回答
4015 浏览

java - Trying to setup a cucumber-project in eclipse without using Maven

I am new to cucumber, I am trying to configure a Java-project without using Maven, I am having the following exception. I think there is an issue with the path of a .feature file

Exception:

I have also attached the image of my project setup.

enter image description here

Any help will be awesome.

Thanks!

0 投票
2 回答
3194 浏览

java - 在黄瓜功能文件中只执行一次@Given

我有以下我想在黄瓜中测试的功能。但是,我只想处理一次输入文件(@Given 在下面的功能中)。但是,它似乎每次都在执行@Given 步骤。是否可以仅在以下功能中执行此 @Given 一次?

我还通过删除 Given 步骤尝试了之前和之后的钩子,但没有运气。

我也在钩子之前尝试过,但对于示例中的每一行,它仍然会进入这个循环。

在功能文件中我有这样的东西:

0 投票
0 回答
1107 浏览

java - 使用 selenium 在 cucumber+JVM 中使用测试运行程序 Junit 发现错误未找到测试

我试图使用 cucumber JVM 运行 Cucumber 场景,但我得到“没有发现 Junit 4 的测试”我目前没有使用 maven。

我写了以下步骤定义

此外,当从测试运行程序文件(即 GenericTest)运行时,我没有在上下文菜单中作为 junit 选项运行

请提供帮助

0 投票
2 回答
2007 浏览

java - 如何抑制 Cucumber/Junit 断言堆栈跟踪

我有一个黄瓜场景,步骤使用assertEquals. 我的结果报告显示了对最终用户不友好的堆栈跟踪。我怎样才能压制它

朱尼特

0 投票
1 回答
474 浏览

selenium - Cucumber Junit 测试代码

我尝试使用 webdriver 来查看黄瓜是否会使用 junit 打开浏览器。除了打开网络浏览器甚至做我要求做的事情之外,它可以识别所有内容。这是代码片段:

0 投票
4 回答
7528 浏览

java - 在黄瓜junit中动态传递黄瓜选项?

我知道这@CucumberOptions是用来传递 Cucumber 选项的。但是由于Java注解只允许内联常量的限制,使用起来相当麻烦@CucumberOptions。那么,在使用 cucumber-junit 时,是否有一种动态的方式来传递 Cucumber 选项?非常感谢。

0 投票
1 回答
133 浏览

cucumber - 使用 Parameter 使用 Cucumber 自动化浏览器

如何使用参数例如:

在文件中我有:

我得到小黄瓜的解析器错误。我尝试使用数据表、列表以及获取不同值的所有可能方式,但 sendkeys 不适用于数组、列表或表格。

任何帮助将不胜感激。