zalando / SwiftMonkey

A framework for doing randomised UI testing of iOS apps
MIT License
1.95k stars 175 forks source link

Swift 4.2 #63

Closed DwayneCoussement closed 6 years ago

DwayneCoussement commented 6 years ago

This adds compatibility for Xcode 10 and Swift 4.2, no big changes.

jhanzo commented 6 years ago

Hello guys, any update for this PR ?

wojciechczerski commented 6 years ago

@DwayneCoussement Thanks for the PR! @jhanzo I'm on it. Yesterday evening I updated Xcode and tried it out with SwiftMonkey and of course I got some weird errors when running the tests. I'll do my best to merge the PR and have a release today in the evening.

wojciechczerski commented 6 years ago

@DwayneCoussement I am facing some issues with testing SwiftMonkey on Xcode 10. When I reference the library using:

pod 'SwiftMonkey', :git => 'https://github.com/DwayneCoussement/SwiftMonkey.git', :branch => 'Swift4.2'

and then execute pod install and run the tests, I am getting errors like:

Library not loaded: @rpath/libswiftSwiftOnoneSupport.dylib
  Referenced from: /Users/wojciech/Library/Developer/Xcode/DerivedData/TestSwiftMonkey-cuhgvfztlhxtqfhactlejzeqoxgu/Build/Products/Debug-iphonesimulator/TestSwiftMonkeyUITests-Runner.app/PlugIns/TestSwiftMonkeyUITests.xctest/Frameworks/SwiftMonkey.framework/SwiftMonkey
  Reason: image not found)

This is happening as well when I merge your PR and also in the sample app (a new issue has been created). What's crazy is that I know how to fix it. My UI test target references the generated Pods framework like that (this is configured automatically when running pod install):

bildschirmfoto 2018-09-21 um 06 41 58

I have no idea why it's grayed out but I assume it's not a good sign. Anyway if I manually drag 'SwiftMonkey.framework' from Products it will solve the issue.

bildschirmfoto 2018-09-21 um 06 45 18

This should be happening automatically and in my case the Pods_TestSwiftMonkeyUITests should include SwiftMonkey.

Have you been able to successfully test SwiftMonkey on Xcode 10, or is it just an issue on my side?

wojciechczerski commented 6 years ago

Alright, I think I found a possible reason for the errors I'm experiencing. The problem seems to be the New Build System that is enabled in Xcode 10 by default. CocoaPods has an issue open (https://github.com/CocoaPods/CocoaPods/issues/8073) which points to the new system and the incremental build setting. I've tried setting the compilation mode to "Whole Module" but that didn't help. What did help was a switch to the Legacy Build System.

After I did this I was able to test your PR and everything works fine! Thank you 🎉

wojciechczerski commented 6 years ago

@jhanzo I've released version 2.1.1 of SwiftMonkey and SwiftMonkeyPaws!