Closed criisv7 closed 4 months ago
Hello @criisv7, Unfortunately, agent have no ability report any attachments or logs to the test. Jest starts the reporter after all tests are over. This means, that if we try to assign the logs in the test directly, it will work before we start our reporter. Therefore, the reporter methods will not know about the logs that we assigned in the test.
However it looks like we have the ability to send all logs to launch. Do you think it will be useful?
@chaitanya-uc
Hello @criisv7 ! What do you think about suggestion from https://github.com/reportportal/agent-js-jest/issues/89#issuecomment-1047542149?
I also trying to achieve this logic which is crucial. To add more data to each test. Sometimes attachment and sometimes just logs This is still the same status? Not possible? @AmsterGet
@aviadhadidainx , maybe this will be helpful for you: https://reportportal.io/docs/developers-guides/AttachmentsGuide/
Thanks. But based on this doc it is written:
agent-js-jest: There is no built-in capability to send attachments during test execution as the Jest Reporter works post-factum and does not allow to provide specific data to the report.
So how should i do it using jest? Doesn't make sense this is not an option mainly because this is fundamental requirement from a platform that provide automation reports
On the readme file on this repo it is written is it capable of doing that.. So not sure what is correct? https://github.com/reportportal/agent-js-jest?tab=readme-ov-file#reporting-api-methods
I understand what my issue was. It was on the develop branch and not on the master.. So this is pending release.
This is the PR link: https://github.com/reportportal/agent-js-jest/pull/140
Any idea when this released is planned? @Pink-Bumblebee @chivekrodis ?
Hi @aviadhadidainx !
We found out that the implemented approach will not work for tests labeled as concurrent
. So I'm going to look into this next week to see if this is a big change to support this option in an upcoming release.
If it takes a while, I'll publish the current implementation and make a note in the readme that the concurrent
option will be implemented separately.
Let me know what you think!
@AmsterGet Thanks for the quick response! In general we are not using under this project on concurrent option because in any case it is complicated (We are using end to end with playwright) So once this is release it will work for us perfectly
Hi @AmsterGet Do you have an ETA approximately when this will be released?
@AmsterGet ? This is kind of urgent for us mainly because we are using 2 different report because of that. We would like to unify to the report portal but if won't be available on the short term we might need to consider different approach for that problem
Hi @aviadhadidainx ! Sorry for delayed response, I'm going to publish it this week. I'll notify you here.
Hello @aviadhadidainx , @criisv7 ! Support for attachments has been released in version 5.1.0. Please check it out. I'll close this issue. Please track the progress of 'logs' support within https://github.com/reportportal/agent-js-jest/issues/55.
@AmsterGet Awesome thanks!
@AmsterGet Hi there.. Tested and it seems to be that the doc are not updated properly.
It is written on the doc to use as static: ReportingApi.attachment
When i look on the implantation it is not a static method and require the reporter on the constructor: constructor(reporter)
.
What will be the correct way of using it?
Thanks
Found it.. It should be global.ReportingApi.attachment
instead of ReportingApi.attachment
.
Would you like me to open another issue and create a PR?
Hi @aviadhadidainx !
Thanks for trying it.
I've updated the example for the Jest integration, please take a look.
It can be accessed within global scope just like ReportingApi.attachment
. I'm not sure, but if this approach didn't work for you it may depend on your jest environment configuration.
In any case working very well.. Thanks a lot. We are already using it
Is there any way to do it.