Skip to content

Conversation

@kbond
Copy link
Member

@kbond kbond commented Apr 12, 2022

When the PHPUnit extension saves the current state of html, save as a real HTML file (with the metadata inside a command).

Closes #85.

@kbond
Copy link
Member Author

kbond commented Apr 12, 2022

One thing that's a bit weird is when the response is non-html (ie json), it's still saved as a .html file. I'm not sure if we want to change this. For JSON though, we can't output as a .json and include the metadata as json doesn't support comments.

@kbond
Copy link
Member Author

kbond commented Apr 12, 2022

I'm going to merge as-is - we can fine-tune later if required. Thanks for the idea @benr77!

@kbond kbond merged commit acc0129 into zenstruck:1.x Apr 12, 2022
@kbond kbond deleted the save-state-html branch April 12, 2022 17:16
@benr77
Copy link
Contributor

benr77 commented Apr 13, 2022

For JSON though, we can't output as a .json and include the metadata as json doesn't support comments.

Is it worth considering outputting the headers as a separate file, so for HTML you'd get a .html and a .txt for the headers, and for JSON a .json and a .txt?

For Panther tests the screenshot is already an additional output file so this kind of makes sense - one output file per "type" of output data. (haven't seen this myself yet but does the JS console output to a dedicated file as well?).

Anyway, cheers for the fast implementation! Let me know if you'd like me to help with testing or anything.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

RFC Rename source code dump file to have .html extension

2 participants