From 7ec334827ac708edfa6986217b3a41b0814af411 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Mon, 24 Jan 2022 19:50:10 -0800 Subject: [PATCH] Move gallery native UI test launching out of test and into setup (#97177) --- .../ios/GalleryUITests/GalleryUITests.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dev/integration_tests/flutter_gallery/ios/GalleryUITests/GalleryUITests.m b/dev/integration_tests/flutter_gallery/ios/GalleryUITests/GalleryUITests.m index 8d36f2861f..92dde33f29 100644 --- a/dev/integration_tests/flutter_gallery/ios/GalleryUITests/GalleryUITests.m +++ b/dev/integration_tests/flutter_gallery/ios/GalleryUITests/GalleryUITests.m @@ -5,20 +5,22 @@ #import @interface GalleryUITests : XCTestCase +@property (strong) XCUIApplication *app; @end @implementation GalleryUITests - (void)setUp { self.continueAfterFailure = NO; + + XCUIApplication *app = [[XCUIApplication alloc] init]; + [app launch]; + self.app = app; } - (void)testLaunch { - XCUIApplication *app = [[XCUIApplication alloc] init]; - [app launch]; - // Basic smoke test that the app launched and any element was loaded. - XCTAssertTrue([app.otherElements.firstMatch waitForExistenceWithTimeout:60.0]); + XCTAssertTrue([self.app.otherElements.firstMatch waitForExistenceWithTimeout:60.0]); } @end