Skip to content

Commit b07c22a

Browse files
authored
fix: add storage ui launch tests (#1821)
* fix: add storage ui launch tests * rename * dont use sudo or -sdk * revert * storage fixes * style
1 parent 47e6e42 commit b07c22a

File tree

3 files changed

+214
-2
lines changed

3 files changed

+214
-2
lines changed

storage/StorageExample.xcodeproj/project.pbxproj

Lines changed: 136 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 55;
6+
objectVersion = 70;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -36,6 +36,16 @@
3636
EA4A29EA2E6F543800B647BC /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = EA4A29E72E6F543800B647BC /* GoogleService-Info.plist */; };
3737
/* End PBXBuildFile section */
3838

39+
/* Begin PBXContainerItemProxy section */
40+
EA2B4E812ED64431003F9A40 /* PBXContainerItemProxy */ = {
41+
isa = PBXContainerItemProxy;
42+
containerPortal = B9A598B227E3D169003BCFD0 /* Project object */;
43+
proxyType = 1;
44+
remoteGlobalIDString = B9A598B927E3D169003BCFD0;
45+
remoteInfo = StorageExample;
46+
};
47+
/* End PBXContainerItemProxy section */
48+
3949
/* Begin PBXFileReference section */
4050
B94D0ABC27F5060C00753EEA /* StorageExample (macOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "StorageExample (macOS).app"; sourceTree = BUILT_PRODUCTS_DIR; };
4151
B94D0AC227F5060D00753EEA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -51,9 +61,14 @@
5161
B9EABE2127FB82B200E055FD /* StorageExample (tvOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "StorageExample (tvOS).app"; sourceTree = BUILT_PRODUCTS_DIR; };
5262
B9EABE2727FB82B300E055FD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
5363
B9EABE2A27FB82B300E055FD /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
64+
EA2B4E7B2ED64431003F9A40 /* StorageExample_iOS_UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StorageExample_iOS_UITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5465
EA4A29E72E6F543800B647BC /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
5566
/* End PBXFileReference section */
5667

68+
/* Begin PBXFileSystemSynchronizedRootGroup section */
69+
EA2B4E7C2ED64431003F9A40 /* StorageExample_iOS_UITests */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = StorageExample_iOS_UITests; sourceTree = "<group>"; };
70+
/* End PBXFileSystemSynchronizedRootGroup section */
71+
5772
/* Begin PBXFrameworksBuildPhase section */
5873
B94D0AB927F5060C00753EEA /* Frameworks */ = {
5974
isa = PBXFrameworksBuildPhase;
@@ -82,6 +97,13 @@
8297
);
8398
runOnlyForDeploymentPostprocessing = 0;
8499
};
100+
EA2B4E782ED64431003F9A40 /* Frameworks */ = {
101+
isa = PBXFrameworksBuildPhase;
102+
buildActionMask = 2147483647;
103+
files = (
104+
);
105+
runOnlyForDeploymentPostprocessing = 0;
106+
};
85107
/* End PBXFrameworksBuildPhase section */
86108

87109
/* Begin PBXGroup section */
@@ -122,6 +144,7 @@
122144
B9A598BC27E3D169003BCFD0 /* StorageExample (iOS) */,
123145
B94D0ABD27F5060C00753EEA /* StorageExample (macOS) */,
124146
B9EABE2227FB82B200E055FD /* StorageExample (tvOS) */,
147+
EA2B4E7C2ED64431003F9A40 /* StorageExample_iOS_UITests */,
125148
B9A598BB27E3D169003BCFD0 /* Products */,
126149
B9EABE2F27FB82CD00E055FD /* Frameworks */,
127150
);
@@ -133,6 +156,7 @@
133156
B9A598BA27E3D169003BCFD0 /* StorageExample (iOS).app */,
134157
B94D0ABC27F5060C00753EEA /* StorageExample (macOS).app */,
135158
B9EABE2127FB82B200E055FD /* StorageExample (tvOS).app */,
159+
EA2B4E7B2ED64431003F9A40 /* StorageExample_iOS_UITests.xctest */,
136160
);
137161
name = Products;
138162
sourceTree = "<group>";
@@ -244,14 +268,37 @@
244268
productReference = B9EABE2127FB82B200E055FD /* StorageExample (tvOS).app */;
245269
productType = "com.apple.product-type.application";
246270
};
271+
EA2B4E7A2ED64431003F9A40 /* StorageExample_iOS_UITests */ = {
272+
isa = PBXNativeTarget;
273+
buildConfigurationList = EA2B4E852ED64431003F9A40 /* Build configuration list for PBXNativeTarget "StorageExample_iOS_UITests" */;
274+
buildPhases = (
275+
EA2B4E772ED64431003F9A40 /* Sources */,
276+
EA2B4E782ED64431003F9A40 /* Frameworks */,
277+
EA2B4E792ED64431003F9A40 /* Resources */,
278+
);
279+
buildRules = (
280+
);
281+
dependencies = (
282+
EA2B4E822ED64431003F9A40 /* PBXTargetDependency */,
283+
);
284+
fileSystemSynchronizedGroups = (
285+
EA2B4E7C2ED64431003F9A40 /* StorageExample_iOS_UITests */,
286+
);
287+
name = StorageExample_iOS_UITests;
288+
packageProductDependencies = (
289+
);
290+
productName = "StorageExample (iOS) UITests";
291+
productReference = EA2B4E7B2ED64431003F9A40 /* StorageExample_iOS_UITests.xctest */;
292+
productType = "com.apple.product-type.bundle.ui-testing";
293+
};
247294
/* End PBXNativeTarget section */
248295

