Evilweed / protractor-beautiful-reporter

An npm module which provides html reports of your Protractor tests with screenshots
MIT License
170 stars 40 forks source link

Css issue with protractor beautiful reporter #197

Open uvarajgithub opened 4 years ago

uvarajgithub commented 4 years ago

After report .html file generated if i copy the path and paste it to browser and launch i will get report like below

image

but, if i want to mail the report when i open from mail the reports looks like

image

The problem is default report path has support css json files with it. But if i copy the file to some other place and try to open it its broken design..with out support files Same thing happen when i sending a mail of the report.html file alone...it is broken with out css and json contetns..

How to resolve this issue

rebajz commented 4 years ago

add to mail PDF version ;-)

let exec = require('child_process'); let locateChrome = require('locate-chrome'); let q = require('q'); let reportFolder = ''; let reportName=''; return q.fcall(() => { locateChrome((where) => { // Print pdf report from html report console.log('Converting html report to pdf file'); exec.execSync('"' + where + '"' + ' --headless --disable-gpu --print-to-pdf=' + reportFolder + '/' + reportName + '.pdf --no-margins ' + reportFolder + '/' + reportName + '.html'); }); }).delay(1000);

miller45 commented 2 years ago

The pdf approach from rebajz is good. The other alternative would be to zip all files and then send the zip files as mail. This report does not work without "support" files. The js and css files are all required.