Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit c8b1d96

Browse files
authored
[image_picker] Move UI test (#4181)
1 parent ed48cff commit c8b1d96

File tree

4 files changed

+25
-164
lines changed

4 files changed

+25
-164
lines changed

packages/image_picker/image_picker/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## NEXT
2+
3+
* Move `ImagePickerFromLimitedGalleryUITests` to `RunnerUITests` target.
4+
15
## 0.8.2
26

37
* Added new methods that return `package:cross_file` `XFile` instances. [Docs](https://pub.dev/documentation/cross_file/latest/index.html).

packages/image_picker/image_picker/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 4 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
2626
9FC8F0E9229FA49E00C8D58F /* gifImage.gif in Resources */ = {isa = PBXBuildFile; fileRef = 9FC8F0E8229FA49E00C8D58F /* gifImage.gif */; };
2727
9FC8F0EC229FA68500C8D58F /* gifImage.gif in Resources */ = {isa = PBXBuildFile; fileRef = 9FC8F0E8229FA49E00C8D58F /* gifImage.gif */; };
28-
BE7AEE7926403CC8006181AA /* ImagePickerFromLimitedGalleryUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = BE7AEE7826403CC8006181AA /* ImagePickerFromLimitedGalleryUITests.m */; };
28+
BE6173D826A958B800D0974D /* ImagePickerFromLimitedGalleryUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = BE6173D726A958B800D0974D /* ImagePickerFromLimitedGalleryUITests.m */; };
2929
F4F7A436CCA4BF276270A3AE /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EC32F6993F4529982D9519F1 /* libPods-Runner.a */; };
3030
/* End PBXBuildFile section */
3131

@@ -44,13 +44,6 @@
4444
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
4545
remoteInfo = Runner;
4646
};
47-
BE7AEE7126403C46006181AA /* PBXContainerItemProxy */ = {
48-
isa = PBXContainerItemProxy;
49-
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
50-
proxyType = 1;
51-
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
52-
remoteInfo = Runner;
53-
};
5447
/* End PBXContainerItemProxy section */
5548

5649
/* Begin PBXCopyFilesBuildPhase section */
@@ -100,7 +93,7 @@
10093
9FC8F0E8229FA49E00C8D58F /* gifImage.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = gifImage.gif; sourceTree = "<group>"; };
10194
9FC8F0ED229FB90B00C8D58F /* ImageUtilTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ImageUtilTests.m; sourceTree = "<group>"; };
10295
A908FAEEA2A9B26D903C09C5 /* libPods-RunnerUITests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerUITests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
103-
BE7AEE6C26403C46006181AA /* RunnerUITestiOS14.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerUITestiOS14.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
96+
BE6173D726A958B800D0974D /* ImagePickerFromLimitedGalleryUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ImagePickerFromLimitedGalleryUITests.m; sourceTree = "<group>"; };
10497
BE7AEE7026403C46006181AA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
10598
BE7AEE7826403CC8006181AA /* ImagePickerFromLimitedGalleryUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ImagePickerFromLimitedGalleryUITests.m; sourceTree = "<group>"; };
10699
DC6FCAAD4E7580C9B3C2E21D /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
@@ -134,13 +127,6 @@
134127
);
135128
runOnlyForDeploymentPostprocessing = 0;
136129
};
137-
BE7AEE6926403C46006181AA /* Frameworks */ = {
138-
isa = PBXFrameworksBuildPhase;
139-
buildActionMask = 2147483647;
140-
files = (
141-
);
142-
runOnlyForDeploymentPostprocessing = 0;
143-
};
144130
/* End PBXFrameworksBuildPhase section */
145131

146132
/* Begin PBXGroup section */
@@ -171,6 +157,7 @@
171157
6801C8372555D726009DAF8D /* RunnerUITests */ = {
172158
isa = PBXGroup;
173159
children = (
160+
BE6173D726A958B800D0974D /* ImagePickerFromLimitedGalleryUITests.m */,
174161
6801C8382555D726009DAF8D /* ImagePickerFromGalleryUITests.m */,
175162
6801C83A2555D726009DAF8D /* Info.plist */,
176163
);
@@ -221,7 +208,6 @@
221208
children = (
222209
97C146EE1CF9000F007C117D /* Runner.app */,
223210
6801C8362555D726009DAF8D /* RunnerUITests.xctest */,
224-
BE7AEE6C26403C46006181AA /* RunnerUITestiOS14.xctest */,
225211
334733F22668136400DCC49E /* RunnerTests.xctest */,
226212
);
227213
name = Products;
@@ -332,24 +318,6 @@
332318
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
333319
productType = "com.apple.product-type.application";
334320
};
335-
BE7AEE6B26403C46006181AA /* RunnerUITestiOS14 */ = {
336-
isa = PBXNativeTarget;
337-
buildConfigurationList = BE7AEE7526403C46006181AA /* Build configuration list for PBXNativeTarget "RunnerUITestiOS14" */;
338-
buildPhases = (
339-
BE7AEE6826403C46006181AA /* Sources */,
340-
BE7AEE6926403C46006181AA /* Frameworks */,
341-
BE7AEE6A26403C46006181AA /* Resources */,
342-
);
343-
buildRules = (
344-
);
345-
dependencies = (
346-
BE7AEE7226403C46006181AA /* PBXTargetDependency */,
347-
);
348-
name = RunnerUITestiOS14;
349-
productName = RunnerUITestiOS14;
350-
productReference = BE7AEE6C26403C46006181AA /* RunnerUITestiOS14.xctest */;
351-
productType = "com.apple.product-type.bundle.ui-testing";
352-
};
353321
/* End PBXNativeTarget section */
354322

