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

Save output to file #17

Closed
bjowes opened this issue Apr 1, 2020 · 11 comments
Closed

Save output to file #17

bjowes opened this issue Apr 1, 2020 · 11 comments
Assignees

Comments

@bjowes
Copy link
Contributor

bjowes commented Apr 1, 2020

Seeing the cypress log in the terminal is great - but when integrating with a CI environment it would be helpful if the output could be (easily) saved to a file. The file could then be uploaded as an attachment to the test run.

@archfz
Copy link
Owner

archfz commented Apr 1, 2020

Hi. There is an issue for the dashboard if you mean for that. Other than that usually you see the output on the CI logs where you ran the cypress run command. What CI are we talking about?

@bjowes
Copy link
Contributor Author

bjowes commented Apr 1, 2020

Azure Devops.

@bjowes
Copy link
Contributor Author

bjowes commented Apr 1, 2020

And yes, I can see the result in the logs. But the logs are not very usable. We compose a html report with screenshots, and it would be great to be able to attach these logs there too.

@archfz
Copy link
Owner

archfz commented Apr 1, 2020

Ok now I understand the use case. There are other modules that actually write reports in files. But as I saw they were lacking some output like request or console logs.

Would you require these outputs to be in plain txt? Or some json with specific structure?

@bjowes
Copy link
Contributor Author

bjowes commented Apr 1, 2020

As a starting point I think plain text (utf-8) would do nicely.

@bjowes
Copy link
Contributor Author

bjowes commented Apr 1, 2020

But there should be a way to identify which test case the log relates to. Could be deduced form the filename (like the failure screenshots in cypress)

@albadam000
Copy link

That would be useful for us as well. We're pushing all the cypress logs to ReportPortal, so even if it is a callback method where we can access the log data easily or just the possibility to save the logs as a file, any of them would be great.

@csvan
Copy link

csvan commented May 7, 2020

This would be extremely useful

@archfz archfz self-assigned this May 23, 2020
@archfz
Copy link
Owner

archfz commented May 24, 2020

Released in 1.3.0.

@archfz archfz closed this as completed May 24, 2020
@bjowes
Copy link
Contributor Author

bjowes commented Jun 1, 2020

Thanks for implementing this! Also really nice that you added json format, it might be handy.

Suggestion:
When the log files are written, print a line to the log stating this. Example from Mochawesome:

[mochawesome] Report JSON saved to c:\Source\Repos\mpa_medis\e2e\cypress\results\json\mochawesome_023.json

@archfz
Copy link
Owner

archfz commented Jun 1, 2020

@bjowes Can you open a separate issue please. Also contributions are welcome, this would be super easy to implement :)

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

4 participants