trivago / cluecumber

Clear and concise reporting for the Cucumber BDD JSON format.
https://www.softwaretester.blog
Apache License 2.0
271 stars 88 forks source link

The iFrame element shows empty content under HTML attachment Scenario Step #321

Closed matlaria90 closed 11 months ago

matlaria90 commented 1 year ago

When I upload the html report on cloud bucket and I try to open it using Chrome or Firefox browser, the iFrame element doesn't show content inside the HTML attachment section. If I open the DOM I am able to find the content inside the iFrame element.

To Reproduce Steps to reproduce the behavior:

  1. Generate a html report using "Cluecumber Core" with version 3.4.0
  2. Upload the html report folders on cloud bucket
  3. Go to link related of one specific test case
  4. Scroll down to step that contains the "toggle" table
  5. Expand the table clicking on "toggle" link
  6. The iFrame is empty

Expected behavior I should see the html content inside the "toggle" section

Attachments image

image

Additional context Seems that the issue could be the attribute "height" inside the iFrame element that is set to 1 like default. If I try to perform a force change to "100%", I am able to see the content of the html attachement (in any case the view is not beautiful since that I should scroll down in order to see all the content)

bischoffdev commented 1 year ago

Hello and thanks for reporting! Could you please attach a sample JSON result that demos this behavior? That would make it easier to test.

matlaria90 commented 1 year ago

Hello @bischoffdev ,

I attached an example of json file cucumber.zip Meanwhile I fixed this issue using a workaround. I used a custom css in which I specified that the "iframe" element should have a fix dimention.

iframe { height: 800px; }

bischoffdev commented 1 year ago

I will check this next week, thanks for the example!

bischoffdev commented 1 year ago

@matlaria90 , I checked your example and it works fine for Firefox and Chrome. When toggling the attachments, it shows the full iFrame content for me.

Firefox: image

Chrome: image

The iFrame height is set correctly via JS.

Which browser and OS are you using?

matlaria90 commented 11 months ago

Hello @bischoffdev, we investigated on the issue and seems that there is a "DOMException" when we try to open the html report directly on Sonatype Nexus application. d3

We solved using a custom css that we decide to use only in some specific cases (in this way we avoid to use a fix sizing for all the generated report)

iframe { height: 800px; }

bischoffdev commented 11 months ago

Then this is an issue that is not necessarily in Cluecumber. A cross origin block can have multiple causes. So if this workaround is alright for you for Nexus, I would close this. If you think that this could be solved within Cluecumber, maybe you have an idea.

matlaria90 commented 11 months ago

I think that we can close this defect for the moment becasue could be a issue that rarely happens and the workaround is easy to manage.