如何使用 Selenium 为每个 运行 创建测试结果文件夹 - 带有黄瓜选项的 Junit 测试 运行ner 文件?
How to create test result folder for every run using Selenium - Junit test runner file with cucumber options?
任何人都可以建议我,在 Cucumber 选项中使用 'plugin' 或 'format'。如何为我们所做的每个 运行 创建一个单独的测试结果文件夹。
由于下面的代码行为结果创建了公共文件夹,如果我们 运行 脚本,当前存在的结果将被新的 results/reports 替换。因此,我希望为每个 运行 创建包含日期和时间的新文件夹,以便存储结果。
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resources/feature/",
tags="@AppLaunch",
glue = "com.org.frameworkFiles.stepDefinitions",
plugin = {"pretty", "html:target/site/cucumber-pretty1","html:target/Masterthought"},
monochrome = true,
dryRun = true)
不是这样的。使用 @RunWith(Cucumber.class)
注释允许 JUnit 运行 黄瓜场景,就像它们是常规单元测试一样。
假设您使用的是 Maven,测试结果最终会出现在模块的 target 目录中,该目录在每次干净构建时都会被删除并重新创建。
您要通过在目标目录中创建单独的报告文件夹来实现什么目的?每个 运行 的测试结果都将相同,除非更改源,但这需要新构建并因此删除所有报告。
任何人都可以建议我,在 Cucumber 选项中使用 'plugin' 或 'format'。如何为我们所做的每个 运行 创建一个单独的测试结果文件夹。
由于下面的代码行为结果创建了公共文件夹,如果我们 运行 脚本,当前存在的结果将被新的 results/reports 替换。因此,我希望为每个 运行 创建包含日期和时间的新文件夹,以便存储结果。
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resources/feature/",
tags="@AppLaunch",
glue = "com.org.frameworkFiles.stepDefinitions",
plugin = {"pretty", "html:target/site/cucumber-pretty1","html:target/Masterthought"},
monochrome = true,
dryRun = true)
不是这样的。使用 @RunWith(Cucumber.class)
注释允许 JUnit 运行 黄瓜场景,就像它们是常规单元测试一样。
假设您使用的是 Maven,测试结果最终会出现在模块的 target 目录中,该目录在每次干净构建时都会被删除并重新创建。
您要通过在目标目录中创建单独的报告文件夹来实现什么目的?每个 运行 的测试结果都将相同,除非更改源,但这需要新构建并因此删除所有报告。