Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions storage/StorageExample (iOS) UITests/StorageExampleUITests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import XCTest

final class StorageExample__iOS__UITests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.

// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false

// 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.
}
Comment on lines +19 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Boilerplate comments should be removed to improve readability. Also, it's required to call super.setUpWithError() when overriding this method.

    override func setUpWithError() throws {
        try super.setUpWithError()
        continueAfterFailure = false
    }


override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
Comment on lines +28 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This method is empty, but when overriding tearDownWithError, you must call super.tearDownWithError(). Since there is no other teardown logic, this method can be removed entirely. If you intend to add logic later, ensure you include the super call.


@MainActor
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()

// Use XCTAssert and related functions to verify your tests produce the correct results.
}
Comment on lines +32 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This placeholder test should be improved. The name testExample is not descriptive and should be renamed to reflect what is being tested (e.g., testAppLaunchesSuccessfully). Also, boilerplate comments should be removed and an actual assertion should be added to verify the app state after launch.

    @MainActor
    func testAppLaunchesSuccessfully() throws {
        let app = XCUIApplication()
        app.launch()
        XCTAssertTrue(app.exists)
    }


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import XCTest

final class StorageExample__iOS__UITestsLaunchTests: XCTestCase {

override class var runsForEachTargetApplicationUIConfiguration: Bool {
true
}

override func setUpWithError() throws {
continueAfterFailure = false
}
Comment on lines +23 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

When overriding setUpWithError(), you must call super.setUpWithError().

Suggested change
override func setUpWithError() throws {
continueAfterFailure = false
}
override func setUpWithError() throws {
try super.setUpWithError()
continueAfterFailure = false
}


@MainActor
func testLaunch() throws {
let app = XCUIApplication()
app.launch()

// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app
Comment on lines +32 to +33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These boilerplate comments can be removed to improve code clarity.


let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = "Launch Screen"
attachment.lifetime = .keepAlways
add(attachment)
}
}
138 changes: 136 additions & 2 deletions storage/StorageExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 55;
objectVersion = 70;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -36,6 +36,16 @@
EA4A29EA2E6F543800B647BC /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = EA4A29E72E6F543800B647BC /* GoogleService-Info.plist */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
EA2B4E812ED64431003F9A40 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = B9A598B227E3D169003BCFD0 /* Project object */;
proxyType = 1;
remoteGlobalIDString = B9A598B927E3D169003BCFD0;
remoteInfo = StorageExample;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
B94D0ABC27F5060C00753EEA /* StorageExample (macOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "StorageExample (macOS).app"; sourceTree = BUILT_PRODUCTS_DIR; };
B94D0AC227F5060D00753EEA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand All @@ -51,9 +61,14 @@
B9EABE2127FB82B200E055FD /* StorageExample (tvOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "StorageExample (tvOS).app"; sourceTree = BUILT_PRODUCTS_DIR; };
B9EABE2727FB82B300E055FD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
B9EABE2A27FB82B300E055FD /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
EA2B4E7B2ED64431003F9A40 /* StorageExample (iOS) UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "StorageExample (iOS) UITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
EA4A29E72E6F543800B647BC /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedRootGroup section */
EA2B4E7C2ED64431003F9A40 /* StorageExample (iOS) UITests */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = "StorageExample (iOS) UITests"; sourceTree = "<group>"; };
/* End PBXFileSystemSynchronizedRootGroup section */