249296
/* Begin PBXProject section */
250297
B9A598B227E3D169003BCFD0 /* Project object */ = {
251298
isa = PBXProject;
252299
attributes = {
253300
BuildIndependentTargetsInParallel = 1;
254-
LastSwiftUpdateCheck = 1330;
301+
LastSwiftUpdateCheck = 1640;
255302
LastUpgradeCheck = 1610;
256303
TargetAttributes = {
257304
B94D0ABB27F5060C00753EEA = {
@@ -264,6 +311,10 @@
264311
B9EABE2027FB82B200E055FD = {
265312
CreatedOnToolsVersion = 13.3;
266313
};
314+
EA2B4E7A2ED64431003F9A40 = {
315+
CreatedOnToolsVersion = 16.4;
316+
TestTargetID = B9A598B927E3D169003BCFD0;
317+
};
267318
};
268319
};
269320
buildConfigurationList = B9A598B527E3D169003BCFD0 /* Build configuration list for PBXProject "StorageExample" */;
@@ -285,6 +336,7 @@
285336
B9A598B927E3D169003BCFD0 /* StorageExample */,
286337
B94D0ABB27F5060C00753EEA /* StorageExample (macOS) */,
287338
B9EABE2027FB82B200E055FD /* StorageExample (tvOS) */,
339+
EA2B4E7A2ED64431003F9A40 /* StorageExample_iOS_UITests */,
288340
);
289341
};
290342
/* End PBXProject section */
@@ -320,6 +372,13 @@
320372
);
321373
runOnlyForDeploymentPostprocessing = 0;
322374
};
375+
EA2B4E792ED64431003F9A40 /* Resources */ = {
376+
isa = PBXResourcesBuildPhase;
377+
buildActionMask = 2147483647;
378+
files = (
379+
);
380+
runOnlyForDeploymentPostprocessing = 0;
381+
};
323382
/* End PBXResourcesBuildPhase section */
324383

325384
/* Begin PBXSourcesBuildPhase section */
@@ -356,8 +415,23 @@
356415
);
357416
runOnlyForDeploymentPostprocessing = 0;
358417
};
418+
EA2B4E772ED64431003F9A40 /* Sources */ = {
419+
isa = PBXSourcesBuildPhase;
420+
buildActionMask = 2147483647;
421+
files = (
422+
);
423+
runOnlyForDeploymentPostprocessing = 0;
424+
};
359425
/* End PBXSourcesBuildPhase section */
360426

