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

Update json formatter for append images embedding #618

Closed
wants to merge 1 commit into from
Closed

Update json formatter for append images embedding #618

wants to merge 1 commit into from

Conversation

arturgspb
Copy link

Before fix, code like this does not append embedding info to json. I fixed it.
Code example:
page.driver.browser.save_screenshot("report/#{scenario.id}.png")
embed("#{scenario.id}.png", "image/png", "SCREENSHOT")

Before fix, code like this does not append embedding info to json. I fixed it.
Code example:
    page.driver.browser.save_screenshot("report/#{scenario.__id__}.png")
    embed("#{scenario.__id__}.png", "image/png", "SCREENSHOT")
@os97673
Copy link
Member

os97673 commented Jan 14, 2014

please add test for the problem.

@arturgspb
Copy link
Author

I'll try it, but my ruby experience - 4 days ;)

@ghost
Copy link

ghost commented Feb 2, 2014

this fix does not work for me
def initialize(runtime, io, options)
@io = ensure_io(io, "json")

  •    super(Gherkin::Formatter::JSONFormatter.new(@io), false)
    
  •    @formatter = Gherkin::Formatter::JSONFormatter.new(@io)
    
  •    super(@formatter, false)
    
  •  end
    
  •  def embed(src, mime_type, label)
    
  •    @formatter.embedding(mime_type, {'label' => label, 'src' => src}.to_json)
    end
    
    end
    end

It injects something into json file but it isn't screen path.

Example of my json file

"embeddings": [
{
"mime_type": "image/png",
"data": "eyJsYWJlbCI6IlNDUkVFTlNIT1QiLCJzcmMiOiI3MDI5NDQyMzAwNTI4MC5wbmcifQ=="
}

@arturgspb
Copy link
Author

@skaliberda, I think too little description of the problem. Describe the steps reproduce the problem, what should happen and what actually happens.

@brasmusson
Copy link
Contributor

This kind of feature is implemented by #695 and has been release in both v1.3.17 and v2.0.0.beta.2.

@brasmusson brasmusson closed this Sep 20, 2014
@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.

3 participants