Enable/Disable Internet in iOS KIF functional testing framework

191 views
Skip to first unread message

Bhuvana K

unread,
Mar 6, 2014, 2:25:10 AM3/6/14
to kif-fr...@googlegroups.com

Hi All,

In Login,after entering the credentials when network connectivity is unavailable an application shows an alert view but how to mock the scenario with KIF iOS functional testing framework, that is to disable or enable the internet.Your inputs would be appreciated.

Thanks in Advance.

Regards,
Bhuvaneshwari KN

Tony Mann

unread,
Mar 6, 2014, 1:09:52 PM3/6/14
to kif-fr...@googlegroups.com
You can either stub out the network call using OCMock (definitely preferred), or instead check if you are running tests and disable the alert (not elegant but often the only way).

To see if you are running KIF, you can do:

BOOL usingKIF = NSClassFromString(@"SenTestCase") != nil;

Tony

--
You received this message because you are subscribed to the Google Groups "KIF iOS Automated Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kif-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Bhuvana K

unread,
Apr 3, 2014, 12:40:31 AM4/3/14
to kif-fr...@googlegroups.com

I have tried using "Network Link Conditioner" to simulate various network conditions.

It works great.

Tony Mann

unread,
Apr 3, 2014, 3:12:16 AM4/3/14
to kif-fr...@googlegroups.com
BTW, if you are running XCTest you need to do:

BOOL usingKIF = NSClassFromString(@“XCTestCase") != nil;

Tony
Reply all
Reply to author
Forward
0 new messages