ioscocoa-touchautomated-testsintegration-testingkif-framework

KIF Framework for iOS: Can it simulate touch-and-hold gesture?


How do I simulate a touch-and-hold step on a view using the KIF-framework for iOS


Solution

  • There are functions built into the framework now. You can use it like this:

    [steps addObject:[KIFTestStep stepToLongPressViewWithAccessibilityLabel:@"myView" duration:5]];

    or

    [scenario addStep:[KIFTestStep stepToLongPressViewWithAccessibilityLabel:@"myView" duration:5]];

    Obviously the first is for adding to a step and the second is for a scenario.