kolsys / allure-harviewer

Plugin for Allure Framework
Apache License 2.0
4 stars 2 forks source link

Har viewer doesn't work #1

Closed SergeyPirogov closed 7 years ago

SergeyPirogov commented 7 years ago

Hi, found your plugin and tried to apply at my project, but probably did something wrong.

1) Cloned repo and placed plugin under foider .allure/2.3.5/plugins/allure-harviewer-plugin 2) Created method to attach har file to the report

@Attachment(fileExtension = ".har", value = "harFile",type = "")
private fun attachHar(): ByteArray {
        return try {
            Files.toByteArray(File("/home/sergey/Github/demo/calculator/harFile.har"))
        } catch (e: IOException) {
            ByteArray(0)
        }
}

3) Generated report. Generation successful, har file is attached, but when press on it, chrome just download it

screenshot from 2017-09-24 17-10-28

kolsys commented 7 years ago
  1. The plugin must be enabled in allure config ( config/allure.yml by default)
  2. The filename must look like *.har For example: harFile.har
SergeyPirogov commented 7 years ago

@kolsys Thank you a lot for the response. I've added the plugin to allure.yml and now it works well. Awesome, I am will write about it in a blog. I think it will be useful for many people