Is the file upload still working?
I am experiencing issues with file uploads. Even the example from: https://github.com/reportportal/client-javascript/blob/master/examples/generateTestLaunch.js is not working. The headers are still set and sent, but it seems that ReportPortal is ignoring them.
When one checks the documentation: https://github.com/reportportal/documentation/blob/master/src/md/src/DevGuides/reporting.md#batch-save-logs it's stated, that all files should be uploaded at once.
Also the content type "multipart/form-data" which is used in JavaScript implementation is not mentioned in the example
@KatsiarynaTatarynovich could you please check this issue?
@AmsterGet @KatsiarynaTatarynovich @evjlobanova could someone just provide an working example for the JavaScript client? I finally got it working with following:
const fsObject = fs.readFileSync(diffImageAbsolutePath);
const contentBase64 = new Buffer(fsObject).toString('base64');
const fileObject = {
name: 'testPair.diffImage.png',
type: 'image/png',
content: contentBase64,
};
var sendLogObject = reportPortalClient.sendLog(
testObject.tempId,
{
level: 'ERROR',
message: 'Difference found',
},
fileObject);
Hi @schrufygroovy
Check out the following example for the agent-js-mocha - https://github.com/reportportal/examples-js/blob/master/example-mocha/spec/logTest.spec.js#L80
It uses the sendLog method from the client-javascript instance.
Thanks for finding. It would be nice to mention this in the docs.