SwiftMonkey icon indicating copy to clipboard operation
SwiftMonkey copied to clipboard

Using `addDefaultXCTestPrivateActions` does not work in Xcode 10.2

Open fbernutz opened this issue 5 years ago • 8 comments

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?

fbernutz avatar Apr 02 '19 19:04 fbernutz

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 avatar Apr 03 '19 20:04 wojciechczerski

@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 😞

wojciechczerski avatar Apr 09 '19 22:04 wojciechczerski

Hello, when can it be solved?

maokaiqian avatar Apr 19 '19 04:04 maokaiqian

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

tkirby avatar Apr 23 '19 05:04 tkirby

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

kaustubhkabra avatar Jun 25 '19 03:06 kaustubhkabra

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.

wojciechczerski avatar Jun 25 '19 04:06 wojciechczerski

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

yeugeneu avatar Jul 10 '19 23:07 yeugeneu

xcode 10.2 also not work use .addDefaultXCTestPrivateActions .

Bintong avatar Jul 29 '19 06:07 Bintong