diff --git a/Clocker/Clocker.xcodeproj/project.pbxproj b/Clocker/Clocker.xcodeproj/project.pbxproj index 2ebbcb7..cf8b833 100755 --- a/Clocker/Clocker.xcodeproj/project.pbxproj +++ b/Clocker/Clocker.xcodeproj/project.pbxproj @@ -106,6 +106,7 @@ 9A7CDC1B22BEC2170035902D /* StartupManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A7CDC1A22BEC2170035902D /* StartupManager.swift */; }; 9A8605AE1BEC148400A810A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605AD1BEC148400A810A4 /* main.m */; }; 9A8B256A232EFAD300204CAD /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9A13BAEC1CA88A76007C6CBE /* Localizable.strings */; }; + 9A97419B2455442100087B0D /* OnboardingSearchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A97419A2455442100087B0D /* OnboardingSearchTests.swift */; }; 9A9E87621C1FEDB500A7A2DF /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A9E87611C1FEDB500A7A2DF /* CFNetwork.framework */; }; 9A9E876A1C1FEDDB00A7A2DF /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A9E87691C1FEDDB00A7A2DF /* SystemConfiguration.framework */; }; 9AA522C023415BDD00C9E005 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9AA522BE23415BDD00C9E005 /* InfoPlist.strings */; }; @@ -335,6 +336,7 @@ 9A8605C31BEC155B00A810A4 /* Clocker-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Clocker-Info.plist"; path = "Clocker/Clocker-Info.plist"; sourceTree = ""; }; 9A8605CC1BEC155B00A810A4 /* Clocker-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Clocker-Prefix.pch"; path = "Clocker/Clocker-Prefix.pch"; sourceTree = ""; }; 9A86E2B51CE04F1600547EE7 /* ShortcutRecorder.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ShortcutRecorder.xcodeproj; path = "Clocker/ShortcutRecorder-master/ShortcutRecorder.xcodeproj"; sourceTree = ""; }; + 9A97419A2455442100087B0D /* OnboardingSearchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingSearchTests.swift; sourceTree = ""; }; 9A9E87611C1FEDB500A7A2DF /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; 9A9E87631C1FEDBD00A7A2DF /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 9A9E87651C1FEDC500A7A2DF /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; @@ -806,6 +808,7 @@ C2D30A8C21025106000BFAEE /* NetworkDisconnectionTests.swift */, C22F3D7F2107778A0001D5E1 /* ShortcutTests.swift */, C2AB022321AEED590014A401 /* OnboardingTests.swift */, + 9A97419A2455442100087B0D /* OnboardingSearchTests.swift */, ); path = ClockerUITests; sourceTree = ""; @@ -963,7 +966,7 @@ CLASSPREFIX = ""; DefaultBuildSystemTypeForWorkspace = Latest; LastSwiftUpdateCheck = 1000; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1140; TargetAttributes = { 9A7547CF1F184DC3004705EF = { CreatedOnToolsVersion = 8.3.2; @@ -1177,6 +1180,7 @@ C213713420B4FD920024D5A4 /* FloatingWindowTests.swift in Sources */, C22F3D802107778A0001D5E1 /* ShortcutTests.swift in Sources */, C2D30A8A210245C6000BFAEE /* ReviewTests.swift in Sources */, + 9A97419B2455442100087B0D /* OnboardingSearchTests.swift in Sources */, C2D30A8D21025106000BFAEE /* NetworkDisconnectionTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1931,6 +1935,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; + ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", diff --git a/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme b/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme index c6904e3..60465e1 100644 --- a/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme +++ b/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + + + + @@ -50,17 +59,6 @@ - - - - - - - - diff --git a/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme b/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme index 0d28993..239f1b8 100644 --- a/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme +++ b/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -39,17 +48,6 @@ - - - - - - - - + + + + @@ -39,17 +48,6 @@ - - - - - - - - - - - - - - - - 0) + + let resultsPredicate = NSPredicate(format: "value CONTAINS 'Paris'", "") + XCTAssertTrue(firstResult.staticTexts.matching(resultsPredicate).count > 0) + + // Let's retrieve the tap and add it! + firstResult.doubleClick() + + sleep(2) // Wait for the Undo button to appear + + // Ensure Added Text is shown properly! + let predicate = NSPredicate(format: "value BEGINSWITH 'Added'", "") + let successTextShown = app.staticTexts.containing(predicate) + XCTAssertTrue(successTextShown.count > 0) + } + + func testUndoSearch() throws { + let searchField = app.searchFields["MainSearchField"] + searchField.reset(text: "Seoul") + searchField.typeKey(XCUIKeyboardKey.return, modifierFlags: XCUIElement.KeyModifierFlags()) + + sleep(2) // Wait for the query to return + + let results = app.tables["ResultsTableView"] + let firstResult = results.cells.firstMatch + XCTAssertTrue(results.cells.count > 0) + + let resultsPredicate = NSPredicate(format: "value CONTAINS 'Seoul'", "") + XCTAssertTrue(firstResult.staticTexts.containing(resultsPredicate).count > 0) + + // Let's retrieve the tap and add it! + firstResult.doubleClick() + + sleep(2) // Wait for the Undo button to appear + + // Ensure Added Text is shown properly! + let predicate = NSPredicate(format: "value BEGINSWITH 'Added'", "") + let successTextShown = app.staticTexts.containing(predicate) + XCTAssertTrue(successTextShown.count > 0) + + let undoButton = app.buttons.matching(identifier: "UndoButton").firstMatch + undoButton.click() + + // Ensure Removed Text is shown! + let removedPredicate = NSPredicate(format: "value BEGINSWITH 'Removed.'", "") + let removedText = app.staticTexts.containing(removedPredicate) + XCTAssertTrue(removedText.count > 0) + } + + func testMispelledCityNameSearch() throws { + let searchField = app.searchFields["MainSearchField"] + searchField.reset(text: "ajsdkjasdkjhasdkashkjda") + searchField.typeKey(XCUIKeyboardKey.return, modifierFlags: XCUIElement.KeyModifierFlags()) + + sleep(2) // Wait for the query to return + + let results = app.tables["ResultsTableView"] + let firstResult = results.cells.firstMatch + XCTAssertTrue(results.cells.count == 0) + XCTAssertFalse(firstResult.staticTexts["Paris, France"].exists) + + sleep(2) // Wait for the Undo button to appear + + // Ensure Added Text is shown properly! + let noErrorTextPredicate = NSPredicate(format: "value CONTAINS 'No results! 😔 Try entering the exact name.'", "") + let noErrorText = app.staticTexts.containing(noErrorTextPredicate) + XCTAssertTrue(noErrorText.count > 0) + } + + private func moveForward() { + let onboardingWindow = app.windows["OnboardingWindow"] + onboardingWindow.buttons["Forward"].click() + sleep(1) + } +} diff --git a/Clocker/Onboarding/Onboarding.storyboard b/Clocker/Onboarding/Onboarding.storyboard index 54e7e48..79eb531 100644 --- a/Clocker/Onboarding/Onboarding.storyboard +++ b/Clocker/Onboarding/Onboarding.storyboard @@ -1,8 +1,8 @@ - + - + @@ -119,7 +119,7 @@ DQ - + @@ -127,7 +127,7 @@ DQ - + @@ -164,7 +164,7 @@ DQ - + @@ -172,10 +172,10 @@ DQ - + - + @@ -183,7 +183,7 @@ DQ - + @@ -201,7 +201,7 @@ DQ - + @@ -219,10 +219,10 @@ DQ - + - + @@ -230,7 +230,7 @@ DQ - + @@ -238,7 +238,7 @@ DQ - + @@ -246,7 +246,7 @@ DQ - + @@ -286,7 +286,7 @@ DQ - + @@ -294,7 +294,7 @@ DQ - + @@ -358,7 +358,7 @@ DQ - + @@ -366,7 +366,7 @@ DQ - + @@ -374,7 +374,7 @@ DQ - + @@ -382,7 +382,7 @@ DQ - + @@ -433,7 +433,7 @@ DQ - + @@ -441,7 +441,7 @@ DQ - + @@ -458,26 +458,23 @@ DQ - - - + - + - + - + - @@ -488,12 +485,12 @@ DQ - + - + @@ -511,12 +508,12 @@ DQ - + - + @@ -552,16 +549,16 @@ DQ - - + + -