I'm running API tests using GitHub Actions and I want to upload to the report generated by Mochawesome to Google Cloud so I can see failures clearly without digging through CI logs. I have the upload part working but when I view the html file on Google Cloud it doesn't load, I just get a blank white page. I'm uploading the css files too so why isn't the html file loading?
Asked
Active
Viewed 228 times
0
-
George, please let me know if the below recommendations were helpful. – Vaidehi Jamankar Nov 16 '22 at 06:48
-
I resolved it using my own solution because none others had been posted. – George Nov 16 '22 at 14:49
2 Answers
0
Using cdn for assets resolves the isssue .mocharc.js
:
module.exports = {
reporter: 'node_modules/mochawesome',
'reporter-option': [
'cdn=true',
'timestamp=true'
],
};

George
- 322
- 1
- 6
- 25
0
When you're creating a file using the Cloud Storage API , set the mime_type to 'text/html' and skip the content_disposition.
You can manually edit the metadata to set the proper type, which is text/css for CSS files. If the type is neither specified nor auto-detected at upload time, Google Cloud Storage serves files as binary/octet-stream which may prevent the browser from properly rendering it.
Alternatively, you can also specify the MIME type in HTML, e.g.,
<link rel="stylesheet" href="css/theme.css" type="text/css">
to make sure that the browser handles it appropriately.
Here are a few examples with similar implementation:

Vaidehi Jamankar
- 1,232
- 1
- 2
- 10