Skip to content

Commit 708c363

Browse files
Revert "Delete flaky flutter_gallery XCUITest (#103666)" (#103726)
This reverts commit 145be18.
1 parent 145be18 commit 708c363

File tree

5 files changed

+237
-2
lines changed

5 files changed

+237
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright 2014 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'package:flutter_devicelab/framework/devices.dart';
6+
import 'package:flutter_devicelab/framework/framework.dart';
7+
import 'package:flutter_devicelab/framework/ios.dart';
8+
import 'package:flutter_devicelab/framework/task_result.dart';
9+
import 'package:flutter_devicelab/framework/utils.dart';
10+
import 'package:path/path.dart' as path;
11+
12+
Future<void> main() async {
13+
deviceOperatingSystem = DeviceOperatingSystem.ios;
14+
15+
await task(() async {
16+
final String projectDirectory = '${flutterDirectory.path}/dev/integration_tests/flutter_gallery';
17+
18+
await inDirectory(projectDirectory, () async {
19+
section('Build clean');
20+
21+
await flutter('clean');
22+
23+
section('Build gallery app');
24+
25+
await flutter(
26+
'build',
27+
options: <String>[
28+
'ios',
29+
'-v',
30+
'--release',
31+
'--config-only',
32+
],
33+
);
34+
});
35+
36+
section('Run platform unit tests');
37+
38+
final Device device = await devices.workingDevice;
39+
if (!await runXcodeTests(
40+
platformDirectory: path.join(projectDirectory, 'ios'),
41+
destination: 'id=${device.deviceId}',
42+
testName: 'native_ui_tests_ios',
43+
)) {
44+
return TaskResult.failure('Platform unit tests failed');
45+
}
46+
47+
return TaskResult.success(null);
48+
});
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2014 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#import <XCTest/XCTest.h>
6+
7+
@interface GalleryUITests : XCTestCase
8+
@property (strong) XCUIApplication *app;
9+
@end
10+
11+
@implementation GalleryUITests
12+
13+
- (void)setUp {
14+
self.continueAfterFailure = NO;
15+
16+
XCUIApplication *app = [[XCUIApplication alloc] init];
17+
[app launch];
18+
self.app = app;
19+
}
20+
21+
- (void)testLaunch {
22+
// Basic smoke test that the app launched and any element was loaded.
23+
XCTAssertTrue([self.app.otherElements.firstMatch waitForExistenceWithTimeout:60.0]);
24+
}
25+
26+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
</dict>
22+
</plist>

dev/integration_tests/flutter_gallery/ios/Runner.xcodeproj/project.pbxproj

+130-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -15,8 +15,19 @@
1515
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1616
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
1717
AA1F617779EAA28FB12EC66E /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C77CA0BBC4B57129484236F4 /* libPods-Runner.a */; };
18+
F7C2268825DCA70C00389C82 /* GalleryUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = F7C2268725DCA70C00389C82 /* GalleryUITests.m */; };
1819
/* End PBXBuildFile section */
1920

21+
/* Begin PBXContainerItemProxy section */
22+
F7C2268A25DCA70C00389C82 /* PBXContainerItemProxy */ = {
23+
isa = PBXContainerItemProxy;
24+
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
25+
proxyType = 1;
26+
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
27+
remoteInfo = Runner;
28+
};
29+
/* End PBXContainerItemProxy section */
30+
2031
/* Begin PBXCopyFilesBuildPhase section */
2132
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
2233
isa = PBXCopyFilesBuildPhase;
@@ -49,6 +60,9 @@
4960
C77CA0BBC4B57129484236F4 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5061
DC01738FBE39EADD5AC4BF42 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
5162
ECF490DDAB8ABCEEFB1780BE /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
63+
F7C2268525DCA70C00389C82 /* GalleryUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GalleryUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
64+
F7C2268725DCA70C00389C82 /* GalleryUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GalleryUITests.m; sourceTree = "<group>"; };
65+
F7C2268925DCA70C00389C82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5266
/* End PBXFileReference section */
5367

5468
/* Begin PBXFrameworksBuildPhase section */
@@ -60,6 +74,13 @@
6074
);
6175
runOnlyForDeploymentPostprocessing = 0;
6276
};
77+
F7C2268225DCA70C00389C82 /* Frameworks */ = {
78+
isa = PBXFrameworksBuildPhase;
79+
buildActionMask = 2147483647;
80+
files = (
81+
);
82+
runOnlyForDeploymentPostprocessing = 0;
83+
};
6384
/* End PBXFrameworksBuildPhase section */
6485

