Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Missing UI components in the screenshot #249

Closed
antoniocasero opened this issue Oct 27, 2015 · 25 comments
Closed

Missing UI components in the screenshot #249

antoniocasero opened this issue Oct 27, 2015 · 25 comments
Labels

Comments

@antoniocasero
Copy link

Hi,

First of all, thanks for sharing this amazing project.

I'm trying to use Snapshot in my project, but the images taken from the UITest are incomplete. Some tableviews are missing, or sometimes only one of the cells appear in the screenshot.

Has anyone experience the same?

I'm using snapshot 1.0.3

@pedro380085
Copy link

Hi @antoniocasero, can you provide some screenshots? This happens for all devices or just a specific subset?

@niveuseverto
Copy link

Same goes for v1.0.4
Here are screenshots by snapshot:
iphone4s-1withtitle
iphone6-1withtitle

Here is manual screenshot from simulator:
simulator screen shot 27 oct 2015 23 28 23

This trouble occurring on all subsets. And missing UI elements are same for specific simulator.

@antoniocasero
Copy link
Author

Yep, it happens in all devices, but each device has different problems (like @niveuseverto screenshots or #250)

@yeradis
Copy link

yeradis commented Oct 28, 2015

For me is the same, every device is broken in a different way but just for the screenshots
Because on the simulator it runs without problems

Btw this was happening with snapshot 0.10.x then i update to 1.x.x hoping this issue was fixed but is still present.

@pabloromeu
Copy link

I had the same issue. Try to set the zoom of the simulator to 1x. It fixed the problem for me.

captura de pantalla 2015-10-28 a las 11 16 47
captura de pantalla 2015-10-28 a las 11 17 01

@niveuseverto
Copy link

Earlier that was not an issue.

Main problem in this approach: I have display mounted to mac with resolution 1920x1080.

@antoniocasero
Copy link
Author

Using @pabloromeu fix (by changing the simulator scale to 100%) solves the problem.

@KrauseFx
Copy link
Collaborator

@pabloromeu Is that something I should add to the documentation? Or even print it in the snapshot output?

@pabloromeu
Copy link

@KrauseFx I am not really sure which is the process of taking the snapshot. I cannot assess you with that. But as far as I have seen at the swift helper code, you do something like moving a "press" along the screen. Maybe when the simulator is not at full screen this "movement" does not "grab" the full screen. And maybe it has something to do with #215

Maybe we could get the screenshots on main thread using test expectations, then you could get rid of these "touch" tricks.

@pabloromeu
Copy link

@KrauseFx I have just tried to get manual snapshots from the simulator (not using Fastlane's snapshot). If scale is different from 100% the snapshot has incorrect size (e.g.: If zoom is 50% the snapshot has half the actual device size). So this is a simulator bug.

@niveuseverto
Copy link

Doubtly, screenshots made from simulator itself are normal

@pabloromeu
Copy link

@niveuseverto check the size of the snapshot. They are smaller than the actual device size.

@niveuseverto
Copy link

I meant, do snapshot uses internal simulator's screenshot function or something other?
If it using something other - why not to use standard routine?

@hannesoid
Copy link

you can dupe this radar https://openradar.appspot.com/radar?id=6127019184095232

Is there maybe a way to force the iOS simulator to start in 100% scaling from command line?

@KrauseFx
Copy link
Collaborator

@hannesoid It would probably be possible using Apple Script, but we don't want to go down this road.

@pedro380085
Copy link

I can confirm that @pabloromeu solution works. And I can also confirm that the bug is on simulator. I'm using snapshot old version (0.10.2) and the bug exists here too.

@osrufung
Copy link

osrufung commented Nov 3, 2015

I'm using snapshot 0.10.2 version (yes, I need to migrate my old JS code). I confirm the bug, and the solution.

@gerchicov-bp
Copy link

It seems I have the same issue:
http://i65.tinypic.com/2h73qyd.png
It is just default master-detail application

@ConfusedVorlon
Copy link
Contributor

@KrauseFx out of interest - why are you so against Apple Script?

@ConfusedVorlon
Copy link
Contributor

@KrauseFx how about just writing directly to the preferences?

If you set every preference starting with SimulatorWindowLastScale to 1, then that should do the job.

com.apple.iphonesimulator.plist

converted to XML looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CurrentDeviceUDID</key>
<string>AAE4ACC6-6C7E-496D-94A5-95AD1C6F3652</string>
<key>LocationMode</key>
<integer>3101</integer>
<key>LocationScenario</key>
<string>None</string>
<key>NSNavLastRootDirectory</key>
<string>/Applications/Xcode_4.6.3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk</string>
<key>NSNavPanelExpandedSizeForOpenMode</key>
<string>{712, 448}</string>
<key>NSWindow Frame iPhoneSimulatorTVOutWindow</key>
<string>641 354 640 502 0 0 2560 1417 </string>
<key>SimulateDevice</key>
<string>iPhone Retina (4-inch 64-bit)</string>
<key>SimulatorTvOutWindowLastMode</key>
<integer>2114</integer>
<key>SimulatorWindowCenterX</key>
<real>1577</real>
<key>SimulatorWindowCenterY</key>
<real>716</real>
<key>SimulatorWindowLastScale</key>
<real>1</real>
<key>SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPad-Air</key>
<real>0.5</real>
<key>SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPad-Air-2</key>
<real>0.5</real>
<key>SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPad-Pro</key>
<real>0.5</real>
<key>SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPhone-6</key>
<real>1</real>
<key>SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus</key>
<real>1</real>
<key>SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus</key>
<real>0.5</real>
<key>SlowMotionAnimation</key>
<false/>
<key>currentSDKRoot</key>
<string>/Applications/Xcode_5.01.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk</string>
<key>windowOrientation</key>
<integer>3</integer>
</dict>
</plist>

@KrauseFx
Copy link
Collaborator

@ConfusedVorlon That's a great find, I can implement this into snapshot 🚀

@0xced
Copy link

0xced commented Nov 25, 2015

Looks good to me. I’d iterate over the == Device Types == section of xcrun simctl list devicetypes --json to make sure all simulators’ scale are properly updated.

@KrauseFx
Copy link
Collaborator

@0xced doing that right now 🚀

@KrauseFx
Copy link
Collaborator

I just pushed a new release https://github.com/fastlane/snapshot/releases/tag/1.2.0
Please update to the latest version, make sure to read the release notes and let me know if it works for you 👍

@fastlanebot
Copy link

This issue was migrated to fastlane/fastlane#2578. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo 🚀

@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests