簡體   English   中英

如何使用Selenium-Junit測試運行程序文件以及黃瓜選項為每次運行創建測試結果文件夾?

[英]How to create test result folder for every run using Selenium - Junit test runner file with cucumber options?

任何人都可以通過“ plugin”或“ format”在“黃瓜選項”中建議我。 如何為每次運行創建單獨的測試結果文件夾。

由於下面的代碼行創建了用於結果的公用文件夾,並且如果我們運行腳本,當前存在的結果將被新的結果/報告替換。 因此,我希望為每次運行創建帶有日期和時間的新文件夾,以存儲結果。

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,測試結果將最終存儲在模塊的目標目錄中,該目錄將在每個干凈的版本中刪除並重新創建。

您想通過在目標目錄中創建單獨的報告文件夾來實現什么? 除非更改源,否則每次運行的測試結果都將相同,但這需要重新構建,從而刪除所有報告。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM