wallarm/gotestwaf

couldn't export full report to HTML - Go Version and Docker Version

ORuessel opened this issue · 1 comments

Good Morning everyone,

version = main branch

in tests of waf attached to an api gateway. gotestwaf cannot write HTML Report to filesystem.

I test the following commands with

go run ./cmd --addHeader "Authorization: Basic AUTHTOKEN" --url=https://URL/ --openapiFile=/home/oru/openapi_2.yaml

docker run -v /home/oru:/app/reports -v /home/oru/openapi_2.yaml:/app/openapi.yaml --network="host" wallarm/gotestwaf --addHeader "Authorization: Basic AUTHTOKEN" --url=https://URL/ --openapiFile=openapi.yaml

ERRO[0165] caught error in main function error="couldn't export full report: couldn't render HTML report to PDF: couldn't find Chrome/Chromium to render HTML file to PDF: chrome not found" exit status 1

time="2022-09-05T09:53:16Z" level=error msg="caught error in main function" error="couldn't export full report: couldn't export report to HTML: couldn't execute template: template: report:756:41: executing "report" at : wrong number of args for StringsSplit: want 2 got 1"

without the parameter " --addHeader " the report can be normal created

Has someone else the problem or is this maybe local problem ?

Thanks and best regards Oliver

Hi!

In the first case, it looks like you are missing the Chrome web-browser on your machine. Try to add the following option: --reportFormat=html to generate report in html format instead of pdf. Example:

./gotestwaf --reportFormat=html --addHeader "Authorization: Basic AUTHTOKEN" --url=https://url/ --openapiFile=/home/oru/openapi_2.yaml 

In the second case, it looks like it is a bug in the template. Please check the fix from #157 PR. How to check:

# update repo
git fetch --all

# checkout the branch with the fix
git switch fix/issue-150

# build docker image
make gotestwaf

# run gotestwaf in docker (run from local docker image gotestwaf:latest)
docker run -v /home/oru:/app/reports -v /home/oru/openapi_2.yaml:/app/openapi.yaml --network="host" gotestwaf:latest --addHeader "Authorization: Basic AUTHTOKEN" --url=https://URL/ --openapiFile=openapi.yaml