Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the file upload still working? #66

Open
schrufygroovy opened this issue Mar 30, 2020 · 3 comments
Open

Is the file upload still working? #66

schrufygroovy opened this issue Mar 30, 2020 · 3 comments

Comments

@schrufygroovy
Copy link

schrufygroovy commented Mar 30, 2020

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

@evjlobanova
Copy link

@KatsiarynaTatarynovich could you please check this issue?

@schrufygroovy
Copy link
Author

schrufygroovy commented Jul 20, 2020

@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);

@AmsterGet
Copy link
Member

AmsterGet commented Jul 20, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants