首页 文章

使用场景大纲时,黄瓜报告重复

提问于
浏览
0

使用 Scenario Outline 时,报告会生成两次方案,一种没有颜色,另一种颜色(如图所示) .

仅在使用 Scenario Outline 时才会发生这种情况,而不是在使用Scenario时 .

这是我的pom.xml'http://maven.apache.org/xsd/maven-4.0.0.xsd“> 4.0.0 GroupMaven ArtifactMaven 0.0.1-SNAPSHOT pom ProjectMaven http://maven.apache.org

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <executions>
                <execution>
                    <configuration>
                        <includes>
                            <include>**/*Test.java</include>
                        </includes>
                    </configuration>
                    <goals>
                        <goal>test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.4</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.2.4</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.53.1</version>
    </dependency>
    <dependency>
        <groupId>com.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>3.8</version>
    </dependency>
</dependencies>

这是My Cucumber Runner课程

@RunWith(Cucumber.class)@CucumberOptions(format = {“html:cucumber-html-reports / first”,“json:cucumber-html-reports / cucumber.json”},features = {“test / features / FirstFeature .feature“})公共课CucumberCukesTest {}'

我使用单色,严格,干燥等选项,什么都行不通 . 而且我使用了 plugin 而不是 format .

Cucumber report for scenario using Scenario Outline keyword

1 回答

  • 0

    第一个是您的场景大纲的一般细节,即您在特征文件中编写的内容 . 查看第6步和第7步 .

    第二个和其他一个取决于示例的数量是具有用户ID和密码的实际值替换的细节的场景 . 注意在相同的步骤中没有<> .

相关问题