HealsCodes / motion-crescentia

RubyMotion wrapper for the Calabash BDD framework
MIT License
3 stars 1 forks source link

iOS 7.1 simulator #1

Open squidpunch opened 9 years ago

squidpunch commented 9 years ago

I just created a new rubymotion project (version 3.2) and then followed the steps to use this gem.

I am noticing that when running an 8.1 simulator everything works fine, but when trying to run a 7.1 simulator it seems to just hang unexpectedly. Can you reproduce? Perhaps I am doing something wrong?

rake crescentia:run 'iPhone 5s (8.1 Simulator)'
  WARNING! Found 2 iOS/iPhone Developer certificates in the keychain. Set the `codesign_certificate' project setting to explicitely use one of (defaults to the first): iPhone Developer: David Larrabee (FB2V23J4T8), iPhone Developer: David Larrabee (WY2GF49GM5)
       Run Fetching the UUID for 'iPhone 5s (8.1 Simulator)'
       Run Uninstalling com.yourcompany.use-crescentia..
       Run Installing com.yourcompany.use-crescentia on iPhone 5s (8.1 Simulator)..
       Run calabash-env: {"DEVICE_TARGET"=>"iPhone 5s (8.1 Simulator)", "BUNDLE_ID"=>"com.yourcompany.use-crescentia", "APP_BUNDLE_PATH"=>"build/iPhoneSimulator-8.1-Development/use-crescentia.app"}
       Run cucumber []
Feature: Running a test
  As an iOS developer
  I want to have a sample feature file
  So I can begin testing quickly

  Scenario: Example steps                            # features/my_first.feature:6
    Given I am on the Welcome Screen                 # features/step_definitions/my_first_steps.rb:1
    Then I swipe left                                # calabash-cucumber-0.11.4/features/step_definitions/calabash_steps.rb:234
    And I wait until I don't see "Please swipe left" # calabash-cucumber-0.11.4/features/step_definitions/calabash_steps.rb:165
    And take picture                                 # calabash-cucumber-0.11.4/features/step_definitions/calabash_steps.rb:229

1 scenario (1 passed)
4 steps (4 passed)
0m13.123s

But when trying to run a 7.1 it just simply sticks at the Scenario:

rake crescentia:run 'iPhone 5s (7.1 Simulator)'
  WARNING! Found 2 iOS/iPhone Developer certificates in the keychain. Set the `codesign_certificate' project setting to explicitely use one of (defaults to the first): iPhone Developer: David Larrabee (FB2V23J4T8), iPhone Developer: David Larrabee (WY2GF49GM5)
       Run Fetching the UUID for 'iPhone 5s (7.1 Simulator)'
       Run Uninstalling com.yourcompany.use-crescentia..
       Run Installing com.yourcompany.use-crescentia on iPhone 5s (7.1 Simulator)..
       Run calabash-env: {"DEVICE_TARGET"=>"iPhone 5s (7.1 Simulator)", "BUNDLE_ID"=>"com.yourcompany.use-crescentia", "APP_BUNDLE_PATH"=>"build/iPhoneSimulator-8.1-Development/use-crescentia.app"}
       Run cucumber []
Feature: Running a test
  As an iOS developer
  I want to have a sample feature file
  So I can begin testing quickly

  Scenario: Example steps                            # features/my_first.feature:6
^C
Exiting... Interrupt again to exit immediately.

Looking into switching over from frank, but figured it best to get an understanding with a fresh project to get a feel for the product.

Thanks!

HealsCodes commented 9 years ago

Thanks for pointing this out! It looks like instruments (which Calabash uses) requires an absolute APP_BUNDLE_PATH. This issue is now fixed and included in the 0.11.4.5 release which I pushed to rubygems just now ;)

squidpunch commented 9 years ago

awesome, ill try it out later, thanks for the quick release!

squidpunch commented 9 years ago

hey @Shirk just updated and I'm still seeing the same outcome :|

rake crescentia:run 'iPhone 5s (7.1 Simulator)'
  WARNING! Found 2 iOS/iPhone Developer certificates in the keychain. Set the `codesign_certificate' project setting to explicitely use one of (defaults to the first): iPhone Developer: David Larrabee (FB2V23J4T8), iPhone Developer: David Larrabee (WY2GF49GM5)
       Run Fetching the UUID for 'iPhone 5s (7.1 Simulator)'
       Run Uninstalling com.yourcompany.use-crescentia..
       Run Installing com.yourcompany.use-crescentia on iPhone 5s (7.1 Simulator)..
       Run calabash-env: {"DEVICE_TARGET"=>"iPhone 5s (7.1 Simulator)", "BUNDLE_ID"=>"com.yourcompany.use-crescentia", "APP_BUNDLE_PATH"=>"/Users/davidlarrabee/code/use-crescentia/build/iPhoneSimulator-8.1-Development/use-crescentia.app"}
       Run cucumber []
Feature: Running a test
  As an iOS developer
  I want to have a sample feature file
  So I can begin testing quickly

  Scenario: Example steps                            # features/my_first.feature:6
^C
Exiting... Interrupt again to exit immediately.
HealsCodes commented 9 years ago

Hmm, that's strange - could you provide your project so I can test with that? Also - can you try and run calabash-ios sim acc to make sure accessibility is enabled in the simulator?

squidpunch commented 9 years ago

the project is pretty basic, its just motion create blah, add your gem, do the setup and run.

that being said, I think its something to do with my configuration because i saw this after canceling

 Instruments Usage Error : Ambiguous device name/identifier 'iPhone 5s (7.1 Simulator)':
  iPhone 5s (7.1 Simulator) [1A06D934-E784-4A5F-A003-9AA1BC5E05FA]
  iPhone 5s (7.1 Simulator) [7F6347D1-52A6-4425-B969-65C8A0E6305D]

so the problem is the duplicate names - using another 7.1 simulator worked fine (I have a named one that i just tested and it worked)

HealsCodes commented 9 years ago

Yes, having two devices with the same makes the spec hang again. I added double naming detection to the gem:

~$ rake crescentia:run 'iPhone 5s (7.1 Simulator)'
       Run Fetching the UUID for 'iPhone 5s (7.1 Simulator)'
  WARNING! There is more than one simulator named 'iPhone 5s (7.1 Simulator)':
  WARNING!   'iPhone 5s (7.1 Simulator) [2187788F-4CC1-48D6-A225-486E4DD37186]'
  WARNING!   'iPhone 5s (7.1 Simulator) [04151B79-273C-4C62-B39D-2BA17F9FF28F]'
  WARNING! This will break things unless you pass the complete name and UUID as listed above!
    ERROR! Unable to lookup the UUID for iPhone 5s (7.1 Simulator)!

In cases like this you can pass the complete device name with the UUID like this:

~$ rake crescentia:run 'iPhone 5s (7.1 Simulator) [2187788F-4CC1-48D6-A225-486E4DD37186]'

Let me know if that would work for you @squidpunch.

squidpunch commented 9 years ago

pretty sure that will work, since when i used one with a unique name it worked as well - but ill try to check it later today to verify for you :+1:

HealsCodes commented 9 years ago

Looks like instruments still doesn't launch (calabash-cucmber seems to ignore the UUID..). I released 0.12.0.1 and 0.11.4.6 wich contain at least the warning and will abort for multiple identically named devices.