zalando / SwiftMonkey

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

Create Objective-C version of MonkeyPaws? #12

Closed DagAgren closed 5 years ago

DagAgren commented 7 years ago

It might be worth creating an Objective-C version of MonkeyPaws, so that it can be more easily included in Objective-C only projects.

The test side can still use Swift without forcing the rest of the app to use it, and doesn't really need an Objective-C version, but the embedded visualisation could benefit.

If this is something you would like, please comment.

LaceLetho commented 7 years ago

I'm blocked by the same issue. I have imported SwiftMonkeyPaw into an Objective-C project, but it doesn't work at runtime. //AppDelegate.h @import SwiftMonkeyPaws; @property (strong, nonatomic) MonkeyPaws *paws; //AppDelegate.m @import SwiftMonkeyPaws; self.paws = [[MonkeyPaws alloc] initWithView:self.window tapUIApplication:true];

DagAgren commented 7 years ago

What happens exactly? Does it crash, or just not do anything?

If it does nothing, can you try putting a breakpoint in the append function to see if it ever gets called?

LaceLetho commented 7 years ago

The paw's layer didn't display, however, I have found the problem. I inited MonkeyPaws too earlier, as my Objective-C project modified the UIApplication in the method (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions It worked after put the init statement behind :)

DagAgren commented 7 years ago

Oh good, at least that is solved then!

ClarkLang commented 7 years ago

Hi guys, help me please! I did the following step: //AppDelegate.h @import SwiftMonkeyPaws; @property (strong, nonatomic) MonkeyPaws *paws;

//AppDelegate.m @import SwiftMonkeyPaws; self.paws = [[MonkeyPaws alloc] initWithView:self.window tapUIApplication:true];

But in AppDelegate.h, failed in line : @import SwiftMonkeyPaws; error message: AppDelegate.h:15:1: Use of '@import' when C++ modules are disabled, consider using fmodules and fcxx-modules. And in AppDelegate.m, no error for @import SwiftMonkeyPaws;

Could you guys help to take a look? How can I fix it? thanks very much. :D

donaldhu commented 6 years ago

I might be a bit late, but I've been working on an Objective-C version of MonkeyPaws. Please have a look here: https://github.com/donaldhu/xc-auto-monkey

lilSwifty commented 5 years ago

What if it is a mix and match project of Swift & Obj C. Will SwiftMonkey function the way it should?

wojciechczerski commented 5 years ago

Closing due to inactivity. Please reopen the issue if you think it should be addressed.