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

Embedded data fails to display in HTML reports due to invalid string passed from HTMLFormatter #412

Closed
cpkelley opened this issue Oct 26, 2012 · 3 comments

Comments

@cpkelley
Copy link

Using Cucumber-jvm 1.1.1, screenshots are not getting embedded into the HTML report. It appears that something is converting the embedding parameter string incorrectly.

 public void embedding(String mimeType, byte[] data) {
        // Creating a file instead of using data urls to not clutter the js file
        String extension = MIME_TYPES_EXTENSIONS.get(mimeType);
        if (extension != null) {
            StringBuilder fileName = new StringBuilder("embedded").append(embeddedIndex++).append(".").append(extension);
            writeBytesAndClose(data, reportFileOutputStream(fileName.toString()));
            writeToJsReport("embedding", new StringBuilder("'").append(mimeType).append("','").append(fileName).append("'").toString());
        }
    }

Current Output in Report.js:

formatter.embedding("\u0027image/png\u0027,\u0027embedded0.png\u0027");

Expected Result:

formatter.embedding("image/png","embedded0.png");
or
formatter.embedding('image/png','embedded0.png');
@tsuhachev
Copy link

hi
when can I expect the fix?

@aslakhellesoy
Copy link
Contributor

After I have reviewed your pull request and verified that it fixes the bug.

@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
mpkorstanje pushed a commit that referenced this issue Sep 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants