122 {
123 XCUIApplication*
app = [[XCUIApplication alloc] init];
124 app.launchArguments = @[ @"--gesture-accept", @"--maskview-blocking" ];
125 [app launch];
126
127 NSPredicate* predicateToFindPlatformView =
128 [NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject,
129 NSDictionary<NSString*, id>* _Nullable bindings) {
130 XCUIElement* element = evaluatedObject;
131 return [element.identifier hasPrefix:@"platform_view"];
132 }];
133 XCUIElement* textView =
134 [app.otherElements elementMatchingPredicate:predicateToFindPlatformView].textViews.firstMatch;
136 NSLog(
@"%@",
app.debugDescription);
137 XCTFail(@"Failed due to not able to find any platformView with %@ seconds",
139 }
140
141 XCTAssertNotNil(textView);
142 XCTAssertEqualObjects(textView.label, @"");
143
144 NSPredicate* predicate = [NSPredicate
145 predicateWithFormat:@"label == %@",
146 @"-gestureTouchesBegan-gestureTouchesEnded-platformViewTapped"];
147 XCTNSPredicateExpectation* exception =
148 [[XCTNSPredicateExpectation alloc] initWithPredicate:predicate object:textView];
149
150 XCUICoordinate* coordinate =
151 [self getNormalizedCoordinate:app
152 point:CGVectorMake(textView.frame.origin.x + 10,
153 textView.frame.origin.y + 10)];
154 [coordinate tap];
155
156 [self waitForExpectations:@[ exception ] timeout:kSecondsToWaitForPlatformView];
157 XCTAssertEqualObjects(textView.label,
158 @"-gestureTouchesBegan-gestureTouchesEnded-platformViewTapped");
159}