From 4562e531a8827ade067409b4ca1fcb209f45fafe Mon Sep 17 00:00:00 2001 From: Giovanni Lodi Date: Thu, 23 Apr 2015 20:01:51 +1000 Subject: [PATCH 1/7] Add KIF Swift target We've decided to use another target so that we can compare the two (Objective-C and Swift) options. --- Bench.xcodeproj/project.pbxproj | 130 ++++++++++++++++++ .../xcshareddata/xcschemes/Bench.xcscheme | 24 ++++ .../xcschemes/BenchAcceptanceTests.xcscheme | 33 +++-- BenchKIFSwift/BenchKIFSwift.swift | 36 +++++ BenchKIFSwift/Info.plist | 24 ++++ 5 files changed, 238 insertions(+), 9 deletions(-) create mode 100644 BenchKIFSwift/BenchKIFSwift.swift create mode 100644 BenchKIFSwift/Info.plist diff --git a/Bench.xcodeproj/project.pbxproj b/Bench.xcodeproj/project.pbxproj index 1de9763..dcf0ba4 100644 --- a/Bench.xcodeproj/project.pbxproj +++ b/Bench.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 2047D35340F95E491DCCC757 /* libPods-BenchTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C995115E505E9BD825293991 /* libPods-BenchTests.a */; }; + 3F822F631AE8FA870001ACFA /* BenchKIFSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */; }; 3FB292931ADFD1BC003B2728 /* MainScreenSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FB292921ADFD1BC003B2728 /* MainScreenSpec.m */; }; 3FB6F09D1ADB189800F38D63 /* ElementFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FB6F09C1ADB189800F38D63 /* ElementFormatter.m */; }; 3FB6F09F1ADB190100F38D63 /* ElementFormatterSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FB6F09E1ADB190100F38D63 /* ElementFormatterSpec.m */; }; @@ -24,6 +25,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 3F822F641AE8FA870001ACFA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6EADCD8E1AC48CD800E041E4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6EADCD951AC48CD800E041E4; + remoteInfo = Bench; + }; 6EADCDAC1AC48CD800E041E4 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 6EADCD8E1AC48CD800E041E4 /* Project object */; @@ -44,6 +52,9 @@ 0128A771684DCAD503661806 /* Pods-BenchTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BenchTests/Pods-BenchTests.debug.xcconfig"; sourceTree = ""; }; 2EC573117DC09CE6F71418FD /* Pods-BenchTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-BenchTests/Pods-BenchTests.release.xcconfig"; sourceTree = ""; }; 37E869D18D5E2EC428EB4DBE /* Pods-BenchKIF.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchKIF.release.xcconfig"; path = "Pods/Target Support Files/Pods-BenchKIF/Pods-BenchKIF.release.xcconfig"; sourceTree = ""; }; + 3F822F5E1AE8FA870001ACFA /* BenchKIFSwift.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BenchKIFSwift.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F822F611AE8FA870001ACFA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BenchKIFSwift.swift; sourceTree = ""; }; 3FB292921ADFD1BC003B2728 /* MainScreenSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainScreenSpec.m; sourceTree = ""; }; 3FB6F0971ADB186000F38D63 /* Bench-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bench-Bridging-Header.h"; sourceTree = ""; }; 3FB6F09B1ADB189800F38D63 /* ElementFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementFormatter.h; sourceTree = ""; }; @@ -70,6 +81,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 3F822F5B1AE8FA870001ACFA /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6EADCD931AC48CD800E041E4 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -96,12 +114,30 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 3F822F5F1AE8FA870001ACFA /* BenchKIFSwift */ = { + isa = PBXGroup; + children = ( + 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */, + 3F822F601AE8FA870001ACFA /* Supporting Files */, + ); + path = BenchKIFSwift; + sourceTree = ""; + }; + 3F822F601AE8FA870001ACFA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 3F822F611AE8FA870001ACFA /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; 6EADCD8D1AC48CD800E041E4 = { isa = PBXGroup; children = ( 6EADCD981AC48CD800E041E4 /* Bench */, 6EADCDAE1AC48CD800E041E4 /* BenchTests */, 6EADCE121AC5425700E041E4 /* BenchKIF */, + 3F822F5F1AE8FA870001ACFA /* BenchKIFSwift */, 6EADCD971AC48CD800E041E4 /* Products */, F98BC27EA39ABD73DD46B35F /* Pods */, CAB4C1CDD261C60A9BA11433 /* Frameworks */, @@ -117,6 +153,7 @@ 6EADCD961AC48CD800E041E4 /* Bench.app */, 6EADCDAB1AC48CD800E041E4 /* BenchTests.xctest */, 6EADCE111AC5425700E041E4 /* BenchKIF.xctest */, + 3F822F5E1AE8FA870001ACFA /* BenchKIFSwift.xctest */, ); name = Products; sourceTree = ""; @@ -206,6 +243,24 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 3F822F5D1AE8FA870001ACFA /* BenchKIFSwift */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F822F681AE8FA870001ACFA /* Build configuration list for PBXNativeTarget "BenchKIFSwift" */; + buildPhases = ( + 3F822F5A1AE8FA870001ACFA /* Sources */, + 3F822F5B1AE8FA870001ACFA /* Frameworks */, + 3F822F5C1AE8FA870001ACFA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 3F822F651AE8FA870001ACFA /* PBXTargetDependency */, + ); + name = BenchKIFSwift; + productName = BenchKIFSwift; + productReference = 3F822F5E1AE8FA870001ACFA /* BenchKIFSwift.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 6EADCD951AC48CD800E041E4 /* Bench */ = { isa = PBXNativeTarget; buildConfigurationList = 6EADCDB51AC48CD800E041E4 /* Build configuration list for PBXNativeTarget "Bench" */; @@ -274,6 +329,10 @@ LastUpgradeCheck = 0620; ORGANIZATIONNAME = mokacoding; TargetAttributes = { + 3F822F5D1AE8FA870001ACFA = { + CreatedOnToolsVersion = 6.3.1; + TestTargetID = 6EADCD951AC48CD800E041E4; + }; 6EADCD951AC48CD800E041E4 = { CreatedOnToolsVersion = 6.2; }; @@ -303,11 +362,19 @@ 6EADCD951AC48CD800E041E4 /* Bench */, 6EADCDAA1AC48CD800E041E4 /* BenchTests */, 6EADCE101AC5425700E041E4 /* BenchKIF */, + 3F822F5D1AE8FA870001ACFA /* BenchKIFSwift */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 3F822F5C1AE8FA870001ACFA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6EADCD941AC48CD800E041E4 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -427,6 +494,14 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 3F822F5A1AE8FA870001ACFA /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F822F631AE8FA870001ACFA /* BenchKIFSwift.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6EADCD921AC48CD800E041E4 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -459,6 +534,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 3F822F651AE8FA870001ACFA /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6EADCD951AC48CD800E041E4 /* Bench */; + targetProxy = 3F822F641AE8FA870001ACFA /* PBXContainerItemProxy */; + }; 6EADCDAD1AC48CD800E041E4 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 6EADCD951AC48CD800E041E4 /* Bench */; @@ -491,6 +571,48 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 3F822F661AE8FA870001ACFA /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + INFOPLIST_FILE = BenchKIFSwift/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Bench.app/Bench"; + }; + name = Debug; + }; + 3F822F671AE8FA870001ACFA /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + INFOPLIST_FILE = BenchKIFSwift/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Bench.app/Bench"; + }; + name = Release; + }; 6EADCDB31AC48CD800E041E4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -705,6 +827,14 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 3F822F681AE8FA870001ACFA /* Build configuration list for PBXNativeTarget "BenchKIFSwift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F822F661AE8FA870001ACFA /* Debug */, + 3F822F671AE8FA870001ACFA /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 6EADCD911AC48CD800E041E4 /* Build configuration list for PBXProject "Bench" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Bench.xcodeproj/xcshareddata/xcschemes/Bench.xcscheme b/Bench.xcodeproj/xcshareddata/xcschemes/Bench.xcscheme index c654f35..0330eda 100644 --- a/Bench.xcodeproj/xcshareddata/xcschemes/Bench.xcscheme +++ b/Bench.xcodeproj/xcshareddata/xcschemes/Bench.xcscheme @@ -48,6 +48,20 @@ ReferencedContainer = "container:Bench.xcodeproj"> + + + + + + + + + + + + + + + + - - - - diff --git a/BenchKIFSwift/BenchKIFSwift.swift b/BenchKIFSwift/BenchKIFSwift.swift new file mode 100644 index 0000000..9da11b1 --- /dev/null +++ b/BenchKIFSwift/BenchKIFSwift.swift @@ -0,0 +1,36 @@ +// +// BenchKIFSwift.swift +// BenchKIFSwift +// +// Created by Giovanni on 23/04/2015. +// Copyright (c) 2015 mokacoding. All rights reserved. +// + +import UIKit +import XCTest + +class BenchKIFSwift: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + XCTAssert(true, "Pass") + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock() { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/BenchKIFSwift/Info.plist b/BenchKIFSwift/Info.plist new file mode 100644 index 0000000..dc2f706 --- /dev/null +++ b/BenchKIFSwift/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + mokacoding.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + From ff1bba4dc16789981ea33fdad1d68ec7802cd796 Mon Sep 17 00:00:00 2001 From: Giovanni Lodi Date: Sat, 25 Apr 2015 10:09:59 +1000 Subject: [PATCH 2/7] Add Quick via CocoaPods. Note the "use_frameworks!" --- Bench.xcodeproj/project.pbxproj | 59 +++++++++++++++++++++++++++++++++ Podfile | 6 ++++ Podfile.lock | 3 ++ 3 files changed, 68 insertions(+) diff --git a/Bench.xcodeproj/project.pbxproj b/Bench.xcodeproj/project.pbxproj index dcf0ba4..06d1433 100644 --- a/Bench.xcodeproj/project.pbxproj +++ b/Bench.xcodeproj/project.pbxproj @@ -21,6 +21,7 @@ 6EADCDBC1AC4972C00E041E4 /* ElementsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EADCDBB1AC4972C00E041E4 /* ElementsViewController.swift */; }; 6EADCDC01AC4A32300E041E4 /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EADCDBF1AC4A32300E041E4 /* Colors.swift */; }; 6EADCE161AC5425700E041E4 /* MainScreenTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EADCE151AC5425700E041E4 /* MainScreenTest.m */; }; + 8E66A69D94FFBEE0B9669E39 /* Pods_BenchKIFSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6558B6818A4E2EC173A7A0B4 /* Pods_BenchKIFSwift.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; A13AA54E4731746C50A1BAF2 /* libPods-BenchKIF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8111BF74C4BB1028E6FB5F9 /* libPods-BenchKIF.a */; }; /* End PBXBuildFile section */ @@ -50,6 +51,7 @@ /* Begin PBXFileReference section */ 0128A771684DCAD503661806 /* Pods-BenchTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BenchTests/Pods-BenchTests.debug.xcconfig"; sourceTree = ""; }; + 0D2BCDB1D83264EBE451B649 /* Pods-BenchKIFSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchKIFSwift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BenchKIFSwift/Pods-BenchKIFSwift.debug.xcconfig"; sourceTree = ""; }; 2EC573117DC09CE6F71418FD /* Pods-BenchTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-BenchTests/Pods-BenchTests.release.xcconfig"; sourceTree = ""; }; 37E869D18D5E2EC428EB4DBE /* Pods-BenchKIF.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchKIF.release.xcconfig"; path = "Pods/Target Support Files/Pods-BenchKIF/Pods-BenchKIF.release.xcconfig"; sourceTree = ""; }; 3F822F5E1AE8FA870001ACFA /* BenchKIFSwift.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BenchKIFSwift.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -61,6 +63,7 @@ 3FB6F09C1ADB189800F38D63 /* ElementFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ElementFormatter.m; sourceTree = ""; }; 3FB6F09E1ADB190100F38D63 /* ElementFormatterSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ElementFormatterSpec.m; sourceTree = ""; }; 3FB6F0A01ADB268F00F38D63 /* periodic_table.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = periodic_table.json; sourceTree = ""; }; + 6558B6818A4E2EC173A7A0B4 /* Pods_BenchKIFSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_BenchKIFSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6EADCD961AC48CD800E041E4 /* Bench.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Bench.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6EADCD9A1AC48CD800E041E4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6EADCD9B1AC48CD800E041E4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -76,6 +79,7 @@ 6EADCE141AC5425700E041E4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6EADCE151AC5425700E041E4 /* MainScreenTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainScreenTest.m; sourceTree = ""; }; C995115E505E9BD825293991 /* libPods-BenchTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BenchTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + D4C798EB6D541B0F37025878 /* Pods-BenchKIFSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchKIFSwift.release.xcconfig"; path = "Pods/Target Support Files/Pods-BenchKIFSwift/Pods-BenchKIFSwift.release.xcconfig"; sourceTree = ""; }; F8111BF74C4BB1028E6FB5F9 /* libPods-BenchKIF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BenchKIF.a"; sourceTree = BUILT_PRODUCTS_DIR; }; FC5D2DE4225C2A9F2F33C01D /* Pods-BenchKIF.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchKIF.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BenchKIF/Pods-BenchKIF.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -85,6 +89,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 8E66A69D94FFBEE0B9669E39 /* Pods_BenchKIFSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -225,6 +230,7 @@ children = ( F8111BF74C4BB1028E6FB5F9 /* libPods-BenchKIF.a */, C995115E505E9BD825293991 /* libPods-BenchTests.a */, + 6558B6818A4E2EC173A7A0B4 /* Pods_BenchKIFSwift.framework */, ); name = Frameworks; sourceTree = ""; @@ -236,6 +242,8 @@ 37E869D18D5E2EC428EB4DBE /* Pods-BenchKIF.release.xcconfig */, 0128A771684DCAD503661806 /* Pods-BenchTests.debug.xcconfig */, 2EC573117DC09CE6F71418FD /* Pods-BenchTests.release.xcconfig */, + 0D2BCDB1D83264EBE451B649 /* Pods-BenchKIFSwift.debug.xcconfig */, + D4C798EB6D541B0F37025878 /* Pods-BenchKIFSwift.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -247,9 +255,12 @@ isa = PBXNativeTarget; buildConfigurationList = 3F822F681AE8FA870001ACFA /* Build configuration list for PBXNativeTarget "BenchKIFSwift" */; buildPhases = ( + 4FE73AFBCF52F86EF062EE7F /* Check Pods Manifest.lock */, 3F822F5A1AE8FA870001ACFA /* Sources */, 3F822F5B1AE8FA870001ACFA /* Frameworks */, 3F822F5C1AE8FA870001ACFA /* Resources */, + D592355051D5E28553CF31B2 /* Embed Pods Frameworks */, + 0CE5DA2D783E21DD31E32481 /* Copy Pods Resources */, ); buildRules = ( ); @@ -418,6 +429,21 @@ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; + 0CE5DA2D783E21DD31E32481 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-BenchKIFSwift/Pods-BenchKIFSwift-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 2064882AA417CAD19EE2767C /* Set version number */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -432,6 +458,21 @@ shellPath = /bin/sh; shellScript = "git=$(sh /etc/profile; which git)\ngit_release_version=$(\"$git\" describe --tags --always --abbrev=0)\nnumber_of_commits=$(\"$git\" rev-list master | wc -l | tr -d ' ')\ntarget_plist=\"$TARGET_BUILD_DIR/$INFOPLIST_PATH\"\ndsym_plist=\"$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist\"\n\nfor plist in \"$target_plist\" \"$dsym_plist\"; do\n if [ -f \"$plist\" ]; then\n /usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $number_of_commits\" \"$plist\"\n /usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString ${git_release_version#*v}\" \"$plist\"\n fi\ndone\n"; }; + 4FE73AFBCF52F86EF062EE7F /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; 73F4CEA4725993995521B08F /* Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -462,6 +503,21 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-BenchKIF/Pods-BenchKIF-resources.sh\"\n"; showEnvVarsInLog = 0; }; + D592355051D5E28553CF31B2 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-BenchKIFSwift/Pods-BenchKIFSwift-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; F1E3D61394BC9E1237496DEC /* Warn for TODO and FIXME comments */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -573,6 +629,7 @@ /* Begin XCBuildConfiguration section */ 3F822F661AE8FA870001ACFA /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0D2BCDB1D83264EBE451B649 /* Pods-BenchKIFSwift.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -596,6 +653,7 @@ }; 3F822F671AE8FA870001ACFA /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = D4C798EB6D541B0F37025878 /* Pods-BenchKIFSwift.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -834,6 +892,7 @@ 3F822F671AE8FA870001ACFA /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 6EADCD911AC48CD800E041E4 /* Build configuration list for PBXProject "Bench" */ = { isa = XCConfigurationList; diff --git a/Podfile b/Podfile index 3344ddd..5d1dfec 100644 --- a/Podfile +++ b/Podfile @@ -12,3 +12,9 @@ target 'BenchKIF', exclusive: true do pod 'KIF', '~> 3.2.0' pod 'Specta', '~> 0.5.0' end + +target 'BenchKIFSwift', exclusive: true do + use_frameworks! + pod 'KIF', '~> 3.2.0' + pod 'Quick', '~> 0.3.1' +end diff --git a/Podfile.lock b/Podfile.lock index a53d3d7..b34cc11 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -3,16 +3,19 @@ PODS: - KIF (3.2.0): - KIF/XCTest (= 3.2.0) - KIF/XCTest (3.2.0) + - Quick (0.3.1) - Specta (0.5.0) DEPENDENCIES: - Expecta (~> 0.4.0) - KIF (~> 3.2.0) + - Quick (~> 0.3.1) - Specta (~> 0.5.0) SPEC CHECKSUMS: Expecta: 392a6b5bfb9f4097e47dd8064d9b732079490332 KIF: 958b7b47bf36c72711cb5c9260542a522a5892b1 + Quick: 824572d3d198d51e52cf4aa722cebf7e59952a35 Specta: eb90708ed77569bbda089f8ead10bb99b8e9489e COCOAPODS: 0.36.3 From ee9e4803f5167478dc0f5abfc6709efccb20f91f Mon Sep 17 00:00:00 2001 From: Giovanni Lodi Date: Sat, 25 Apr 2015 10:19:58 +1000 Subject: [PATCH 3/7] Add bridging header improting Swift _The way I did it was by adding an Objective-C class to the target so Xcode asked to add the header and did all the configurations automatically. Then I removed the class._ --- Bench.xcodeproj/project.pbxproj | 7 +++++++ BenchKIFSwift/BenchKIFSwift-Bridging-Header.h | 1 + 2 files changed, 8 insertions(+) create mode 100644 BenchKIFSwift/BenchKIFSwift-Bridging-Header.h diff --git a/Bench.xcodeproj/project.pbxproj b/Bench.xcodeproj/project.pbxproj index 06d1433..3b73b25 100644 --- a/Bench.xcodeproj/project.pbxproj +++ b/Bench.xcodeproj/project.pbxproj @@ -54,6 +54,7 @@ 0D2BCDB1D83264EBE451B649 /* Pods-BenchKIFSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchKIFSwift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BenchKIFSwift/Pods-BenchKIFSwift.debug.xcconfig"; sourceTree = ""; }; 2EC573117DC09CE6F71418FD /* Pods-BenchTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-BenchTests/Pods-BenchTests.release.xcconfig"; sourceTree = ""; }; 37E869D18D5E2EC428EB4DBE /* Pods-BenchKIF.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchKIF.release.xcconfig"; path = "Pods/Target Support Files/Pods-BenchKIF/Pods-BenchKIF.release.xcconfig"; sourceTree = ""; }; + 3F22B2C71AEB148700FB68F6 /* BenchKIFSwift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BenchKIFSwift-Bridging-Header.h"; sourceTree = ""; }; 3F822F5E1AE8FA870001ACFA /* BenchKIFSwift.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BenchKIFSwift.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3F822F611AE8FA870001ACFA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BenchKIFSwift.swift; sourceTree = ""; }; @@ -124,6 +125,7 @@ children = ( 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */, 3F822F601AE8FA870001ACFA /* Supporting Files */, + 3F22B2C71AEB148700FB68F6 /* BenchKIFSwift-Bridging-Header.h */, ); path = BenchKIFSwift; sourceTree = ""; @@ -632,6 +634,7 @@ baseConfigurationReference = 0D2BCDB1D83264EBE451B649 /* Pods-BenchKIFSwift.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", @@ -647,6 +650,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "BenchKIFSwift/BenchKIFSwift-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Bench.app/Bench"; }; name = Debug; @@ -656,6 +661,7 @@ baseConfigurationReference = D4C798EB6D541B0F37025878 /* Pods-BenchKIFSwift.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", @@ -667,6 +673,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "BenchKIFSwift/BenchKIFSwift-Bridging-Header.h"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Bench.app/Bench"; }; name = Release; diff --git a/BenchKIFSwift/BenchKIFSwift-Bridging-Header.h b/BenchKIFSwift/BenchKIFSwift-Bridging-Header.h new file mode 100644 index 0000000..32fa656 --- /dev/null +++ b/BenchKIFSwift/BenchKIFSwift-Bridging-Header.h @@ -0,0 +1 @@ +#import \ No newline at end of file From e734a4c59ddbdc50f4937ec62b9e0ffe3b7ead43 Mon Sep 17 00:00:00 2001 From: Giovanni Lodi Date: Sat, 25 Apr 2015 10:21:37 +1000 Subject: [PATCH 4/7] Add QuickSpec extenstion to enable the KIF tester See https://github.com/kif-framework/KIF#use-with-swift --- Bench.xcodeproj/project.pbxproj | 4 ++++ BenchKIFSwift/KIF+SwiftExtension.swift | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 BenchKIFSwift/KIF+SwiftExtension.swift diff --git a/Bench.xcodeproj/project.pbxproj b/Bench.xcodeproj/project.pbxproj index 3b73b25..2504d11 100644 --- a/Bench.xcodeproj/project.pbxproj +++ b/Bench.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 2047D35340F95E491DCCC757 /* libPods-BenchTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C995115E505E9BD825293991 /* libPods-BenchTests.a */; }; + 3F22B2CC1AEB14DC00FB68F6 /* KIF+SwiftExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F22B2CB1AEB14DC00FB68F6 /* KIF+SwiftExtension.swift */; }; 3F822F631AE8FA870001ACFA /* BenchKIFSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */; }; 3FB292931ADFD1BC003B2728 /* MainScreenSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FB292921ADFD1BC003B2728 /* MainScreenSpec.m */; }; 3FB6F09D1ADB189800F38D63 /* ElementFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FB6F09C1ADB189800F38D63 /* ElementFormatter.m */; }; @@ -55,6 +56,7 @@ 2EC573117DC09CE6F71418FD /* Pods-BenchTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-BenchTests/Pods-BenchTests.release.xcconfig"; sourceTree = ""; }; 37E869D18D5E2EC428EB4DBE /* Pods-BenchKIF.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BenchKIF.release.xcconfig"; path = "Pods/Target Support Files/Pods-BenchKIF/Pods-BenchKIF.release.xcconfig"; sourceTree = ""; }; 3F22B2C71AEB148700FB68F6 /* BenchKIFSwift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BenchKIFSwift-Bridging-Header.h"; sourceTree = ""; }; + 3F22B2CB1AEB14DC00FB68F6 /* KIF+SwiftExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "KIF+SwiftExtension.swift"; sourceTree = ""; }; 3F822F5E1AE8FA870001ACFA /* BenchKIFSwift.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BenchKIFSwift.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3F822F611AE8FA870001ACFA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BenchKIFSwift.swift; sourceTree = ""; }; @@ -126,6 +128,7 @@ 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */, 3F822F601AE8FA870001ACFA /* Supporting Files */, 3F22B2C71AEB148700FB68F6 /* BenchKIFSwift-Bridging-Header.h */, + 3F22B2CB1AEB14DC00FB68F6 /* KIF+SwiftExtension.swift */, ); path = BenchKIFSwift; sourceTree = ""; @@ -556,6 +559,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3F22B2CC1AEB14DC00FB68F6 /* KIF+SwiftExtension.swift in Sources */, 3F822F631AE8FA870001ACFA /* BenchKIFSwift.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/BenchKIFSwift/KIF+SwiftExtension.swift b/BenchKIFSwift/KIF+SwiftExtension.swift new file mode 100644 index 0000000..5147852 --- /dev/null +++ b/BenchKIFSwift/KIF+SwiftExtension.swift @@ -0,0 +1,23 @@ +import Quick + +extension QuickSpec { + + func tester(_ file : String = __FILE__, _ line : Int = __LINE__) -> KIFUITestActor { + return KIFUITestActor(inFile: file, atLine: line, delegate: self) + } + + func system(_ file : String = __FILE__, _ line : Int = __LINE__) -> KIFSystemTestActor { + return KIFSystemTestActor(inFile: file, atLine: line, delegate: self) + } +} + +extension KIFTestActor { + + func tester(_ file : String = __FILE__, _ line : Int = __LINE__) -> KIFUITestActor { + return KIFUITestActor(inFile: file, atLine: line, delegate: self) + } + + func system(_ file : String = __FILE__, _ line : Int = __LINE__) -> KIFSystemTestActor { + return KIFSystemTestActor(inFile: file, atLine: line, delegate: self) + } +} \ No newline at end of file From 9a34e618000a0c7cba21c41ffb069975a226931c Mon Sep 17 00:00:00 2001 From: Giovanni Lodi Date: Sat, 25 Apr 2015 11:03:42 +1000 Subject: [PATCH 5/7] Fix issue with bridging header not importing KIF properly The issue was that KIF was imported as an Objective=C header, but built by cocapods as a framework. Because of this the header couldn't find it. --- BenchKIFSwift/BenchKIFSwift-Bridging-Header.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BenchKIFSwift/BenchKIFSwift-Bridging-Header.h b/BenchKIFSwift/BenchKIFSwift-Bridging-Header.h index 32fa656..a7c77e0 100644 --- a/BenchKIFSwift/BenchKIFSwift-Bridging-Header.h +++ b/BenchKIFSwift/BenchKIFSwift-Bridging-Header.h @@ -1 +1 @@ -#import \ No newline at end of file +@import KIF; \ No newline at end of file From 80b4eefff91e7c0445740d243907cdd05f0a1dc7 Mon Sep 17 00:00:00 2001 From: Giovanni Lodi Date: Sat, 25 Apr 2015 11:49:45 +1000 Subject: [PATCH 6/7] Tweak KIF extension to work with Quick See http://stackoverflow.com/questions/28209769/kif-and-quick-nimble --- BenchKIFSwift/KIF+SwiftExtension.swift | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/BenchKIFSwift/KIF+SwiftExtension.swift b/BenchKIFSwift/KIF+SwiftExtension.swift index 5147852..42d37a4 100644 --- a/BenchKIFSwift/KIF+SwiftExtension.swift +++ b/BenchKIFSwift/KIF+SwiftExtension.swift @@ -1,23 +1,26 @@ import Quick -extension QuickSpec { +extension QuickSpec: KIFTestActorDelegate { func tester(_ file : String = __FILE__, _ line : Int = __LINE__) -> KIFUITestActor { - return KIFUITestActor(inFile: file, atLine: line, delegate: self) + var t = KIFUITestActor(inFile: file, atLine: line, delegate: self) + return t! } func system(_ file : String = __FILE__, _ line : Int = __LINE__) -> KIFSystemTestActor { return KIFSystemTestActor(inFile: file, atLine: line, delegate: self) } -} -extension KIFTestActor { + // MARK: - KIFTestActorDelegate - func tester(_ file : String = __FILE__, _ line : Int = __LINE__) -> KIFUITestActor { - return KIFUITestActor(inFile: file, atLine: line, delegate: self) + override public func failWithException(exception: NSException!, stopTest stop: Bool) { + if let userInfo = exception.userInfo { + XCTFail(exception.description, + file: userInfo["SenTestFilenameKey"] as! String, + line: userInfo["SenTestLineNumberKey"] as! UInt) + } else { + XCTFail(exception.description) + } } - func system(_ file : String = __FILE__, _ line : Int = __LINE__) -> KIFSystemTestActor { - return KIFSystemTestActor(inFile: file, atLine: line, delegate: self) - } } \ No newline at end of file From 89ac170ec963778893670fde2b0af54e9447275d Mon Sep 17 00:00:00 2001 From: Giovanni Lodi Date: Sat, 25 Apr 2015 11:50:40 +1000 Subject: [PATCH 7/7] Add basic main screen spec. There are some issues :disappointed: --- Bench.xcodeproj/project.pbxproj | 8 +++---- BenchKIFSwift/BenchKIFSwift.swift | 36 ------------------------------ BenchKIFSwift/MainScreenSpec.swift | 36 ++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 BenchKIFSwift/BenchKIFSwift.swift create mode 100644 BenchKIFSwift/MainScreenSpec.swift diff --git a/Bench.xcodeproj/project.pbxproj b/Bench.xcodeproj/project.pbxproj index 2504d11..a59f1ba 100644 --- a/Bench.xcodeproj/project.pbxproj +++ b/Bench.xcodeproj/project.pbxproj @@ -9,7 +9,7 @@ /* Begin PBXBuildFile section */ 2047D35340F95E491DCCC757 /* libPods-BenchTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C995115E505E9BD825293991 /* libPods-BenchTests.a */; }; 3F22B2CC1AEB14DC00FB68F6 /* KIF+SwiftExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F22B2CB1AEB14DC00FB68F6 /* KIF+SwiftExtension.swift */; }; - 3F822F631AE8FA870001ACFA /* BenchKIFSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */; }; + 3F822F631AE8FA870001ACFA /* MainScreenSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F822F621AE8FA870001ACFA /* MainScreenSpec.swift */; }; 3FB292931ADFD1BC003B2728 /* MainScreenSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FB292921ADFD1BC003B2728 /* MainScreenSpec.m */; }; 3FB6F09D1ADB189800F38D63 /* ElementFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FB6F09C1ADB189800F38D63 /* ElementFormatter.m */; }; 3FB6F09F1ADB190100F38D63 /* ElementFormatterSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FB6F09E1ADB190100F38D63 /* ElementFormatterSpec.m */; }; @@ -59,7 +59,7 @@ 3F22B2CB1AEB14DC00FB68F6 /* KIF+SwiftExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "KIF+SwiftExtension.swift"; sourceTree = ""; }; 3F822F5E1AE8FA870001ACFA /* BenchKIFSwift.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BenchKIFSwift.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3F822F611AE8FA870001ACFA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BenchKIFSwift.swift; sourceTree = ""; }; + 3F822F621AE8FA870001ACFA /* MainScreenSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainScreenSpec.swift; sourceTree = ""; }; 3FB292921ADFD1BC003B2728 /* MainScreenSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainScreenSpec.m; sourceTree = ""; }; 3FB6F0971ADB186000F38D63 /* Bench-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bench-Bridging-Header.h"; sourceTree = ""; }; 3FB6F09B1ADB189800F38D63 /* ElementFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementFormatter.h; sourceTree = ""; }; @@ -125,7 +125,7 @@ 3F822F5F1AE8FA870001ACFA /* BenchKIFSwift */ = { isa = PBXGroup; children = ( - 3F822F621AE8FA870001ACFA /* BenchKIFSwift.swift */, + 3F822F621AE8FA870001ACFA /* MainScreenSpec.swift */, 3F822F601AE8FA870001ACFA /* Supporting Files */, 3F22B2C71AEB148700FB68F6 /* BenchKIFSwift-Bridging-Header.h */, 3F22B2CB1AEB14DC00FB68F6 /* KIF+SwiftExtension.swift */, @@ -560,7 +560,7 @@ buildActionMask = 2147483647; files = ( 3F22B2CC1AEB14DC00FB68F6 /* KIF+SwiftExtension.swift in Sources */, - 3F822F631AE8FA870001ACFA /* BenchKIFSwift.swift in Sources */, + 3F822F631AE8FA870001ACFA /* MainScreenSpec.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/BenchKIFSwift/BenchKIFSwift.swift b/BenchKIFSwift/BenchKIFSwift.swift deleted file mode 100644 index 9da11b1..0000000 --- a/BenchKIFSwift/BenchKIFSwift.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// BenchKIFSwift.swift -// BenchKIFSwift -// -// Created by Giovanni on 23/04/2015. -// Copyright (c) 2015 mokacoding. All rights reserved. -// - -import UIKit -import XCTest - -class BenchKIFSwift: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // This is an example of a functional test case. - XCTAssert(true, "Pass") - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measureBlock() { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/BenchKIFSwift/MainScreenSpec.swift b/BenchKIFSwift/MainScreenSpec.swift new file mode 100644 index 0000000..8eb502e --- /dev/null +++ b/BenchKIFSwift/MainScreenSpec.swift @@ -0,0 +1,36 @@ +import Quick + +class MainScreenSpec: QuickSpec { + + override func spec() { + KIFUITestActor.setDefaultTimeout(1) + + /** + * This ones fails, as in the failure is not delivered. + * Don't know why, maybe because of issues with the closures? + * + let t = self.tester() + */ + + describe("the main screen") { + context("when I tap the 'say hello' button") { + it("I see a greetings alert") { + self.tester().tapViewWithAccessibilityLabel("say hello") + + self.tester().waitForViewWithAccessibilityLabel("Hello") + self.tester().waitForViewWithAccessibilityLabel("Sup?") + self.tester().waitForViewWithAccessibilityLabel("Dismiss") + + self.tester().tapViewWithAccessibilityLabel("Dismiss") + + self.tester().waitForAbsenceOfViewWithAccessibilityLabel("Hello") + self.tester().waitForAbsenceOfViewWithAccessibilityLabel("Sup?") + self.tester().waitForAbsenceOfViewWithAccessibilityLabel("Dismiss") + + self.tester().waitForViewWithAccessibilityLabel("THIS IS HERE ON PURPOSE TO MAKE THE TEST FAIL") + } + } + } + } +} +