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

Add custom info on test fails #63

Closed
rootlinux2 opened this issue Jul 31, 2020 · 4 comments
Closed

Add custom info on test fails #63

rootlinux2 opened this issue Jul 31, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@rootlinux2
Copy link

I want to add custom information to my test report, like addAttach for images, I want to be able to add text.
It Will be nice to have a way to expose information to the report like console.log(my_var) but see the result in the HTML report info.

For example, I'm making a test to an API endpoint, my endpoint returns an object with a key {"result":1, ...} in my test y expect the result to be 1 but is my test fails I want to show in the report the response object, to be able to see the error cause.

@rootlinux2 rootlinux2 added the enhancement New feature or request label Jul 31, 2020
@aruiz-caritsqa
Copy link
Contributor

Hey @rootlinux2

You'll be able to achieve what you need with the addAttach() function, by doing the following:

await addAttach('', 'Your Text');

Its not pretty though. I added an addMsg() function in the @carits-qa/jest-html-reporters package and prettified the output a little bit as a temporary solution

Your request is marked as an enhancement so will hopefully be added soon (and I'll bin off my forked repo)

@rootlinux2
Copy link
Author

rootlinux2 commented Aug 7, 2020

Hey @aruiz-caritsqa
The addMsg function is great, I think you can create a PR adding this function.
Just a little detail if you add a message the info button color should be Light Blue.

@Hazyzh
Copy link
Owner

Hazyzh commented Aug 9, 2020

same as the issue #64 .

@Hazyzh
Copy link
Owner

Hazyzh commented Aug 15, 2020

New version(2.0.3) which include the addMsg function has been released . Thanks for the contribution of @aruiz-caritsqa .

@Hazyzh Hazyzh closed this as completed Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants