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

查看:878
本文介绍了倾城报告:Chrome中没有显示任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Allure-framework 为我的<生成报告< a href =http://docs.seleniumhq.org/projects/webdriver/ =noreferrer> Selenium WebDriver 测试。我使用 JUnit 框架和 allure-maven-plugin 。我使用 mvn test 运行测试,然后使用 mvn site 生成报告。我在 target / site / allure-maven-plugin / 目录中看到生成的报告。当我用Firefox打开 index.html 页面时,它可以正常工作。但是,当在Chrome或Safari中执行相同操作时我什么也看不见

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.

怎么了?我错过了什么吗?我的 pom.xml 文件位于此处

What's wrong? Am I missing something? My pom.xml file is located here.

推荐答案

此问题与默认Webkit安全设置有关,该设置禁止在本地文件系统上执行Ajax请求。您至少有两种可能的解决方案:

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. 使用某些Web服务器(如Nginx或Apache)提供 index.html 。这将模拟远程网站,从而欺骗您的浏览器。使用Allure CLI 2.0+,可以使用以下命令完成此操作:

  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

$ allure report open




  1. 使用 - allow-file-access-from-files Chrome旗帜。请参阅此问题中的详细信息。

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

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

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