355323
/* Begin PBXProject section */
@@ -378,11 +346,6 @@
378346
};
379347
};
380348
};
381-
BE7AEE6B26403C46006181AA = {
382-
CreatedOnToolsVersion = 12.4;
383-
ProvisioningStyle = Automatic;
384-
TestTargetID = 97C146ED1CF9000F007C117D;
385-
};
386349
};
387350
};
388351
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
@@ -401,7 +364,6 @@
401364
97C146ED1CF9000F007C117D /* Runner */,
402365
334733F12668136400DCC49E /* RunnerTests */,
403366
6801C8352555D726009DAF8D /* RunnerUITests */,
404-
BE7AEE6B26403C46006181AA /* RunnerUITestiOS14 */,
405367
);
406368
};
407369
/* End PBXProject section */
@@ -435,13 +397,6 @@
435397
);
436398
runOnlyForDeploymentPostprocessing = 0;
437399
};
438-
BE7AEE6A26403C46006181AA /* Resources */ = {
439-
isa = PBXResourcesBuildPhase;
440-
buildActionMask = 2147483647;
441-
files = (
442-
);
443-
runOnlyForDeploymentPostprocessing = 0;
444-
};
445400
/* End PBXResourcesBuildPhase section */
446401

447402
/* Begin PBXShellScriptBuildPhase section */
@@ -555,6 +510,7 @@
555510
buildActionMask = 2147483647;
556511
files = (
557512
6801C8392555D726009DAF8D /* ImagePickerFromGalleryUITests.m in Sources */,
513+
BE6173D826A958B800D0974D /* ImagePickerFromLimitedGalleryUITests.m in Sources */,
558514
);
559515
runOnlyForDeploymentPostprocessing = 0;
560516
};
@@ -568,14 +524,6 @@
568524
);
569525
runOnlyForDeploymentPostprocessing = 0;
570526
};
571-
BE7AEE6826403C46006181AA /* Sources */ = {
572-
isa = PBXSourcesBuildPhase;
573-
buildActionMask = 2147483647;
574-
files = (
575-
BE7AEE7926403CC8006181AA /* ImagePickerFromLimitedGalleryUITests.m in Sources */,
576-
);
577-
runOnlyForDeploymentPostprocessing = 0;
578-
};
579527
/* End PBXSourcesBuildPhase section */
580528

581529
/* Begin PBXTargetDependency section */
@@ -589,11 +537,6 @@
589537
target = 97C146ED1CF9000F007C117D /* Runner */;
590538
targetProxy = 6801C83B2555D726009DAF8D /* PBXContainerItemProxy */;
591539
};
592-
BE7AEE7226403C46006181AA /* PBXTargetDependency */ = {
593-
isa = PBXTargetDependency;
594-
target = 97C146ED1CF9000F007C117D /* Runner */;
595-
targetProxy = BE7AEE7126403C46006181AA /* PBXContainerItemProxy */;
596-
};
597540
/* End PBXTargetDependency section */
598541

