Skip to content

Commit

Permalink
Revert "Remove UI Test Target"
Browse files Browse the repository at this point in the history
This reverts commit 024c567.
  • Loading branch information
josetorronteras committed May 28, 2024
1 parent b7e0406 commit b72463d
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 0 deletions.
127 changes: 127 additions & 0 deletions CryptoWidgetKitApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
4D72664E2C049D810035E348 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4D72664D2C049D810035E348 /* Assets.xcassets */; };
4D7266512C049D810035E348 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4D7266502C049D810035E348 /* Preview Assets.xcassets */; };
4D72665B2C049D820035E348 /* CryptoWidgetKitAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D72665A2C049D820035E348 /* CryptoWidgetKitAppTests.swift */; };
4D7266652C049D820035E348 /* CryptoWidgetKitAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D7266642C049D820035E348 /* CryptoWidgetKitAppUITests.swift */; };
4D7266672C049D820035E348 /* CryptoWidgetKitAppUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D7266662C049D820035E348 /* CryptoWidgetKitAppUITestsLaunchTests.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -22,6 +24,13 @@
remoteGlobalIDString = 4D7266452C049D800035E348;
remoteInfo = CryptoWidgetKitApp;
};
4D7266612C049D820035E348 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 4D72663E2C049D800035E348 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 4D7266452C049D800035E348;
remoteInfo = CryptoWidgetKitApp;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
Expand All @@ -32,6 +41,9 @@
4D7266502C049D810035E348 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
4D7266562C049D820035E348 /* CryptoWidgetKitAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CryptoWidgetKitAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4D72665A2C049D820035E348 /* CryptoWidgetKitAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CryptoWidgetKitAppTests.swift; sourceTree = "<group>"; };
4D7266602C049D820035E348 /* CryptoWidgetKitAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CryptoWidgetKitAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4D7266642C049D820035E348 /* CryptoWidgetKitAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CryptoWidgetKitAppUITests.swift; sourceTree = "<group>"; };
4D7266662C049D820035E348 /* CryptoWidgetKitAppUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CryptoWidgetKitAppUITestsLaunchTests.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -49,6 +61,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
4D72665D2C049D820035E348 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
Expand All @@ -57,6 +76,7 @@
children = (
4D7266482C049D800035E348 /* CryptoWidgetKitApp */,
4D7266592C049D820035E348 /* CryptoWidgetKitAppTests */,
4D7266632C049D820035E348 /* CryptoWidgetKitAppUITests */,
4D7266472C049D800035E348 /* Products */,
);
sourceTree = "<group>";
Expand All @@ -66,6 +86,7 @@
children = (
4D7266462C049D800035E348 /* CryptoWidgetKitApp.app */,
4D7266562C049D820035E348 /* CryptoWidgetKitAppTests.xctest */,
4D7266602C049D820035E348 /* CryptoWidgetKitAppUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -97,6 +118,15 @@
path = CryptoWidgetKitAppTests;
sourceTree = "<group>";
};
4D7266632C049D820035E348 /* CryptoWidgetKitAppUITests */ = {
isa = PBXGroup;
children = (
4D7266642C049D820035E348 /* CryptoWidgetKitAppUITests.swift */,
4D7266662C049D820035E348 /* CryptoWidgetKitAppUITestsLaunchTests.swift */,
);
path = CryptoWidgetKitAppUITests;
sourceTree = "<group>";
};
4D7266732C049D930035E348 /* Resources */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -143,6 +173,24 @@
productReference = 4D7266562C049D820035E348 /* CryptoWidgetKitAppTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
4D72665F2C049D820035E348 /* CryptoWidgetKitAppUITests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4D7266702C049D820035E348 /* Build configuration list for PBXNativeTarget "CryptoWidgetKitAppUITests" */;
buildPhases = (
4D72665C2C049D820035E348 /* Sources */,
4D72665D2C049D820035E348 /* Frameworks */,
4D72665E2C049D820035E348 /* Resources */,
);
buildRules = (
);
dependencies = (
4D7266622C049D820035E348 /* PBXTargetDependency */,
);
name = CryptoWidgetKitAppUITests;
productName = CryptoWidgetKitAppUITests;
productReference = 4D7266602C049D820035E348 /* CryptoWidgetKitAppUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
Expand All @@ -160,6 +208,10 @@
CreatedOnToolsVersion = 15.4;
TestTargetID = 4D7266452C049D800035E348;
};
4D72665F2C049D820035E348 = {
CreatedOnToolsVersion = 15.4;
TestTargetID = 4D7266452C049D800035E348;
};
};
};
buildConfigurationList = 4D7266412C049D800035E348 /* Build configuration list for PBXProject "CryptoWidgetKitApp" */;
Expand All @@ -177,6 +229,7 @@
targets = (
4D7266452C049D800035E348 /* CryptoWidgetKitApp */,
4D7266552C049D820035E348 /* CryptoWidgetKitAppTests */,
4D72665F2C049D820035E348 /* CryptoWidgetKitAppUITests */,
);
};
/* End PBXProject section */
Expand All @@ -198,6 +251,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
4D72665E2C049D820035E348 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand All @@ -218,6 +278,15 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
4D72665C2C049D820035E348 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4D7266672C049D820035E348 /* CryptoWidgetKitAppUITestsLaunchTests.swift in Sources */,
4D7266652C049D820035E348 /* CryptoWidgetKitAppUITests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
Expand All @@ -226,6 +295,11 @@
target = 4D7266452C049D800035E348 /* CryptoWidgetKitApp */;
targetProxy = 4D7266572C049D820035E348 /* PBXContainerItemProxy */;
};
4D7266622C049D820035E348 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4D7266452C049D800035E348 /* CryptoWidgetKitApp */;
targetProxy = 4D7266612C049D820035E348 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
Expand Down Expand Up @@ -462,6 +536,50 @@
};
name = Release;
};
4D7266712C049D820035E348 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = josetorronteras.CryptoWidgetKitAppUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = CryptoWidgetKitApp;
};
name = Debug;
};
4D7266722C049D820035E348 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = josetorronteras.CryptoWidgetKitAppUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = CryptoWidgetKitApp;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand Down Expand Up @@ -492,6 +610,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4D7266702C049D820035E348 /* Build configuration list for PBXNativeTarget "CryptoWidgetKitAppUITests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4D7266712C049D820035E348 /* Debug */,
4D7266722C049D820035E348 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 4D72663E2C049D800035E348 /* Project object */;
Expand Down
41 changes: 41 additions & 0 deletions CryptoWidgetKitAppUITests/CryptoWidgetKitAppUITests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// CryptoWidgetKitAppUITests.swift
// CryptoWidgetKitAppUITests
//
// Created by Jose Jesus Torronteras Hernandez on 27/1/24.
//

import XCTest

final class CryptoWidgetKitAppUITests: 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.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

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.
}

func testLaunchPerformance() throws {
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// CryptoWidgetKitAppUITestsLaunchTests.swift
// CryptoWidgetKitAppUITests
//
// Created by Jose Jesus Torronteras Hernandez on 27/1/24.
//

import XCTest

final class CryptoWidgetKitAppUITestsLaunchTests: XCTestCase {

override class var runsForEachTargetApplicationUIConfiguration: Bool {
true
}

override func setUpWithError() throws {
continueAfterFailure = false
}

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

let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = "Launch Screen"
attachment.lifetime = .keepAlways
add(attachment)
}
}

0 comments on commit b72463d

Please sign in to comment.