当前位置: 首页 > 知识库问答 >
问题:

宁静报告未显示功能文件中提到的所有场景大纲,尽管对所有场景大纲进行所有屏幕截图

尉迟轶
2023-03-14

报告仅包含@test2场景大纲,但不包含@test1场景大纲。我检查了serenity report文件夹,它也有@test1场景大纲的sceenshot。我不知道为什么会发生这种事。当我使用“场景”而不是“场景大纲”运行相同的测试时,报告生成正确。

特征文件:

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = {"features"}, glue = {"stepdefinitons"},plugin={"pretty"})
public class serenity runner{
}

我在功能文件中有两个方案大纲

@test1
Scenario Outline: Verification of Login as user 1
Given I login in to app as user
When I give credentials
Then I see the details page
Examples:
|x|y|
|abc|asx|


@test2
Scenario Outline: Verification of testing user
Give I login into app2 as user
When I give credentials
Then I see user name and details application
Examples:
|z|w|
|fdgdfg|gfdg|

Pom configuration:-
<serenity.version>2.1.5</serenity.version>
<serenity.maven.version>2.1.5</serenity.maven.version>
<serenity.cucumber.version>1.9.50</serenity.cucumber.version>
<maven.compiler.version>3.8.1</maven.compiler.version>

Goals:
clean verify -Dcucumber.options="--tags '@test1 or test2'"

Results:
Tests run: 2, failures: 0, Errors: 0, skipped: 0

but Serenity tests result shows as below
SERENITY TESTS: SUCCESS
|Test executed | 1
|Test passed | 1
|Tests with errors | 0
|Tests ignored/skipped | 0

共有1个答案

叶卓君
2023-03-14

我修改了我的项目并添加了功能文件,遵循Cucumber/Serenity约定。具有“方案大纲”的所有方案都显示在报表中。请创建如下项目:https://github.com/cliviu/serenity-cucumber5-starter.git。请参考 git 问题:- https://github.com/serenity-bdd/serenity-core/issues/2190

 类似资料:
  • 有没有可能用gherkin写一个场景大纲,其中有一个断言步骤,而不是在所有的例子中都需要? null 有没有更好的写法?

  • 在我的特性文件中,我有两个场景大纲,以及它们自己的示例部分。我以不同的方式标记了每个场景大纲(、)。当我尝试用Cucumber 5.6.0运行这两个场景大纲时,我得到以下错误:- 测试中的功能文件:- JUnit测试运行程序类:-

  • 我想在我的应用程序中使用背景图像。但是我对不同的屏幕大小感到困惑。我发现了这个问题: Android:支持所有设备的背景图像大小(以像素为单位) 但在回答中他说但Lg G3是和屏幕分辨率: 我需要一个路线图。所有屏幕的图像尺寸应该是多少?(mdpi、hdpi、xhdpi等)

  • 我有内置场景生成器的问题。当使用独立的场景生成器时,可以很好地显示所有内容。我是弄乱了IntelliJ Idea中的一些设置,还是它是一个bug。 我用的是IntelliJ Idea 15.0.3 (64位)和Scene Builder 2.0。 我在IntelliJ中改变的一件事是堆的大小。下面是我的idea64.exe.vmoptions文件:-xms 512m-xmx 2048m-XX:Ma