Allure report: nothing shown in Chrome(引诱报告:Chrome 中没有显示任何内容)
问题描述
我正在尝试使用 Allure-framework 为我的<一个 href="http://docs.seleniumhq.org/projects/webdriver/" rel="noreferrer">Selenium WebDriver 测试.我使用 JUnit
框架和 allure-maven-plugin 与 Allure 1.3.9 版本.我使用 mvn test
运行测试,然后使用 mvn site
生成报告.我在 target/site/allure-maven-plugin/
目录中看到生成的报告.当我使用 Firefox 打开 index.html 页面时,它可以正常工作.但是,在 Chrome 或 Safari 中执行相同操作时 我什么也看不到.
怎么了?我错过了什么吗?我的 pom.xml
文件位于这里.
此问题与默认 Webkit 安全设置有关,该设置禁止在本地文件系统上执行 Ajax 请求.您至少有两种可能的解决方案:
- 使用 Nginx 或 Apache 等网络服务器提供 index.html.这将模拟远程网站,从而欺骗您的浏览器.使用 Allure CLI 2.0+ 可以使用以下命令完成:
<块引用>
$ 诱惑报告打开
- 使用 --allow-file-access-from-files Chrome 标志.请参阅此问题中的详细信息.
I'm trying to use Allure-framework to generate a report for my Selenium WebDriver tests. I use JUnit
framework and allure-maven-plugin with version 1.3.9 of Allure. I run tests with mvn test
then generate the report using mvn site
. I see generated report in target/site/allure-maven-plugin/
directory. When I open index.html page with Firefox it works normally. However when doing the same thing in Chrome or Safari I see nothing.
What's wrong? Am I missing something? My pom.xml
file is located here.
This problem is related to default Webkit security settings which forbid doing Ajax requests on the local filesystem. You have at least two possible solutions:
- Serve index.html with some web-server like Nginx or Apache. This will emulate remote website and thus trick your browser. With Allure CLI 2.0+ this can be done using the following command:
$ allure report open
- Use --allow-file-access-from-files Chrome flag. See details in this question.
这篇关于引诱报告:Chrome 中没有显示任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:引诱报告:Chrome 中没有显示任何内容


基础教程推荐
- 不推荐使用 Api 注释的描述 2022-01-01
- 大摇大摆的枚举 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01