引诱报告:Chrome 中没有显示任何内容 [英] Allure report: nothing shown in Chrome

查看:20
本文介绍了引诱报告: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 请求.您至少有两种可能的解决方案:

  1. 使用 Nginx 或 Apache 等网络服务器提供 index.html.这将模拟远程网站,从而欺骗您的浏览器.使用 Allure CLI 2.0+ 可以使用以下命令完成:

<块引用>

$ 诱惑报告打开

  1. 使用 --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:

  1. 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

  1. Use --allow-file-access-from-files Chrome flag. See details in this question.

这篇关于引诱报告:Chrome 中没有显示任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