getgauge / html-report

HTML report generation plugin for Gauge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Want to set dynamic path for report generation.

akalaiselvan opened this issue · comments

Expected behavior

I want set report generation path outside the app path. By doing this i can keep the test reports data wise , it might be useful for future verification.

Actual behavior

I changed the value for the key "gauge_reports_dir " in default.properties file but it wasn't worked as expected . [Actual need : Need to keep test reports datewise to a folder in remote pc ]

Steps to reproduce

1.Changed the path in default.properties file
2.run the spec
3.but report keep on writing in default report path.

Gauge version

Gauge version : 1.0.3
html-report : 4.0.8
Run gauge -v on your system and paste the results here.

@akalaiselvan I have tried with the version of Gauge and html-report you have mentioned and it works fine.

My default.properties file

# default.properties
# properties set here will be available to the test execution as environment variables

# sample_key = sample_value

# The path to the gauge reports directory. Should be either relative to the project directory or an absolute path
gauge_reports_dir = /Users/xyz/custom-reports-dir

# Set as false if gauge reports should not be overwritten on each execution. A new time-stamped directory will be created on each execution.
overwrite_reports = true

# Set to false to disable screenshots on failure in reports.
screenshot_on_failure = true

# The path to the gauge logs directory. Should be either relative to the project directory or an absolute path
logs_directory = logs

# Set to true to use multithreading for parallel execution
enable_multithreading = false

# Possible values for this property are 'suite', 'spec' or 'scenario'.
# 'scenario' clears the objects after the execution of each scenario, new objects are created for next execution.
gauge_clear_state_level = scenario

# The path the gauge specifications directory. Takes a comma separated list of specification files/directories.
gauge_specs_dir = specs

# The default delimiter used read csv files.
csv_delimiter = ,

# Allows steps to be written in multiline
allow_multiline_step = false

[Actual need : Need to keep test reports datewise to a folder in remote pc ]

You can change overwrite_reports value to false in default.properties file and gauge will create a new report dir with the time stamp for every run. Those directoires will be located inside the <path-to-reports-dir>/html-report/

Okay fine, Good to know that we can achieve that in Gauge ..

It would be good if you tell me how to give gauge_reports_dir for windows..

gauge_reports_dir = D:/GAUGE_RESULTS/Daily/

Above is the key and value which I've given in .properties but it is keep on writing the report in same default path.

Came to know the real problem...i had couple of properties file [default.properties and default Copy.properties]. It took the directory from the second one [default Copy.properties]. Once i deleted that it works fine as expected . Thanks for your response.

If possible leave a comment that , is it possible to make the report to write in a remote machine ..?

@akalaiselvan What do you mean by writing the report in a remote machine? Do you want the report to get generated in a different machine other that the one you running Gauge on?

@akalaiselvan can you please explain a bit more on what @nehashri has asked ?

I did that by mentioning the remote path in default.properties file.

My actual need is to send gauge test report in mail after test completed.. I tried it by adding my mailsend function in aftersuite tag. Since report is generating in gauge once the entire test completed (after aftersuite method executed) i cant able to do that .. So help me in this case that Once the complete gauge test is completed i need to attach the html report in mail. How to achieve this in Gauge framework ...?

you may have to write a wrapper script to achieve that since the report is generated after executing afterSuite.

Closing this for now.

For windows if you want to provide custom path for html reports
gauge_reports_dir = D:\GAUGE_RESULTS\Daily\

This works for me. I'd done POC and it's working fine.