6586
/* Begin PBXGroup section */
@@ -79,6 +100,7 @@
79100
children = (
80101
9740EEB11CF90186004384FC /* Flutter */,
81102
97C146F01CF9000F007C117D /* Runner */,
103+
F7C2268625DCA70C00389C82 /* GalleryUITests */,
82104
97C146EF1CF9000F007C117D /* Products */,
83105
CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
84106
E54E8B7296D73DD9B2385312 /* Pods */,
@@ -89,6 +111,7 @@
89111
isa = PBXGroup;
90112
children = (
91113
97C146EE1CF9000F007C117D /* Flutter Gallery.app */,
114+
F7C2268525DCA70C00389C82 /* GalleryUITests.xctest */,
92115
);
93116
name = Products;
94117
sourceTree = "<group>";
@@ -135,6 +158,15 @@
135158
name = Pods;
136159
sourceTree = "<group>";
137160
};
161+
F7C2268625DCA70C00389C82 /* GalleryUITests */ = {
162+
isa = PBXGroup;
163+
children = (
164+
F7C2268725DCA70C00389C82 /* GalleryUITests.m */,
165+
F7C2268925DCA70C00389C82 /* Info.plist */,
166+
);
167+
path = GalleryUITests;
168+
sourceTree = "<group>";
169+
};
138170
/* End PBXGroup section */
139171

140172
/* Begin PBXNativeTarget section */
@@ -159,6 +191,24 @@
159191
productReference = 97C146EE1CF9000F007C117D /* Flutter Gallery.app */;
160192
productType = "com.apple.product-type.application";
161193
};
194+
F7C2268425DCA70C00389C82 /* GalleryUITests */ = {
195+
isa = PBXNativeTarget;
196+
buildConfigurationList = F7C2268F25DCA70C00389C82 /* Build configuration list for PBXNativeTarget "GalleryUITests" */;
197+
buildPhases = (
198+
F7C2268125DCA70C00389C82 /* Sources */,
199+
F7C2268225DCA70C00389C82 /* Frameworks */,
200+
F7C2268325DCA70C00389C82 /* Resources */,
201+
);
202+
buildRules = (
203+
);
204+
dependencies = (
205+
F7C2268B25DCA70C00389C82 /* PBXTargetDependency */,
206+
);
207+
name = GalleryUITests;
208+
productName = GalleryUITests;
209+
productReference = F7C2268525DCA70C00389C82 /* GalleryUITests.xctest */;
210+
productType = "com.apple.product-type.bundle.ui-testing";
211+
};
162212
/* End PBXNativeTarget section */
163213

164214
/* Begin PBXProject section */
@@ -171,6 +221,11 @@
171221
97C146ED1CF9000F007C117D = {
172222
CreatedOnToolsVersion = 7.3.1;
173223
};
224+
F7C2268425DCA70C00389C82 = {
225+
CreatedOnToolsVersion = 12.4;
226+
ProvisioningStyle = Automatic;
227+
TestTargetID = 97C146ED1CF9000F007C117D;
228+
};
174229
};
175230
};
176231
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
@@ -187,6 +242,7 @@
187242
projectRoot = "";
188243
targets = (
189244
97C146ED1CF9000F007C117D /* Runner */,
245+
F7C2268425DCA70C00389C82 /* GalleryUITests */,
190246
);
191247
};
192248
/* End PBXProject section */
@@ -203,6 +259,13 @@
203259
);
204260
runOnlyForDeploymentPostprocessing = 0;
205261
};
262+
F7C2268325DCA70C00389C82 /* Resources */ = {
263+
isa = PBXResourcesBuildPhase;
264+
buildActionMask = 2147483647;
265+
files = (
266+
);
267+
runOnlyForDeploymentPostprocessing = 0;
268+
};
206269
/* End PBXResourcesBuildPhase section */
207270

208271
/* Begin PBXShellScriptBuildPhase section */
@@ -250,7 +313,7 @@
250313
);
251314
runOnlyForDeploymentPostprocessing = 0;
252315
shellPath = /bin/sh;
253-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
316+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
254317
};
255318
/* End PBXShellScriptBuildPhase section */
256319