427+
/* Begin PBXTargetDependency section */
428+
EA2B4E822ED64431003F9A40 /* PBXTargetDependency */ = {
429+
isa = PBXTargetDependency;
430+
target = B9A598B927E3D169003BCFD0 /* StorageExample */;
431+
targetProxy = EA2B4E812ED64431003F9A40 /* PBXContainerItemProxy */;
432+
};
433+
/* End PBXTargetDependency section */
434+
361435
/* Begin XCBuildConfiguration section */
362436
B94D0AC827F5060D00753EEA /* Debug */ = {
363437
isa = XCBuildConfiguration;
@@ -652,6 +726,57 @@
652726
};
653727
name = Release;
654728
};
729+
EA2B4E832ED64431003F9A40 /* Debug */ = {
730+
isa = XCBuildConfiguration;
731+
buildSettings = {
732+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
733+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
734+
CODE_SIGN_STYLE = Automatic;
735+
CURRENT_PROJECT_VERSION = 1;
736+
GCC_C_LANGUAGE_STANDARD = gnu17;
737+
GENERATE_INFOPLIST_FILE = YES;
738+
IPHONEOS_DEPLOYMENT_TARGET = 18.5;
739+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
740+
MACOSX_DEPLOYMENT_TARGET = 15.5;
741+
MARKETING_VERSION = 1.0;
742+
PRODUCT_BUNDLE_IDENTIFIER = "com.firebase.StorageExample--iOS--UITests";
743+
PRODUCT_NAME = "$(TARGET_NAME)";
744+
SDKROOT = auto;
745+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
746+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
747+
SWIFT_EMIT_LOC_STRINGS = NO;
748+
SWIFT_VERSION = 5.0;
749+
TARGETED_DEVICE_FAMILY = "1,2,7";
750+
TEST_TARGET_NAME = StorageExample;
751+
XROS_DEPLOYMENT_TARGET = 2.5;
752+
};
753+
name = Debug;
754+
};
755+
EA2B4E842ED64431003F9A40 /* Release */ = {
756+
isa = XCBuildConfiguration;
757+
buildSettings = {
758+
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
759+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
760+
CODE_SIGN_STYLE = Automatic;
761+
CURRENT_PROJECT_VERSION = 1;
762+
GCC_C_LANGUAGE_STANDARD = gnu17;
763+
GENERATE_INFOPLIST_FILE = YES;
764+
IPHONEOS_DEPLOYMENT_TARGET = 18.5;
765+
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
766+
MACOSX_DEPLOYMENT_TARGET = 15.5;
767+
MARKETING_VERSION = 1.0;
768+
PRODUCT_BUNDLE_IDENTIFIER = "com.firebase.StorageExample--iOS--UITests";
769+
PRODUCT_NAME = "$(TARGET_NAME)";
770+
SDKROOT = auto;
771+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
772+
SWIFT_EMIT_LOC_STRINGS = NO;
773+
SWIFT_VERSION = 5.0;
774+
TARGETED_DEVICE_FAMILY = "1,2,7";
775+
TEST_TARGET_NAME = StorageExample;
776+
XROS_DEPLOYMENT_TARGET = 2.5;
777+
};
778+
name = Release;
779+
};
655780
/* End XCBuildConfiguration section */
656781

657782
/* Begin XCConfigurationList section */
@@ -691,6 +816,15 @@
691816
defaultConfigurationIsVisible = 0;
692817
defaultConfigurationName = Release;
693818
};
819+
EA2B4E852ED64431003F9A40 /* Build configuration list for PBXNativeTarget "StorageExample_iOS_UITests" */ = {
820+
isa = XCConfigurationList;
821+
buildConfigurations = (
822+
EA2B4E832ED64431003F9A40 /* Debug */,
823+
EA2B4E842ED64431003F9A40 /* Release */,
824+
);
825+
defaultConfigurationIsVisible = 0;
826+
defaultConfigurationName = Release;
827+
};
694828
/* End XCConfigurationList section */
695829

696830
/* Begin XCRemoteSwiftPackageReference section */
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import XCTest
16+
17+
final class StorageExample_iOS_UITests: XCTestCase {
18+
override func setUpWithError() throws {
19+
// Put setup code here. This method is called before the invocation of each test method in the class.
20+
21+
// In UI tests it is usually best to stop immediately when a failure occurs.
22+
continueAfterFailure = false
23+
24+
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
25+
}
26+
27+
override func tearDownWithError() throws {
28+
// Put teardown code here. This method is called after the invocation of each test method in the class.
29+
}
30+
31+
@MainActor
32+
func testExample() throws {
33+
// UI tests must launch the application that they test.
34+
let app = XCUIApplication()
35+
app.launch()
36+
37+
// Use XCTAssert and related functions to verify your tests produce the correct results.
38+
}
39+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import XCTest
16+
17+
final class StorageExample_iOS_UITestsLaunchTests: XCTestCase {
18+
override class var runsForEachTargetApplicationUIConfiguration: Bool {
19+
true
20+
}
21+
22+
override func setUpWithError() throws {
23+
continueAfterFailure = false
24+
}
25+
26+
@MainActor
27+
func testLaunch() throws {
28+
let app = XCUIApplication()
29+
app.launch()
30+
31+
// Insert steps here to perform after app launch but before taking a screenshot,
32+
// such as logging into a test account or navigating somewhere in the app
33+
34+
let attachment = XCTAttachment(screenshot: app.screenshot())
35+
attachment.name = "Launch Screen"
36+
attachment.lifetime = .keepAlways
37+
add(attachment)
38+
}
39+
}

0 commit comments

Comments
 (0)