Skip to content

Commit

Permalink
Cleaned up FZAccordionTableViewTests project. Fixed UI test target fa…
Browse files Browse the repository at this point in the history
…iling even though it has 0 tests.
  • Loading branch information
kgaidis committed Mar 4, 2018
1 parent 158a07b commit 199f89f
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 63 deletions.
6 changes: 4 additions & 2 deletions Tests/FZAccordionTableViewTests.xcodeproj/project.pbxproj
Expand Up @@ -23,6 +23,7 @@
01D1F35E1B24D9B2007B97BD /* FZAccordionTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 01D1F35D1B24D9B2007B97BD /* FZAccordionTableView.m */; };
01D1F3661B24DD61007B97BD /* AccordionHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 01D1F3651B24DD61007B97BD /* AccordionHeaderView.m */; };
01D1F3681B24DD86007B97BD /* AccordionHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 01D1F3671B24DD86007B97BD /* AccordionHeaderView.xib */; };
01EAD966204C85E500B5F188 /* FZAccordionTableViewUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0156F1431CCD219800E0530C /* FZAccordionTableViewUITests.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -320,6 +321,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
01EAD966204C85E500B5F188 /* FZAccordionTableViewUITests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -419,7 +421,7 @@
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = FZAccordionTableViewUnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
PRODUCT_BUNDLE_IDENTIFIER = com.kg.FZAccordionTableViewUnitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FZAccordionTableViewTests.app/FZAccordionTableViewTests";
Expand All @@ -433,7 +435,7 @@
CLANG_ANALYZER_NONNULL = YES;
INFOPLIST_FILE = FZAccordionTableViewUnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
PRODUCT_BUNDLE_IDENTIFIER = com.kg.FZAccordionTableViewUnitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FZAccordionTableViewTests.app/FZAccordionTableViewTests";
Expand Down
Expand Up @@ -20,48 +20,15 @@
ReferencedContainer = "container:FZAccordionTableViewTests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "01D1F34A1B24D94A007B97BD"
BuildableName = "FZAccordionTableViewExampleTests.xctest"
BlueprintName = "FZAccordionTableViewExampleTests"
ReferencedContainer = "container:FZAccordionTableViewTests.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "01D1F34A1B24D94A007B97BD"
BuildableName = "FZAccordionTableViewExampleTests.xctest"
BlueprintName = "FZAccordionTableViewExampleTests"
ReferencedContainer = "container:FZAccordionTableViewTests.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "014477181CCB0BB1009F301D"
BuildableName = "FZAccordionTableViewExampleUITests.xctest"
BlueprintName = "FZAccordionTableViewExampleUITests"
ReferencedContainer = "container:FZAccordionTableViewTests.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
Expand Down Expand Up @@ -99,6 +66,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0156F1401CCD219800E0530C"
BuildableName = "FZAccordionTableViewUITests.xctest"
BlueprintName = "FZAccordionTableViewUITests"
ReferencedContainer = "container:FZAccordionTableViewTests.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0156F1541CCD2BA400E0530C"
BuildableName = "FZAccordionTableViewUnitTests.xctest"
BlueprintName = "FZAccordionTableViewUnitTests"
ReferencedContainer = "container:FZAccordionTableViewTests.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
54 changes: 27 additions & 27 deletions Tests/FZAccordionTableViewUITests/FZAccordionTableViewUITests.m
Expand Up @@ -17,32 +17,32 @@ @implementation FZAccordionTableViewUITests

#pragma mark - Helpers -

- (MainViewController *)mainViewController {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
MainViewController *mainViewController = (MainViewController *)[storyboard instantiateInitialViewController];
[[UIApplication sharedApplication] keyWindow].rootViewController = mainViewController;
[mainViewController view];

if (![mainViewController isKindOfClass:[MainViewController class]]) {
XCTAssert(NO, @"The view controller to test on is not correctly extracted. Aborting all tests.");
abort();
}
return mainViewController;
}

- (FZAccordionTableView *)tableView {
FZAccordionTableView *tableView = [self mainViewController].tableView;
XCTAssertNotNil(tableView);
return tableView;
}
//- (MainViewController *)mainViewController {
//
// UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
//
// MainViewController *mainViewController = (MainViewController *)[storyboard instantiateInitialViewController];
//
//
// [[UIApplication sharedApplication] keyWindow].rootViewController = mainViewController;
//
// [mainViewController view];
//
//
//
// if (![mainViewController isKindOfClass:[MainViewController class]]) {
// XCTAssert(NO, @"The view controller to test on is not correctly extracted. Aborting all tests.");
// abort();
// }
//
// return mainViewController;
//}
//
//- (FZAccordionTableView *)tableView {
// FZAccordionTableView *tableView = [self mainViewController].tableView;
// XCTAssertNotNil(tableView);
// return tableView;
//}

#pragma mark - Setup -

Expand All @@ -54,7 +54,7 @@ - (void)setUp {
// In UI tests it is usually best to stop immediately when a failure occurs.
self.continueAfterFailure = NO;
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
// [[[XCUIApplication alloc] init] launch];
[[[XCUIApplication alloc] init] launch];

// 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.
}
Expand Down

0 comments on commit 199f89f

Please sign in to comment.