【发布时间】:2019-06-19 23:25:40
【问题描述】:
在测试结果部分,类名称显示为 classMethod。我使用黄瓜测试库进行测试。在测试结果部分,我想查看我在功能文件中指定的“场景:”名称。我该怎么办?你能帮帮我吗?
build.gradle 文件:
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.+'
testCompile("io.github.bonigarcia:webdrivermanager:3.+")
testCompile group: 'info.cukes', name: 'cucumber-junit', version: '1.+'
compile group: 'info.cukes', name: 'cucumber-java', version: '1.+'
testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
testCompile group: 'org.testng', name: 'testng', version: '6.14.3'
}
RunFeature 类:
package feature;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/java/testCases" )
public class RunFeatures {
}
黄瓜功能:
Feature: OpenBrowser
Scenario: SelectBrowser
When I have opened "https://www.trendyol.com/" with "explorer" browser
【问题讨论】:
-
您指的是要在其中添加场景名称的默认 html 报告吗?
标签: java selenium selenium-webdriver junit cucumber