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

Support embedding data directly in gherkin formatters #695

Merged

Conversation

brasmusson
Copy link
Contributor

This PR sets out to fix part 1 of #651 ("fix the JSON report formatter").

The idea is to support the following construct in step definitions:

encoded_img = @browser.driver.screenshot_as(:base64)
embed("#{encoded_img}",'image/png;base64')

The GherkinFormatterAdapter will now check if the first parameter given to the embed method is indeed a file, and if so read the content of the file and send it to the gherkin formatter (for instance the JSON Formatter) as before. When the first parameter given to the embed method is not a file, then the GherkinFormatterAdapter will now assume it is the data to embed, and send that parameter through to the gherkin formatter.

@brasmusson brasmusson changed the title Add empty line to rebuild v1.3.x on travis Support embedding data directly in gherkin formatters Jun 21, 2014
@mattwynne
Copy link
Member

@brasmusson can you rebase this and then merge it into master please?

@brasmusson
Copy link
Contributor Author

@mattwynne I'll take care of it.

The gherkin JSON formatter will encode the data it receives before
inserting it into the json file. When supporting embedding images in
html files, the data sent to the embed method need to be base64
encoded. Unless decoded before sent to the gherkin JSON formatter, the
base64 encoding will be applied twice.
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants