问题描述
我正在使用spring 2
和cucumber 5
生成index.html
报告。要生成文件,我会触发黄瓜方案引发端点
@PostMapping("/test")
public ResponseEntity<?> runCucumber() {
String[] commonOptions = {
"--glue","bkn.oooo.testing.steps",feature,"--plugin","html:src/main/resources/static/index.html"
};
String response = String.valueOf(Main.run(commonOptions,Thread.currentThread().getContextClassLoader()));
return response;
完成后,它将在index.html
上创建一个src/main/resources/static/index.html
。然后,我转到localhost:8080
,就可以看到报告索引。但是,如果我再次触发端点,index.html
将被新信息覆盖,但我会选择旧报告。
我该如何解决?
我正在阅读有关cacheManager
的内容。可能是问题所在,但我真的不知道
解决方法
其浏览器缓存,默认情况下,您的浏览器缓存静态上下文。要检查是否是问题所在,请尝试使用查询字符串中的某些动态值访问相同的网址
例如/html?date=2324344
或清除浏览器缓存并再次访问该页面。
或如果可以的话,在index.html
中的meta标签下面
<meta http-equiv="expires" content="0">