标签: cucumber-serenity

Serenity BDD框架和Cucumber工具有什么区别

Today I've got some theoretical question. I have a little experience in BDD with Cucumber. Now I started working in API testing and I faced with Serenity BDD framework on my new project. It is used with Cucumber. So I would like to clarify what is the difference between Serenity BDD Framework and Cucumber and why can't we use just Cucumber for our tests, because it seems to me, like these two tools are doing the same job. Could anybody …

cucumber serenity-bdd cucumber-serenity

8
推荐指数
1
解决办法
9766
查看次数

如何在Feature文件的'Examples'中传递csv文件,并从Java黄瓜中的CSV文件中读取值

  1. 在Cucumber的"特征文件" - >"示例"中,如何设置CSV文件的路径.

Sample.feature

    Feature:Launch an app 
    Scenario Outline:Validation of the application
        Given User navigates to application
        When User logs in using valid appname '<Name>'
    Examples:    
        @sources:src/test/resources/data_tables/temp.csv
        | Name |
Run Code Online (Sandbox Code Playgroud)

Junit Runner:

package definitions;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import cucumber.api.CucumberOptions;
import org.junit.runner.RunWith;

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = "src/test/resources/features/Sample.feature" )
public class AcceptanceTestSuite{   

}
Run Code Online (Sandbox Code Playgroud)

使用的CSV文件

**temp.csv**
    name,
    Google,
Run Code Online (Sandbox Code Playgroud)

但是我没有从temp.csv文件中检索值,结果是0场景0步骤0m0.000s

2.也想在Java Cucumber中了解Serenity,如何从Feature文件中提到的CSV文件中读取值.

java cucumber-serenity

6
推荐指数
0
解决办法
2205
查看次数

黄瓜在没有示例的情况下无法识别场景

我有一个类似于以下的小黄瓜场景:

Scenario Outline: Test some behaviour
    Given a set of preconditions
    When an event occurs
    Then my application has to behave in a particular manner
    And respond as expected
Run Code Online (Sandbox Code Playgroud)

当我执行这个场景时,我的报告说

0 个场景,执行 0 个步骤。

然而,当我使用示例执行场景时,我的设置工作正常。

我错过了什么吗?

cucumber cucumber-java serenity-bdd cucumber-serenity

5
推荐指数
1
解决办法
1791
查看次数

从可执行 JAR 运行单个黄瓜场景

我想将我的验收测试打包到一个可执行 JAR 中,其中包含运行测试和生成报告所需的所有库。我还想运行所有测试或单个测试。

到目前为止,我能够运行所有测试,尽管在我在 serenity.properties 中指定的位置生成报告,但没有生成 index.html。

通常,我会使用 maven verify 目标运行我的测试,该目标将运行 serenity-maven-plugin,但由于我是从 JAR 运行的,我不确定如何实现相同的目标。

我有一个主类,如下所示:

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = "classpath:com/cfhayes/test/LookupADefinition.feature")
public class DefinitionTestSuite {
  public static void main(String[] args) throws Exception {
    JUnitCore.main("com.cfhayes.test.DefinitionTestSuite");
  }
}
Run Code Online (Sandbox Code Playgroud)

我的功能文件使用标签,以便我可以指定要运行的单个场景:

Feature: Lookup a definition

  @TEST-0001
  Scenario: Looking up the definition of 'apple'
    Given the user is on the Wikionary home page
    When the user looks up the definition of the word 'apple'
    Then they should see the definition 'A common, round fruit produced by the …
Run Code Online (Sandbox Code Playgroud)

cucumber-jvm cucumber-junit cucumber-java cucumber-serenity

4
推荐指数
1
解决办法
2248
查看次数

如何自定义 Serenity BDD 的报告

我希望更改 Serenity 报告中的 CSS 和徽标。此外,我想在 Serenity 报告中添加一些自定义文本或指向某些测试的链接。就像生成了一个 excel 报告一样,我希望在报告的测试步骤中提供它的链接。实现这一目标的最佳方法是什么?

serenity-bdd cucumber-serenity

4
推荐指数
1
解决办法
9307
查看次数

没有注册 BaseStepListener - 调试 serenity-rest-assured

任何人都可以帮助我设置 serenity-rest-assured 以便我可以从 IDE (IntelliJ) 调试它吗?我只是不敢相信它如此普遍,而且除了使用“gradlew test”命令之外它无法运行,因此在java中不可能对测试用例进行调试。

谷歌搜索对我没有任何帮助。任何提示/教程/链接表示赞赏。

java bdd rest-assured cucumber-serenity

1
推荐指数
1
解决办法
7577
查看次数

配置 @RunWith 以在 IntelliJ 运行器中使用 CucumberWithSerenity.class 而不是 Cucumber.class

我有一个 gradle + Serenity + RestAssured 自动检查套件设置,我通常通过 shell 会话中的 gradle 命令运行,但有时我需要使用 IntelliJ 运行单个场景。

当我在 IntelliJ 上运行 Scenarios 时,我通常会收到很多这样的警告:

8312 [main] WARN cucumber.runtime.SerenityBackend - It looks like you are 
running a feature using @RunWith(Cucumber.class) 
instead of @RunWith(CucumberWithSerenity.class). 
Are you sure this is what you meant to do?
Run Code Online (Sandbox Code Playgroud)

我想知道在何处以及如何在 IntelliJ 中配置运行/调试配置,以便运行检查并CucumberWithSerenity.class修复警告。

我正在使用以下依赖项:

serenity-rest-assured:1.9.31
serenity-core:1.9.31
serenity-cucumber:1.9.12
Run Code Online (Sandbox Code Playgroud)

IntelliJ版本2018.1.5(社区版)

java intellij-idea cucumber serenity-bdd cucumber-serenity

1
推荐指数
1
解决办法
7300
查看次数