599542
/* Begin PBXVariantGroup section */
@@ -843,53 +786,6 @@
843786
};
844787
name = Release;
845788
};
846-
BE7AEE7326403C46006181AA /* Debug */ = {
847-
isa = XCBuildConfiguration;
848-
buildSettings = {
849-
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
850-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
851-
CLANG_ENABLE_OBJC_WEAK = YES;
852-
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
853-
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
854-
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
855-
CODE_SIGN_STYLE = Automatic;
856-
DEVELOPMENT_TEAM = "";
857-
GCC_C_LANGUAGE_STANDARD = gnu11;
858-
INFOPLIST_FILE = RunnerUITestiOS14/Info.plist;
859-
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
860-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
861-
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
862-
MTL_FAST_MATH = YES;
863-
PRODUCT_BUNDLE_IDENTIFIER = com.baseflow.RunnerUITestiOS14;
864-
PRODUCT_NAME = "$(TARGET_NAME)";
865-
TARGETED_DEVICE_FAMILY = "1,2";
866-
TEST_TARGET_NAME = Runner;
867-
};
868-
name = Debug;
869-
};
870-
BE7AEE7426403C46006181AA /* Release */ = {
871-
isa = XCBuildConfiguration;
872-
buildSettings = {
873-
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
874-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
875-
CLANG_ENABLE_OBJC_WEAK = YES;
876-
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
877-
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
878-
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
879-
CODE_SIGN_STYLE = Automatic;
880-
DEVELOPMENT_TEAM = "";
881-
GCC_C_LANGUAGE_STANDARD = gnu11;
882-
INFOPLIST_FILE = RunnerUITestiOS14/Info.plist;
883-
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
884-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
885-
MTL_FAST_MATH = YES;
886-
PRODUCT_BUNDLE_IDENTIFIER = com.baseflow.RunnerUITestiOS14;
887-
PRODUCT_NAME = "$(TARGET_NAME)";
888-
TARGETED_DEVICE_FAMILY = "1,2";
889-
TEST_TARGET_NAME = Runner;
890-
};
891-
name = Release;
892-
};
893789
/* End XCBuildConfiguration section */
894790

895791
/* Begin XCConfigurationList section */
@@ -929,15 +825,6 @@
929825
defaultConfigurationIsVisible = 0;
930826
defaultConfigurationName = Release;
931827
};
932-
BE7AEE7526403C46006181AA /* Build configuration list for PBXNativeTarget "RunnerUITestiOS14" */ = {
933-
isa = XCConfigurationList;
934-
buildConfigurations = (
935-
BE7AEE7326403C46006181AA /* Debug */,
936-
BE7AEE7426403C46006181AA /* Release */,
937-
);
938-
defaultConfigurationIsVisible = 0;
939-
defaultConfigurationName = Release;
940-
};
941828
/* End XCConfigurationList section */
942829
};
943830
rootObject = 97C146E61CF9000F007C117D /* Project object */;

packages/image_picker/image_picker/example/ios/RunnerUITestiOS14/Info.plist

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,18 @@ - (void)setUp {
2525
__weak typeof(self) weakSelf = self;
2626
[self addUIInterruptionMonitorWithDescription:@"Permission popups"
2727
handler:^BOOL(XCUIElement* _Nonnull interruptingElement) {
28-
if (@available(iOS 14, *)) {
29-
XCUIElement* limitedPhotoPermission =
30-
[interruptingElement.buttons elementBoundByIndex:0];
31-
if (![limitedPhotoPermission
32-
waitForExistenceWithTimeout:
33-
kLimitedElementWaitingTime]) {
34-
os_log_error(OS_LOG_DEFAULT, "%@",
35-
weakSelf.app.debugDescription);
36-
XCTFail(@"Failed due to not able to find "
37-
@"selectPhotos butt on with %@ seconds",
38-
@(kLimitedElementWaitingTime));
39-
}
40-
[limitedPhotoPermission tap];
41-
} else {
42-
XCUIElement* ok = interruptingElement.buttons[@"OK"];
43-
if (![ok waitForExistenceWithTimeout:
44-
kLimitedElementWaitingTime]) {
45-
os_log_error(OS_LOG_DEFAULT, "%@",
46-
weakSelf.app.debugDescription);
47-
XCTFail(@"Failed due to not able to find ok button "
48-
@"with %@ seconds",
49-
@(kLimitedElementWaitingTime));
50-
}
51-
[ok tap];
28+
XCUIElement* limitedPhotoPermission =
29+
[interruptingElement.buttons elementBoundByIndex:0];
30+
if (![limitedPhotoPermission
31+
waitForExistenceWithTimeout:
32+
kLimitedElementWaitingTime]) {
33+
os_log_error(OS_LOG_DEFAULT, "%@",
34+
weakSelf.app.debugDescription);
35+
XCTFail(@"Failed due to not able to find "
36+
@"selectPhotos button with %@ seconds",
37+
@(kLimitedElementWaitingTime));
5238
}
39+
[limitedPhotoPermission tap];
5340
return YES;
5441
}];
5542
}
@@ -60,7 +47,12 @@ - (void)tearDown {
6047
}
6148

6249
- (void)testSelectingFromGallery {
63-
[self launchPickerAndSelect];
50+
// Test the `Select Photos` button which is available after iOS 14.
51+
if (@available(iOS 14, *)) {
52+
[self launchPickerAndSelect];
53+
} else {
54+
return;
55+
}
6456
}
6557

6658
- (void)launchPickerAndSelect {

0 commit comments

Comments
 (0)