Skip to content

Commit ffd57e5

Browse files
added performAccessibilityActivateWithEpectedResult: to KIFUIViewTestActor
1 parent 8757ba8 commit ffd57e5

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Sources/KIF/Classes/KIFUIViewTestActor.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ extern NSString *const inputFieldTestString;
192192
*/
193193
- (void)activateCustomActionWithName:(NSString *)name expectedResult:(BOOL)expectedResult;
194194

195+
/*!
196+
@abstract Activates a found element via `accessibilityActivate()`.
197+
@param expectedResult The expected boolean return from activation of the element.
198+
*/
199+
- (void)performAccessibilityActivateWithExpectedResult:(BOOL)expectedResult;
195200

196201
#pragma mark Waiting & Finding
197202

Sources/KIF/Classes/KIFUIViewTestActor.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,20 @@ - (void)activateCustomActionWithName:(NSString *)name expectedResult:(BOOL)expec
411411
return KIFTestStepResultFailure;
412412
}];
413413
}
414+
}
414415

416+
- (void)performAccessibilityActivateWithExpectedResult:(BOOL)expectedResult;
417+
{
418+
@autoreleasepool {
419+
KIFUIObject *found = [self _predicateSearchWithRequiresMatch:YES mustBeTappable:YES];
420+
421+
[self runBlock:^KIFTestStepResult(NSError **error) {
422+
if([found.element accessibilityActivate] == expectedResult) {
423+
return KIFTestStepResultSuccess;
424+
}
425+
return KIFTestStepResultFailure;
426+
}];
427+
}
415428
}
416429

417430
#pragma mark - Scroll/Table/CollectionView Actions

0 commit comments

Comments
 (0)