@@ -265,8 +328,24 @@
265328
);
266329
runOnlyForDeploymentPostprocessing = 0;
267330
};
331+
F7C2268125DCA70C00389C82 /* Sources */ = {
332+
isa = PBXSourcesBuildPhase;
333+
buildActionMask = 2147483647;
334+
files = (
335+
F7C2268825DCA70C00389C82 /* GalleryUITests.m in Sources */,
336+
);
337+
runOnlyForDeploymentPostprocessing = 0;
338+
};
268339
/* End PBXSourcesBuildPhase section */
269340

341+
/* Begin PBXTargetDependency section */
342+
F7C2268B25DCA70C00389C82 /* PBXTargetDependency */ = {
343+
isa = PBXTargetDependency;
344+
target = 97C146ED1CF9000F007C117D /* Runner */;
345+
targetProxy = F7C2268A25DCA70C00389C82 /* PBXContainerItemProxy */;
346+
};
347+
/* End PBXTargetDependency section */
348+
270349
/* Begin PBXVariantGroup section */
271350
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
272351
isa = PBXVariantGroup;
@@ -479,6 +558,45 @@
479558
};
480559
name = Release;
481560
};
561+
F7C2268C25DCA70C00389C82 /* Debug */ = {
562+
isa = XCBuildConfiguration;
563+
buildSettings = {
564+
INFOPLIST_FILE = GalleryUITests/Info.plist;
565+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
566+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
567+
MTL_FAST_MATH = YES;
568+
PRODUCT_BUNDLE_IDENTIFIER = com.flutterio.GalleryUITests;
569+
PRODUCT_NAME = "$(TARGET_NAME)";
570+
TEST_TARGET_NAME = Runner;
571+
};
572+
name = Debug;
573+
};
574+
F7C2268D25DCA70C00389C82 /* Release */ = {
575+
isa = XCBuildConfiguration;
576+
buildSettings = {
577+
INFOPLIST_FILE = GalleryUITests/Info.plist;
578+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
579+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
580+
MTL_FAST_MATH = YES;
581+
PRODUCT_BUNDLE_IDENTIFIER = com.flutterio.GalleryUITests;
582+
PRODUCT_NAME = "$(TARGET_NAME)";
583+
TEST_TARGET_NAME = Runner;
584+
};
585+
name = Release;
586+
};
587+
F7C2268E25DCA70C00389C82 /* Profile */ = {
588+
isa = XCBuildConfiguration;
589+
buildSettings = {
590+
INFOPLIST_FILE = GalleryUITests/Info.plist;
591+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
592+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
593+
MTL_FAST_MATH = YES;
594+
PRODUCT_BUNDLE_IDENTIFIER = com.flutterio.GalleryUITests;
595+
PRODUCT_NAME = "$(TARGET_NAME)";
596+
TEST_TARGET_NAME = Runner;
597+
};
598+
name = Profile;
599+
};
482600
/* End XCBuildConfiguration section */
483601

484602
/* Begin XCConfigurationList section */
@@ -502,6 +620,16 @@
502620
defaultConfigurationIsVisible = 0;
503621
defaultConfigurationName = Release;
504622
};
623+
F7C2268F25DCA70C00389C82 /* Build configuration list for PBXNativeTarget "GalleryUITests" */ = {
624+
isa = XCConfigurationList;
625+
buildConfigurations = (
626+
F7C2268C25DCA70C00389C82 /* Debug */,
627+
F7C2268D25DCA70C00389C82 /* Release */,
628+
F7C2268E25DCA70C00389C82 /* Profile */,
629+
);
630+
defaultConfigurationIsVisible = 0;
631+
defaultConfigurationName = Release;
632+
};
505633
/* End XCConfigurationList section */
506634
};
507635
rootObject = 97C146E61CF9000F007C117D /* Project object */;

dev/integration_tests/flutter_gallery/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

+10
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737
</BuildableReference>
3838
</MacroExpansion>
3939
<Testables>
40+
<TestableReference
41+
skipped = "NO">
42+
<BuildableReference
43+
BuildableIdentifier = "primary"
44+
BlueprintIdentifier = "F7C2268425DCA70C00389C82"
45+
BuildableName = "GalleryUITests.xctest"
46+
BlueprintName = "GalleryUITests"
47+
ReferencedContainer = "container:Runner.xcodeproj">
48+
</BuildableReference>
49+
</TestableReference>
4050
</Testables>
4151
</TestAction>
4252
<LaunchAction

0 commit comments

Comments
 (0)