From 936f5f9d77952b725df72115d6244245f8b81354 Mon Sep 17 00:00:00 2001 From: Francesco Deliro Date: Sun, 7 Oct 2018 14:42:12 +0200 Subject: [PATCH 1/5] Added tvOSUITestsTarget --- Example-tvOSUITests/Example_tvOSUITests.swift | 34 +++++ Example-tvOSUITests/Info.plist | 22 +++ .../project.pbxproj | 139 +++++++++++++++++- .../xcschemes/Example-tvOS.xcscheme | 10 ++ 4 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 Example-tvOSUITests/Example_tvOSUITests.swift create mode 100644 Example-tvOSUITests/Info.plist diff --git a/Example-tvOSUITests/Example_tvOSUITests.swift b/Example-tvOSUITests/Example_tvOSUITests.swift new file mode 100644 index 00000000..51f7637e --- /dev/null +++ b/Example-tvOSUITests/Example_tvOSUITests.swift @@ -0,0 +1,34 @@ +// +// Example_tvOSUITests.swift +// Example-tvOSUITests +// +// Created by Francesco on 07/10/2018. +// Copyright © 2018 bcylin. All rights reserved. +// + +import XCTest + +class Example_tvOSUITests: XCTestCase { + + override func setUp() { + // 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 + + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().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. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +} diff --git a/Example-tvOSUITests/Info.plist b/Example-tvOSUITests/Info.plist new file mode 100644 index 00000000..6c40a6cd --- /dev/null +++ b/Example-tvOSUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 0c712b9f..9d912fb6 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 0313D389A7BCE29502848262 /* Pods_Example_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2A67F5AE20173B6E17FFBE /* Pods_Example_tvOS.framework */; }; + 136DD300216A367B00F554F0 /* Example_tvOSUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136DD2FF216A367B00F554F0 /* Example_tvOSUITests.swift */; }; 1DF796C7F4630ACDCE1DE189 /* Pods_QuickTableViewController_iOSTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51571B6D4B25D0BCCCFFBCF5 /* Pods_QuickTableViewController_iOSTests.framework */; }; A3895BA2FCD4633B9297CB06 /* Pods_QuickTableViewController_tvOSTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73EFDFBFA59BFFF7C494F9AE /* Pods_QuickTableViewController_tvOSTests.framework */; }; A7A26A71AB271F9D402D1A12 /* Pods_Example_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF3454E57819285B32968564 /* Pods_Example_iOS.framework */; }; @@ -98,6 +99,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 136DD302216A367B00F554F0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B5334F0A1B8CC5BD00C64A6D /* Project object */; + proxyType = 1; + remoteGlobalIDString = B54A24522088D44A00EEBA26; + remoteInfo = "Example-tvOS"; + }; B51A0E912069360500F42693 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = B5334F0A1B8CC5BD00C64A6D /* Project object */; @@ -150,6 +158,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 136DD2FD216A367B00F554F0 /* Example-tvOSUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Example-tvOSUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 136DD2FF216A367B00F554F0 /* Example_tvOSUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example_tvOSUITests.swift; sourceTree = ""; }; + 136DD301216A367B00F554F0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 466DB8C8ACDE64B9E0EF8D74 /* Pods-QuickTableViewController-iOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickTableViewController-iOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-QuickTableViewController-iOSTests/Pods-QuickTableViewController-iOSTests.release.xcconfig"; sourceTree = ""; }; 4AAC8E26F072FAB5027928F8 /* Pods-Example-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-tvOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS.debug.xcconfig"; sourceTree = ""; }; 4D38F5DD6F45D1136A106B9F /* Pods-QuickTableViewController-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickTableViewController-tvOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-QuickTableViewController-tvOSTests/Pods-QuickTableViewController-tvOSTests.release.xcconfig"; sourceTree = ""; }; @@ -229,6 +240,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 136DD2FA216A367B00F554F0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; B51F219F1F417037009BC2C9 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -287,6 +305,15 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 136DD2FE216A367B00F554F0 /* Example-tvOSUITests */ = { + isa = PBXGroup; + children = ( + 136DD2FF216A367B00F554F0 /* Example_tvOSUITests.swift */, + 136DD301216A367B00F554F0 /* Info.plist */, + ); + path = "Example-tvOSUITests"; + sourceTree = ""; + }; 942C1FAD68407A74DB056C2B /* Pods */ = { isa = PBXGroup; children = ( @@ -415,6 +442,7 @@ B51F21A31F417037009BC2C9 /* Example-iOS */, B51F21C11F41E600009BC2C9 /* Example-iOSUITests */, B54A24542088D44A00EEBA26 /* Example-tvOS */, + 136DD2FE216A367B00F554F0 /* Example-tvOSUITests */, B5DB7D241C4A4BEC007B84D2 /* Frameworks */, 942C1FAD68407A74DB056C2B /* Pods */, B5334F141B8CC5BD00C64A6D /* Products */, @@ -440,6 +468,7 @@ B54A24262088816D00EEBA26 /* QuickTableViewController.framework */, B54A242E2088816E00EEBA26 /* QuickTableViewControllerTests.xctest */, B5334F1E1B8CC5BD00C64A6D /* QuickTableViewControllerTests.xctest */, + 136DD2FD216A367B00F554F0 /* Example-tvOSUITests.xctest */, ); name = Products; sourceTree = ""; @@ -555,6 +584,24 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 136DD2FC216A367B00F554F0 /* Example-tvOSUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 136DD306216A367B00F554F0 /* Build configuration list for PBXNativeTarget "Example-tvOSUITests" */; + buildPhases = ( + 136DD2F9216A367B00F554F0 /* Sources */, + 136DD2FA216A367B00F554F0 /* Frameworks */, + 136DD2FB216A367B00F554F0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 136DD303216A367B00F554F0 /* PBXTargetDependency */, + ); + name = "Example-tvOSUITests"; + productName = "Example-tvOSUITests"; + productReference = 136DD2FD216A367B00F554F0 /* Example-tvOSUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; B51F21A11F417037009BC2C9 /* Example-iOS */ = { isa = PBXNativeTarget; buildConfigurationList = B51F21B31F417037009BC2C9 /* Build configuration list for PBXNativeTarget "Example-iOS" */; @@ -697,10 +744,16 @@ B5334F0A1B8CC5BD00C64A6D /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0930; + LastSwiftUpdateCheck = 1000; LastUpgradeCheck = 0930; ORGANIZATIONNAME = bcylin; TargetAttributes = { + 136DD2FC216A367B00F554F0 = { + CreatedOnToolsVersion = 10.0; + DevelopmentTeam = NQU669U9J9; + ProvisioningStyle = Automatic; + TestTargetID = B54A24522088D44A00EEBA26; + }; B51F21A11F417037009BC2C9 = { CreatedOnToolsVersion = 8.3.3; LastSwiftMigration = 1000; @@ -756,11 +809,19 @@ B51F21A11F417037009BC2C9 /* Example-iOS */, B51F21BF1F41E600009BC2C9 /* Example-iOSUITests */, B54A24522088D44A00EEBA26 /* Example-tvOS */, + 136DD2FC216A367B00F554F0 /* Example-tvOSUITests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 136DD2FB216A367B00F554F0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; B51F21A01F417037009BC2C9 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -985,6 +1046,14 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 136DD2F9216A367B00F554F0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 136DD300216A367B00F554F0 /* Example_tvOSUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B51F219E1F417037009BC2C9 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1105,6 +1174,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 136DD303216A367B00F554F0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B54A24522088D44A00EEBA26 /* Example-tvOS */; + targetProxy = 136DD302216A367B00F554F0 /* PBXContainerItemProxy */; + }; B51A0E922069360500F42693 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = B51F21A11F417037009BC2C9 /* Example-iOS */; @@ -1144,6 +1218,60 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 136DD304216A367B00F554F0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = NQU669U9J9; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = "Example-tvOSUITests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.github.bcylin.QuickTableViewController.Example-tvOSUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = 3; + TEST_TARGET_NAME = "Example-tvOS"; + TVOS_DEPLOYMENT_TARGET = 12.0; + }; + name = Debug; + }; + 136DD305216A367B00F554F0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = NQU669U9J9; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = "Example-tvOSUITests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "io.github.bcylin.QuickTableViewController.Example-tvOSUITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = 3; + TEST_TARGET_NAME = "Example-tvOS"; + TVOS_DEPLOYMENT_TARGET = 12.0; + }; + name = Release; + }; B51F21B11F417037009BC2C9 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = A57FEA19A020A7DE44AE8BCE /* Pods-Example-iOS.debug.xcconfig */; @@ -1607,6 +1735,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 136DD306216A367B00F554F0 /* Build configuration list for PBXNativeTarget "Example-tvOSUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 136DD304216A367B00F554F0 /* Debug */, + 136DD305216A367B00F554F0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; B51F21B31F417037009BC2C9 /* Build configuration list for PBXNativeTarget "Example-iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-tvOS.xcscheme b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-tvOS.xcscheme index 6eb7c438..f000d68a 100644 --- a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-tvOS.xcscheme +++ b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-tvOS.xcscheme @@ -28,6 +28,16 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + Date: Sun, 7 Oct 2018 14:45:52 +0200 Subject: [PATCH 2/5] Implemented testInteractions function --- Example-tvOSUITests/Example_tvOSUITests.swift | 114 +++++++++++++++--- .../project.pbxproj | 17 +++ 2 files changed, 115 insertions(+), 16 deletions(-) diff --git a/Example-tvOSUITests/Example_tvOSUITests.swift b/Example-tvOSUITests/Example_tvOSUITests.swift index 51f7637e..f94713dd 100644 --- a/Example-tvOSUITests/Example_tvOSUITests.swift +++ b/Example-tvOSUITests/Example_tvOSUITests.swift @@ -2,33 +2,115 @@ // Example_tvOSUITests.swift // Example-tvOSUITests // -// Created by Francesco on 07/10/2018. +// Created by Francesco Deliro on 07/10/2018. // Copyright © 2018 bcylin. All rights reserved. // +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// import XCTest class Example_tvOSUITests: XCTestCase { - override func setUp() { - // Put setup code here. This method is called before the invocation of each test method in the class. + private lazy var app: XCUIApplication = XCUIApplication() + + override func setUp() { + super.setUp() + continueAfterFailure = false + app.launch() + } + + func testInteractions() { + + let tables = XCUIApplication().tables + let existance = NSPredicate(format: "exists == true") + let hasFocus = NSPredicate(format: "hasFocus == true") + + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Setting 1").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) + + XCUIRemote.shared.press(.down) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Setting 2").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) + + XCUIRemote.shared.press(.down) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Tap action").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) + + expectation(for: hasFocus, evaluatedWith: app.alerts["Tap action"].otherElements["OK"], handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) + + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Tap action").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + + XCUIRemote.shared.press(.down) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"CellStyle.default").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) + + expectation(for: existance, evaluatedWith: app.otherElements.containing(.staticText, identifier:"CellStyle.default").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.menu) + + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"CellStyle.default").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + + XCUIRemote.shared.press(.down) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".subtitle").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) + + expectation(for: existance, evaluatedWith: app.otherElements.containing(.staticText, identifier:"CellStyle.subtitle").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.menu) + + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".subtitle").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) - // In UI tests it is usually best to stop immediately when a failure occurs. - continueAfterFailure = false + XCUIRemote.shared.press(.down) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".value1").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) - // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. - XCUIApplication().launch() + XCUIRemote.shared.press(.down) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".value2").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) - // 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. - } + XCUIRemote.shared.press(.down) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 1").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } + XCUIRemote.shared.press(.down) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 2").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) - func testExample() { - // Use recording to get started writing UI tests. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } + XCUIRemote.shared.press(.down) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 3").element, handler: nil) + waitForExpectations(timeout: 5, handler: nil) + XCUIRemote.shared.press(.select) + } } diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 9d912fb6..30f95acf 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -9,6 +9,8 @@ /* Begin PBXBuildFile section */ 0313D389A7BCE29502848262 /* Pods_Example_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2A67F5AE20173B6E17FFBE /* Pods_Example_tvOS.framework */; }; 136DD300216A367B00F554F0 /* Example_tvOSUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136DD2FF216A367B00F554F0 /* Example_tvOSUITests.swift */; }; + 136DD307216A36FA00F554F0 /* QuickTableViewController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B54A24262088816D00EEBA26 /* QuickTableViewController.framework */; }; + 136DD308216A36FA00F554F0 /* QuickTableViewController.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B54A24262088816D00EEBA26 /* QuickTableViewController.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 1DF796C7F4630ACDCE1DE189 /* Pods_QuickTableViewController_iOSTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51571B6D4B25D0BCCCFFBCF5 /* Pods_QuickTableViewController_iOSTests.framework */; }; A3895BA2FCD4633B9297CB06 /* Pods_QuickTableViewController_tvOSTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73EFDFBFA59BFFF7C494F9AE /* Pods_QuickTableViewController_tvOSTests.framework */; }; A7A26A71AB271F9D402D1A12 /* Pods_Example_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF3454E57819285B32968564 /* Pods_Example_iOS.framework */; }; @@ -144,6 +146,17 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 136DD309216A36FA00F554F0 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 136DD308216A36FA00F554F0 /* QuickTableViewController.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; B51F21CE1F41F32D009BC2C9 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -298,6 +311,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 136DD307216A36FA00F554F0 /* QuickTableViewController.framework in Frameworks */, 0313D389A7BCE29502848262 /* Pods_Example_tvOS.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -727,6 +741,7 @@ B54A244F2088D44A00EEBA26 /* Sources */, B54A24502088D44A00EEBA26 /* Frameworks */, B54A24512088D44A00EEBA26 /* Resources */, + 136DD309216A36FA00F554F0 /* Embed Frameworks */, ); buildRules = ( ); @@ -1683,6 +1698,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 4AAC8E26F072FAB5027928F8 /* Pods-Example-tvOS.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ANALYZER_NONNULL = YES; @@ -1710,6 +1726,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = C846A13C763FF2B7B3A6029A /* Pods-Example-tvOS.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ANALYZER_NONNULL = YES; From c72fb326f3c1dbe0f340803dfa909c4f74d19f67 Mon Sep 17 00:00:00 2001 From: Francesco Deliro Date: Sun, 7 Oct 2018 14:50:17 +0200 Subject: [PATCH 3/5] Set Example_tvOSUITests class as internal final --- Example-tvOSUITests/Example_tvOSUITests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example-tvOSUITests/Example_tvOSUITests.swift b/Example-tvOSUITests/Example_tvOSUITests.swift index f94713dd..9f631894 100644 --- a/Example-tvOSUITests/Example_tvOSUITests.swift +++ b/Example-tvOSUITests/Example_tvOSUITests.swift @@ -26,7 +26,7 @@ import XCTest -class Example_tvOSUITests: XCTestCase { +internal final class Example_tvOSUITests: XCTestCase { private lazy var app: XCUIApplication = XCUIApplication() From 05b01a967ff3442c7fd89a2621a90e7565e0cc53 Mon Sep 17 00:00:00 2001 From: Francesco Deliro Date: Tue, 9 Oct 2018 21:20:35 +0200 Subject: [PATCH 4/5] Add-tvOSUITests: code review required changes --- .travis.yml | 2 +- ...tvOSUITests.swift => ExampleUITests.swift} | 2 +- .../project.pbxproj | 21 ++++++++++--------- 3 files changed, 13 insertions(+), 12 deletions(-) rename Example-tvOSUITests/{Example_tvOSUITests.swift => ExampleUITests.swift} (98%) diff --git a/.travis.yml b/.travis.yml index b505eb26..4b2e59cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ script: - bundle exec rake "test:tvos[QuickTableViewController-tvOS]" - bash <(curl -s https://codecov.io/bash) -cF ios -J "QuickTableViewController" - bundle exec rake "test:ios[Example-iOS]" - - bundle exec rake "build:tvos[Example-tvOS]" + - bundle exec rake "test:tvos[Example-tvOS]" - make -B carthage - make -B docs after_success: diff --git a/Example-tvOSUITests/Example_tvOSUITests.swift b/Example-tvOSUITests/ExampleUITests.swift similarity index 98% rename from Example-tvOSUITests/Example_tvOSUITests.swift rename to Example-tvOSUITests/ExampleUITests.swift index 9f631894..cce13147 100644 --- a/Example-tvOSUITests/Example_tvOSUITests.swift +++ b/Example-tvOSUITests/ExampleUITests.swift @@ -26,7 +26,7 @@ import XCTest -internal final class Example_tvOSUITests: XCTestCase { +internal final class ExampleUITests: XCTestCase { private lazy var app: XCUIApplication = XCUIApplication() diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 30f95acf..7225059c 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -8,7 +8,7 @@ /* Begin PBXBuildFile section */ 0313D389A7BCE29502848262 /* Pods_Example_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2A67F5AE20173B6E17FFBE /* Pods_Example_tvOS.framework */; }; - 136DD300216A367B00F554F0 /* Example_tvOSUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136DD2FF216A367B00F554F0 /* Example_tvOSUITests.swift */; }; + 136DD300216A367B00F554F0 /* ExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 136DD2FF216A367B00F554F0 /* ExampleUITests.swift */; }; 136DD307216A36FA00F554F0 /* QuickTableViewController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B54A24262088816D00EEBA26 /* QuickTableViewController.framework */; }; 136DD308216A36FA00F554F0 /* QuickTableViewController.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B54A24262088816D00EEBA26 /* QuickTableViewController.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 1DF796C7F4630ACDCE1DE189 /* Pods_QuickTableViewController_iOSTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51571B6D4B25D0BCCCFFBCF5 /* Pods_QuickTableViewController_iOSTests.framework */; }; @@ -172,7 +172,7 @@ /* Begin PBXFileReference section */ 136DD2FD216A367B00F554F0 /* Example-tvOSUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Example-tvOSUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 136DD2FF216A367B00F554F0 /* Example_tvOSUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example_tvOSUITests.swift; sourceTree = ""; }; + 136DD2FF216A367B00F554F0 /* ExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleUITests.swift; sourceTree = ""; }; 136DD301216A367B00F554F0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 466DB8C8ACDE64B9E0EF8D74 /* Pods-QuickTableViewController-iOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickTableViewController-iOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-QuickTableViewController-iOSTests/Pods-QuickTableViewController-iOSTests.release.xcconfig"; sourceTree = ""; }; 4AAC8E26F072FAB5027928F8 /* Pods-Example-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-tvOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS.debug.xcconfig"; sourceTree = ""; }; @@ -322,7 +322,7 @@ 136DD2FE216A367B00F554F0 /* Example-tvOSUITests */ = { isa = PBXGroup; children = ( - 136DD2FF216A367B00F554F0 /* Example_tvOSUITests.swift */, + 136DD2FF216A367B00F554F0 /* ExampleUITests.swift */, 136DD301216A367B00F554F0 /* Info.plist */, ); path = "Example-tvOSUITests"; @@ -765,8 +765,7 @@ TargetAttributes = { 136DD2FC216A367B00F554F0 = { CreatedOnToolsVersion = 10.0; - DevelopmentTeam = NQU669U9J9; - ProvisioningStyle = Automatic; + ProvisioningStyle = Manual; TestTargetID = B54A24522088D44A00EEBA26; }; B51F21A11F417037009BC2C9 = { @@ -1065,7 +1064,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 136DD300216A367B00F554F0 /* Example_tvOSUITests.swift in Sources */, + 136DD300216A367B00F554F0 /* ExampleUITests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1242,9 +1241,9 @@ CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = NQU669U9J9; + DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Example-tvOSUITests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -1252,6 +1251,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "io.github.bcylin.QuickTableViewController.Example-tvOSUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_VERSION = 4.2; @@ -1270,14 +1270,15 @@ CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = NQU669U9J9; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Example-tvOSUITests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "io.github.bcylin.QuickTableViewController.Example-tvOSUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 4.2; From 3e77af418ec76459b11cac193954296e01c70cfc Mon Sep 17 00:00:00 2001 From: Francesco Deliro Date: Fri, 12 Oct 2018 12:48:24 +0200 Subject: [PATCH 5/5] Add-tvOSUITests: fixed swift lint warnings --- Example-tvOSUITests/ExampleUITests.swift | 31 ++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Example-tvOSUITests/ExampleUITests.swift b/Example-tvOSUITests/ExampleUITests.swift index cce13147..d2bd4ab1 100644 --- a/Example-tvOSUITests/ExampleUITests.swift +++ b/Example-tvOSUITests/ExampleUITests.swift @@ -36,23 +36,24 @@ internal final class ExampleUITests: XCTestCase { app.launch() } +// swiftlint:disable function_body_length line_length func testInteractions() { let tables = XCUIApplication().tables let existance = NSPredicate(format: "exists == true") let hasFocus = NSPredicate(format: "hasFocus == true") - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Setting 1").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: "Setting 1").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) XCUIRemote.shared.press(.down) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Setting 2").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: "Setting 2").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) XCUIRemote.shared.press(.down) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Tap action").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: "Tap action").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) @@ -60,55 +61,55 @@ internal final class ExampleUITests: XCTestCase { waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Tap action").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: "Tap action").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.down) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"CellStyle.default").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: "CellStyle.default").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) - expectation(for: existance, evaluatedWith: app.otherElements.containing(.staticText, identifier:"CellStyle.default").element, handler: nil) + expectation(for: existance, evaluatedWith: app.otherElements.containing(.staticText, identifier: "CellStyle.default").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.menu) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"CellStyle.default").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: "CellStyle.default").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.down) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".subtitle").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: ".subtitle").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) - expectation(for: existance, evaluatedWith: app.otherElements.containing(.staticText, identifier:"CellStyle.subtitle").element, handler: nil) + expectation(for: existance, evaluatedWith: app.otherElements.containing(.staticText, identifier: "CellStyle.subtitle").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.menu) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".subtitle").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: ".subtitle").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.down) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".value1").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: ".value1").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) XCUIRemote.shared.press(.down) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".value2").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: ".value2").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) XCUIRemote.shared.press(.down) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 1").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: "Option 1").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) XCUIRemote.shared.press(.down) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 2").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: "Option 2").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) XCUIRemote.shared.press(.down) - expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 3").element, handler: nil) + expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier: "Option 3").element, handler: nil) waitForExpectations(timeout: 5, handler: nil) XCUIRemote.shared.press(.select) }