/* Begin PBXFrameworksBuildPhase section */
B94D0AB927F5060C00753EEA /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
Expand Down Expand Up @@ -82,6 +97,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
EA2B4E782ED64431003F9A40 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
Expand Down Expand Up @@ -122,6 +144,7 @@
B9A598BC27E3D169003BCFD0 /* StorageExample (iOS) */,
B94D0ABD27F5060C00753EEA /* StorageExample (macOS) */,
B9EABE2227FB82B200E055FD /* StorageExample (tvOS) */,
EA2B4E7C2ED64431003F9A40 /* StorageExample (iOS) UITests */,
B9A598BB27E3D169003BCFD0 /* Products */,
B9EABE2F27FB82CD00E055FD /* Frameworks */,
);
Expand All @@ -133,6 +156,7 @@
B9A598BA27E3D169003BCFD0 /* StorageExample (iOS).app */,
B94D0ABC27F5060C00753EEA /* StorageExample (macOS).app */,
B9EABE2127FB82B200E055FD /* StorageExample (tvOS).app */,
EA2B4E7B2ED64431003F9A40 /* StorageExample (iOS) UITests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -244,14 +268,37 @@
productReference = B9EABE2127FB82B200E055FD /* StorageExample (tvOS).app */;
productType = "com.apple.product-type.application";
};
EA2B4E7A2ED64431003F9A40 /* StorageExample (iOS) UITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = EA2B4E852ED64431003F9A40 /* Build configuration list for PBXNativeTarget "StorageExample (iOS) UITests" */;
buildPhases = (
EA2B4E772ED64431003F9A40 /* Sources */,
EA2B4E782ED64431003F9A40 /* Frameworks */,
EA2B4E792ED64431003F9A40 /* Resources */,
);
buildRules = (
);
dependencies = (
EA2B4E822ED64431003F9A40 /* PBXTargetDependency */,
);
fileSystemSynchronizedGroups = (
EA2B4E7C2ED64431003F9A40 /* StorageExample (iOS) UITests */,
);
name = "StorageExample (iOS) UITests";
packageProductDependencies = (
);
productName = "StorageExample (iOS) UITests";
productReference = EA2B4E7B2ED64431003F9A40 /* StorageExample (iOS) UITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
B9A598B227E3D169003BCFD0 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1330;
LastSwiftUpdateCheck = 1640;
LastUpgradeCheck = 1610;
TargetAttributes = {
B94D0ABB27F5060C00753EEA = {
Expand All @@ -264,6 +311,10 @@
B9EABE2027FB82B200E055FD = {
CreatedOnToolsVersion = 13.3;
};
EA2B4E7A2ED64431003F9A40 = {
CreatedOnToolsVersion = 16.4;
TestTargetID = B9A598B927E3D169003BCFD0;
};
};
};
buildConfigurationList = B9A598B527E3D169003BCFD0 /* Build configuration list for PBXProject "StorageExample" */;
Expand All @@ -285,6 +336,7 @@
B9A598B927E3D169003BCFD0 /* StorageExample */,
B94D0ABB27F5060C00753EEA /* StorageExample (macOS) */,
B9EABE2027FB82B200E055FD /* StorageExample (tvOS) */,
EA2B4E7A2ED64431003F9A40 /* StorageExample (iOS) UITests */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -320,6 +372,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
EA2B4E792ED64431003F9A40 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -356,8 +415,23 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
EA2B4E772ED64431003F9A40 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
EA2B4E822ED64431003F9A40 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = B9A598B927E3D169003BCFD0 /* StorageExample */;
targetProxy = EA2B4E812ED64431003F9A40 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
B94D0AC827F5060D00753EEA /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down Expand Up @@ -652,6 +726,57 @@
};
name = Release;
};
EA2B4E832ED64431003F9A40 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.5;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 15.5;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.firebase.StorageExample--iOS--UITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,7";
TEST_TARGET_NAME = StorageExample;
XROS_DEPLOYMENT_TARGET = 2.5;
};
name = Debug;
};
EA2B4E842ED64431003F9A40 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.5;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 15.5;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.firebase.StorageExample--iOS--UITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,7";
TEST_TARGET_NAME = StorageExample;
XROS_DEPLOYMENT_TARGET = 2.5;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand Down Expand Up @@ -691,6 +816,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
EA2B4E852ED64431003F9A40 /* Build configuration list for PBXNativeTarget "StorageExample (iOS) UITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
EA2B4E832ED64431003F9A40 /* Debug */,
EA2B4E842ED64431003F9A40 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
Expand Down
Loading