Skip to content

Commit 1e23309

Browse files
authored
Wait for platform view to appear in iOS UI tests (flutter#19725)
1 parent 91f80ef commit 1e23309

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

testing/scenario_app/ios/Scenarios/ScenariosUITests/UnobstructedPlatformViewTests.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ - (void)testNoOverlay {
2525
[app launch];
2626

2727
XCUIElement* platform_view = app.textViews[@"platform_view[0]"];
28-
XCTAssertTrue(platform_view.exists);
28+
XCTAssertTrue([platform_view waitForExistenceWithTimeout:1.0]);
2929
XCTAssertEqual(platform_view.frame.origin.x, 25);
3030
XCTAssertEqual(platform_view.frame.origin.y, 25);
3131
XCTAssertEqual(platform_view.frame.size.width, 250);
@@ -47,7 +47,7 @@ - (void)testOneOverlay {
4747
[app launch];
4848

4949
XCUIElement* platform_view = app.textViews[@"platform_view[0]"];
50-
XCTAssertTrue(platform_view.exists);
50+
XCTAssertTrue([platform_view waitForExistenceWithTimeout:1.0]);
5151
XCTAssertEqual(platform_view.frame.origin.x, 25);
5252
XCTAssertEqual(platform_view.frame.origin.y, 25);
5353
XCTAssertEqual(platform_view.frame.size.width, 250);
@@ -72,7 +72,7 @@ - (void)testOneOverlayPartialIntersection {
7272
[app launch];
7373

7474
XCUIElement* platform_view = app.textViews[@"platform_view[0]"];
75-
XCTAssertTrue(platform_view.exists);
75+
XCTAssertTrue([platform_view waitForExistenceWithTimeout:1.0]);
7676
XCTAssertEqual(platform_view.frame.origin.x, 25);
7777
XCTAssertEqual(platform_view.frame.origin.y, 25);
7878
XCTAssertEqual(platform_view.frame.size.width, 250);
@@ -100,7 +100,7 @@ - (void)testTwoIntersectingOverlays {
100100
[app launch];
101101

102102
XCUIElement* platform_view = app.textViews[@"platform_view[0]"];
103-
XCTAssertTrue(platform_view.exists);
103+
XCTAssertTrue([platform_view waitForExistenceWithTimeout:1.0]);
104104
XCTAssertEqual(platform_view.frame.origin.x, 25);
105105
XCTAssertEqual(platform_view.frame.origin.y, 25);
106106
XCTAssertEqual(platform_view.frame.size.width, 250);
@@ -129,7 +129,7 @@ - (void)testOneOverlayAndTwoIntersectingOverlays {
129129
[app launch];
130130

131131
XCUIElement* platform_view = app.textViews[@"platform_view[0]"];
132-
XCTAssertTrue(platform_view.exists);
132+
XCTAssertTrue([platform_view waitForExistenceWithTimeout:1.0]);
133133
XCTAssertEqual(platform_view.frame.origin.x, 25);
134134
XCTAssertEqual(platform_view.frame.origin.y, 25);
135135
XCTAssertEqual(platform_view.frame.size.width, 250);
@@ -163,7 +163,7 @@ - (void)testMultiplePlatformViewsWithoutOverlays {
163163
[app launch];
164164

165165
XCUIElement* platform_view1 = app.textViews[@"platform_view[0]"];
166-
XCTAssertTrue(platform_view1.exists);
166+
XCTAssertTrue([platform_view1 waitForExistenceWithTimeout:1.0]);
167167
XCTAssertEqual(platform_view1.frame.origin.x, 25);
168168
XCTAssertEqual(platform_view1.frame.origin.y, 325);
169169
XCTAssertEqual(platform_view1.frame.size.width, 250);
@@ -193,7 +193,7 @@ - (void)testMultiplePlatformViewsWithOverlays {
193193
[app launch];
194194

195195
XCUIElement* platform_view1 = app.textViews[@"platform_view[0]"];
196-
XCTAssertTrue(platform_view1.exists);
196+
XCTAssertTrue([platform_view1 waitForExistenceWithTimeout:1.0]);
197197
XCTAssertEqual(platform_view1.frame.origin.x, 25);
198198
XCTAssertEqual(platform_view1.frame.origin.y, 325);
199199
XCTAssertEqual(platform_view1.frame.size.width, 250);
@@ -235,7 +235,7 @@ - (void)testPlatformViewsMaxOverlays {
235235
[app launch];
236236

237237
XCUIElement* platform_view = app.textViews[@"platform_view[0]"];
238-
XCTAssertTrue(platform_view.exists);
238+
XCTAssertTrue([platform_view waitForExistenceWithTimeout:1.0]);
239239
XCTAssertEqual(platform_view.frame.origin.x, 25);
240240
XCTAssertEqual(platform_view.frame.origin.y, 25);
241241
XCTAssertEqual(platform_view.frame.size.width, 250);

0 commit comments

Comments
 (0)