terriblelabs/motion-juxtapose

Support for device_name

Closed this issue · 11 comments

Running motion-juxtapose with a different device name (say, rake spec device_name='iPhone 6 Plus') causes failures:

ERROR: RuntimeError - Screenshots are different sizes
# RuntimeError: Screenshots are different sizes

@jamonholmgren interesting - I do this all the time for a 5s running 7.1 without harm (in fact my specs always run with this defined so my screenshots always match)

are you saying after having a 6 plus match, the next time they are still mismatched?

@squidpunch Just switching back and forth between rake spec and rake spec device_name='iPhone 6 Plus' causes juxtapose to fail, even if you match each time. At least I think this is the case -- I haven't tested fully. :-)

I was just digging around in here because I needed something for my app...and my inspect talk, ( #17 )

interesting - i wonder if 6 and 6 plus are reporting the same path (but shouldnt)
I may be able to dig further on this if nobody else picks it up

I guess I should spin up a quick app to see if I can replicate it. :-)

yeah I bet thats what it is....

https://github.com/terriblelabs/motion-juxtapose/blob/master/lib/juxtapose/strategy/mac_bacon_strategy.rb#L16-L21

def device_name
      name = [UIDevice.currentDevice.model.gsub(/\s+Simulator/, '').downcase]
      name << 'retina' if UIScreen.mainScreen.scale > 1
      name << '5' if UIScreen.mainScreen.bounds.size.height > 480
      name.join('-')
end

so 5,6, and 6 plus are probably going to be saving screenshots as iphone-retina-5 i think...

I'm putting together a PR for this :)

Should be fixed in 0.3.0 by #19 — thanks, @squidpunch!

Works, except when in landscape. See #20.

I included a fix for the orientation issue in my PR for #20.

fixed in #19