zalando / SwiftMonkey

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

Using `addDefaultXCTestPrivateActions` does not work in Xcode 10.2 #75

Open fbernutz opened 5 years ago

fbernutz commented 5 years ago

I tried to run the example project in Xcode 10.2 but it seems like monkey.addDefaultXCTestPrivateActions() is not working with this Xcode Version, while using monkey.addDefaultUIAutomationActions() works fine.

"Not working" means, you can not see any paws and nothing happens while running the UITest.

Maybe you have an idea why it's not working?

wojciechczerski commented 5 years ago

Hey @fbernutz and thank you for your report. We got a similar issue reported for the beta release (see #73) and it looks like it's not just a "beta thing". I'll try to find a solution / workaround for this problem and will get back to you as soon as I have something.

wojciechczerski commented 5 years ago

@fbernutz I did some research and as it has been mentioned in #73 the XCEventGenerator class seems to have be removed from the XCTest.framework. Unfortunately I couldn't find anything similar that could be used as a replacement. This means that as for now, I don't have a solution to this issue 😢. As you have mentioned, the monkey.addDefaultUIAutomationActions works fine, but only on a Simulator.

I've already marked this issue with "help wanted". Sorry for not having more positive update 😞

maokaiqian commented 5 years ago

Hello, when can it be solved?

tkirby commented 5 years ago

Maybe add this to the project description so people don't spend time trying to get this running?

kaustubhkabra commented 5 years ago

This issue still persists on public Xcode 10.2. Any further help here?

wojciechczerski commented 5 years ago

Hey, I'm afraid there is no solution since this function was relying on an API that has been removed by Apple. You could try using monkey.addDefaultUIAutomationActions but that one will only work on a Simulator.

yeugeneu commented 5 years ago

Found a workaround per this post

Simply replacing your XCTest.framework on xcode 10.2 with an older version (i tried xcode 10.1) will work.

Look for the framework at the following path:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework

Bintong commented 5 years ago

xcode 10.2 also not work use .addDefaultXCTestPrivateActions .