[英]Is it possible to see scenarios in feature files in the runner window while running parallel in karate?
當我使用並行運行器運行測試時,我無法在功能文件中看到失敗或成功的場景。 我想在 IntelliJ Idea 的跑步者 window 上看到這些場景。 我正在為 cucumber 報告使用並行運行器。
這是我的代碼
@Test
public void testParallel() {
List<String> features = Arrays.asList("classpath:features");
Results results = Runner.path(features)
.outputCucumberJson(true).tags("~@ignore")
.karateEnv("deee")
.parallel(1);
generateReport(results.getReportDir());
assertTrue(results.getErrorMessages(), results.getFailCount() == 0);
}
public static void generateReport(String karateOutputPath) {
Collection<File> jsonFiles = FileUtils.listFiles(new File(karateOutputPath), new String[] {"json"}, true);
List<String> jsonPaths = new ArrayList<>(jsonFiles.size());
jsonFiles.forEach(file -> jsonPaths.add(file.getAbsolutePath()));
Configuration config = new Configuration(new File("target"), "deee");
ReportBuilder reportBuilder = new ReportBuilder(jsonPaths, config);
reportBuilder.generateReports();
}
並行運行器不與 IDE 視圖集成。 它專為 CI 執行而設計。
這個其他答案可以解釋差異和原因: https://stackoverflow.com/a/65578167/143475
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.