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

getting broken image in html file #239

Open
bikee1235 opened this issue Nov 17, 2021 · 10 comments
Open

getting broken image in html file #239

bikee1235 opened this issue Nov 17, 2021 · 10 comments

Comments

@bikee1235
Copy link

Hi

I update the latest build and in that one, I can see images are showing broken
Screenshot 2021-11-17 at 9 10 14 PM

@thisisjeffwong
Copy link

Have you moved the HTML file?

Are you using inlining and image resizing? See this issue: #202

@KrzysztofKupczyk
Copy link

Have exactly the same issue. I can open those images in XCode but html raport can't open it. I've done some research and found out that HEIC files are not supported by Safari/Chrome. Here is my question - how we have to open html report if browsers not support this format?

@atakankarsli
Copy link

atakankarsli commented Jan 31, 2022

We faced the same issue after updating from 2.0.0 to 2.2.1
Problem for us is, it puts screenshots with wrong URL (with double fastlane/test_output) : artifact/fastlane/test_output/fastlane/test_output/UITests.xcresult/Screenshot_

@nezhyborets
Copy link

Same issue here

@atakankarsli
Copy link

We were using the Fastlane plugin and we understood that there is no problem when we run the xchtmlreport command in the directory where the xcresult file is located.

We stop using deprecated fastlane plugin instead we will trigger directly from groovy .

@nezhyborets
Copy link

nezhyborets commented Feb 3, 2022

We were using the Fastlane plugin and we understood that there is no problem when we run the xchtmlreport command in the directory where the xcresult file is located.

We stop using deprecated fastlane plugin instead we will trigger directly from groovy .

Thanks. I may try fastlane sh action then, instead of plugin.

@nezhyborets
Copy link

I still have the problem. I see that html img src looks to test_output folder, e.g.:

<img class="screenshot-tail" src="test_output/Test.xcresult/Screenshot_51944F6E-F2DF-4312-B901-409552132BB0.jpg" id="screenshot-Screenshot_51944F6E-F2DF-4312-B901-409552132BB0.jpg">

So I guess that index.html should reside one level higher, not in test_output folder.

@kopczyd
Copy link

kopczyd commented Feb 9, 2022

+1 Same issue. Both with "-i" parameter and without "-i"
I did not check on simulator, our tests are performed on Jenkins and real devices. All reports look like the one from the first post.

@nezhyborets
Copy link

index.html looks into test_output/*.xcresult for images. So after html report is generated, I manually put xcresult into that location. Fixes the issue for me.

Here is my code from Fastfile, so all the sh calls happen in PROJECT_ROOT/fastlane

sh("xchtmlreport", "-r", "./test_output/Test.xcresult")
# Previous line would create index.html in fastlane/test_output folder. But <image src="..."> in that index.html look into test_output/*.xcresult.
# So index.html should reside one level higher from test_output. Thus we manually create test_output and copy needed files there (for now only xcresult).
# This approach considers that Jenkins archives fastlane/test_output in order to publish XCHtmlReport.
sh("mkdir", "-p", "./test_output/test_output/")
sh("cp", "-a", "./test_output/Test.xcresult", "./test_output/test_output/Test.xcresult")

@anuragmaheshwari
Copy link

index.html looks into test_output/*.xcresult for images. So after html report is generated, I manually put xcresult into that location. Fixes the issue for me.

Here is my code from Fastfile, so all the sh calls happen in PROJECT_ROOT/fastlane

sh("xchtmlreport", "-r", "./test_output/Test.xcresult")
# Previous line would create index.html in fastlane/test_output folder. But <image src="..."> in that index.html look into test_output/*.xcresult.
# So index.html should reside one level higher from test_output. Thus we manually create test_output and copy needed files there (for now only xcresult).
# This approach considers that Jenkins archives fastlane/test_output in order to publish XCHtmlReport.
sh("mkdir", "-p", "./test_output/test_output/")
sh("cp", "-a", "./test_output/Test.xcresult", "./test_output/test_output/Test.xcresult")

Hi @nezhyborets
I followed the steps that you mentioned but still images are not showing up in index.html file.

Screen Shot 2022-04-14 at 3 57 16 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants