@@ -28,24 +28,25 @@ - (void)testRejectPolicyUtilTouchesEnded {
2828 XCUIElement* element = evaluatedObject;
2929 return [element.identifier hasPrefix: @" platform_view" ];
3030 }];
31- XCUIElement* platformView = [app.textViews elementMatchingPredicate: predicateToFindPlatformView];
32- if (![platformView waitForExistenceWithTimeout: kSecondsToWaitForPlatformView ]) {
31+ XCUIElement* textView =
32+ [app.otherElements elementMatchingPredicate: predicateToFindPlatformView].textViews .firstMatch ;
33+ if (![textView waitForExistenceWithTimeout: kSecondsToWaitForPlatformView ]) {
3334 NSLog (@" %@ " , app.debugDescription );
34- XCTFail (@" Failed due to not able to find any platformView with %@ seconds" ,
35+ XCTFail (@" Failed due to not able to find any textView with %@ seconds" ,
3536 @(kSecondsToWaitForPlatformView ));
3637 }
3738
38- XCTAssertNotNil (platformView );
39- XCTAssertEqualObjects (platformView .label , @" " );
39+ XCTAssertNotNil (textView );
40+ XCTAssertEqualObjects (textView .label , @" " );
4041
4142 NSPredicate * predicate =
4243 [NSPredicate predicateWithFormat: @" label == %@" , @" -gestureTouchesBegan-gestureTouchesEnded" ];
4344 XCTNSPredicateExpectation* exception =
44- [[XCTNSPredicateExpectation alloc ] initWithPredicate: predicate object: platformView ];
45+ [[XCTNSPredicateExpectation alloc ] initWithPredicate: predicate object: textView ];
4546
46- [platformView tap ];
47+ [textView tap ];
4748 [self waitForExpectations: @[ exception ] timeout: kSecondsToWaitForPlatformView ];
48- XCTAssertEqualObjects (platformView .label , @" -gestureTouchesBegan-gestureTouchesEnded" );
49+ XCTAssertEqualObjects (textView .label , @" -gestureTouchesBegan-gestureTouchesEnded" );
4950}
5051
5152- (void )testRejectPolicyEager {
@@ -59,15 +60,16 @@ - (void)testRejectPolicyEager {
5960 XCUIElement* element = evaluatedObject;
6061 return [element.identifier hasPrefix: @" platform_view" ];
6162 }];
62- XCUIElement* platformView = [app.textViews elementMatchingPredicate: predicateToFindPlatformView];
63- if (![platformView waitForExistenceWithTimeout: kSecondsToWaitForPlatformView ]) {
63+ XCUIElement* textView =
64+ [app.otherElements elementMatchingPredicate: predicateToFindPlatformView].textViews .firstMatch ;
65+ if (![textView waitForExistenceWithTimeout: kSecondsToWaitForPlatformView ]) {
6466 NSLog (@" %@ " , app.debugDescription );
65- XCTFail (@" Failed due to not able to find any platformView with %@ seconds" ,
67+ XCTFail (@" Failed due to not able to find any textView with %@ seconds" ,
6668 @(kSecondsToWaitForPlatformView ));
6769 }
6870
69- XCTAssertNotNil (platformView );
70- XCTAssertEqualObjects (platformView .label , @" " );
71+ XCTAssertNotNil (textView );
72+ XCTAssertEqualObjects (textView .label , @" " );
7173
7274 NSPredicate * predicate =
7375 [NSPredicate predicateWithBlock: ^BOOL (id _Nullable evaluatedObject,
@@ -76,11 +78,11 @@ - (void)testRejectPolicyEager {
7678 return [view.label containsString: @" -gestureTouchesBegan" ];
7779 }];
7880 XCTNSPredicateExpectation* exception =
79- [[XCTNSPredicateExpectation alloc ] initWithPredicate: predicate object: platformView ];
81+ [[XCTNSPredicateExpectation alloc ] initWithPredicate: predicate object: textView ];
8082
81- [platformView tap ];
83+ [textView tap ];
8284 [self waitForExpectations: @[ exception ] timeout: kSecondsToWaitForPlatformView ];
83- XCTAssertTrue ([platformView .label containsString: @" -gestureTouchesBegan" ]);
85+ XCTAssertTrue ([textView .label containsString: @" -gestureTouchesBegan" ]);
8486}
8587
8688- (void )testAccept {
@@ -94,26 +96,27 @@ - (void)testAccept {
9496 XCUIElement* element = evaluatedObject;
9597 return [element.identifier hasPrefix: @" platform_view" ];
9698 }];
97- XCUIElement* platformView = [app.textViews elementMatchingPredicate: predicateToFindPlatformView];
98- if (![platformView waitForExistenceWithTimeout: kSecondsToWaitForPlatformView ]) {
99+ XCUIElement* textView =
100+ [app.otherElements elementMatchingPredicate: predicateToFindPlatformView].textViews .firstMatch ;
101+ if (![textView waitForExistenceWithTimeout: kSecondsToWaitForPlatformView ]) {
99102 NSLog (@" %@ " , app.debugDescription );
100- XCTFail (@" Failed due to not able to find any platformView with %@ seconds" ,
103+ XCTFail (@" Failed due to not able to find any textView with %@ seconds" ,
101104 @(kSecondsToWaitForPlatformView ));
102105 }
103106
104- XCTAssertNotNil (platformView );
105- XCTAssertEqualObjects (platformView .label , @" " );
107+ XCTAssertNotNil (textView );
108+ XCTAssertEqualObjects (textView .label , @" " );
106109
107110 NSPredicate * predicate = [NSPredicate
108111 predicateWithFormat: @" label == %@ " ,
109112 @" -gestureTouchesBegan-gestureTouchesEnded-platformViewTapped" ];
110113 XCTNSPredicateExpectation* exception =
111- [[XCTNSPredicateExpectation alloc ] initWithPredicate: predicate object: platformView ];
114+ [[XCTNSPredicateExpectation alloc ] initWithPredicate: predicate object: textView ];
112115
113- [platformView tap ];
116+ [textView tap ];
114117
115118 [self waitForExpectations: @[ exception ] timeout: kSecondsToWaitForPlatformView ];
116- XCTAssertEqualObjects (platformView .label ,
119+ XCTAssertEqualObjects (textView .label ,
117120 @" -gestureTouchesBegan-gestureTouchesEnded-platformViewTapped" );
118121}
119122
@@ -128,30 +131,31 @@ - (void)testGestureWithMaskViewBlockingPlatformView {
128131 XCUIElement* element = evaluatedObject;
129132 return [element.identifier hasPrefix: @" platform_view" ];
130133 }];
131- XCUIElement* platformView = [app.textViews elementMatchingPredicate: predicateToFindPlatformView];
132- if (![platformView waitForExistenceWithTimeout: kSecondsToWaitForPlatformView ]) {
134+ XCUIElement* textView =
135+ [app.otherElements elementMatchingPredicate: predicateToFindPlatformView].textViews .firstMatch ;
136+ if (![textView waitForExistenceWithTimeout: kSecondsToWaitForPlatformView ]) {
133137 NSLog (@" %@ " , app.debugDescription );
134138 XCTFail (@" Failed due to not able to find any platformView with %@ seconds" ,
135139 @(kSecondsToWaitForPlatformView ));
136140 }
137141
138- XCTAssertNotNil (platformView );
139- XCTAssertEqualObjects (platformView .label , @" " );
142+ XCTAssertNotNil (textView );
143+ XCTAssertEqualObjects (textView .label , @" " );
140144
141145 NSPredicate * predicate = [NSPredicate
142146 predicateWithFormat: @" label == %@ " ,
143147 @" -gestureTouchesBegan-gestureTouchesEnded-platformViewTapped" ];
144148 XCTNSPredicateExpectation* exception =
145- [[XCTNSPredicateExpectation alloc ] initWithPredicate: predicate object: platformView ];
149+ [[XCTNSPredicateExpectation alloc ] initWithPredicate: predicate object: textView ];
146150
147151 XCUICoordinate* coordinate =
148152 [self getNormalizedCoordinate: app
149- point: CGVectorMake (platformView .frame.origin.x + 10 ,
150- platformView .frame.origin.y + 10 )];
153+ point: CGVectorMake (textView .frame.origin.x + 10 ,
154+ textView .frame.origin.y + 10 )];
151155 [coordinate tap ];
152156
153157 [self waitForExpectations: @[ exception ] timeout: kSecondsToWaitForPlatformView ];
154- XCTAssertEqualObjects (platformView .label ,
158+ XCTAssertEqualObjects (textView .label ,
155159 @" -gestureTouchesBegan-gestureTouchesEnded-platformViewTapped" );
156160}
157161
0 commit comments