diff --git a/maestro-client/src/main/java/maestro/drivers/IOSDriver.kt b/maestro-client/src/main/java/maestro/drivers/IOSDriver.kt index f4ae891751..c72f94ffcd 100644 --- a/maestro-client/src/main/java/maestro/drivers/IOSDriver.kt +++ b/maestro-client/src/main/java/maestro/drivers/IOSDriver.kt @@ -118,9 +118,7 @@ class IOSDriver( iosDevice.pressKey(name) } - buttonNameMap[code]?.let { name -> - iosDevice.pressButton(name) - } + iosDevice.pressButton(code.description) } } diff --git a/maestro-ios-driver/build.gradle.kts b/maestro-ios-driver/build.gradle.kts index 04da74c4f3..632169bc9b 100644 --- a/maestro-ios-driver/build.gradle.kts +++ b/maestro-ios-driver/build.gradle.kts @@ -15,6 +15,7 @@ dependencies { implementation(project(":maestro-utils")) api(libs.square.okhttp) + api(libs.google.gson) api(libs.square.okhttp.logs) api(libs.jackson.module.kotlin) api(libs.jarchivelib) diff --git a/maestro-ios-driver/src/main/kotlin/xcuitest/installer/LocalXCTestInstaller.kt b/maestro-ios-driver/src/main/kotlin/xcuitest/installer/LocalXCTestInstaller.kt index 8e3894ec1c..b6be948bff 100644 --- a/maestro-ios-driver/src/main/kotlin/xcuitest/installer/LocalXCTestInstaller.kt +++ b/maestro-ios-driver/src/main/kotlin/xcuitest/installer/LocalXCTestInstaller.kt @@ -10,6 +10,7 @@ import okio.source import org.apache.commons.io.FileUtils import org.rauschig.jarchivelib.ArchiverFactory import org.slf4j.LoggerFactory +import util.LocalSimulatorUtils import util.XCRunnerCLIUtils import xcuitest.XCTestClient import java.io.File @@ -159,16 +160,32 @@ class LocalXCTestInstaller( return checkSuccessful } + private fun isTV(deviceId: String): Boolean { + val list = LocalSimulatorUtils.list() + for (entry in list.devices.entries) { + for (device in entry.value) { + if (device.udid != deviceId) continue + if (device.deviceTypeIdentifier == null) continue + logger.trace("Device is an AppleTV") + return device.deviceTypeIdentifier.contains("Apple-TV") + } + } + + return false + } + private fun startXCTestRunner() { val processOutput = ProcessBuilder(listOf("xcrun", "simctl", "spawn", deviceId, "launchctl", "list")) .start() .inputStream.source().buffer().readUtf8() .trim() + val isTV = isTV(deviceId) + logger.info("[Start] Writing xctest run file") val tempDir = File(tempDir).apply { mkdir() } - val xctestRunFile = File("$tempDir/maestro-driver-ios-config.xctestrun") - writeFileToDestination(XCTEST_RUN_PATH, xctestRunFile) + val xctestRunFile = File("${tempDir}/maestro-driver-config.xctestrun") + writeFileToDestination(XCTEST_RUN_PATH, xctestRunFile, isTV) logger.info("[Done] Writing xctest run file") if (processOutput.contains(UI_TEST_RUNNER_APP_BUNDLE_ID)) { @@ -177,13 +194,13 @@ class LocalXCTestInstaller( } else { logger.info("Not able to find ui test runner app running, going to install now") - logger.info("[Start] Writing maestro-driver-iosUITests-Runner app") - extractZipToApp("maestro-driver-iosUITests-Runner", UI_TEST_RUNNER_PATH) - logger.info("[Done] Writing maestro-driver-iosUITests-Runner app") + logger.info("[Start] Writing maestro-driverUITests-Runner app") + extractZipToApp("maestro-driverUITests-Runner", UI_TEST_RUNNER_PATH, isTV) + logger.info("[Done] Writing maestro-driverUITests-Runner app") - logger.info("[Start] Writing maestro-driver-ios app") - extractZipToApp("maestro-driver-ios", UI_TEST_HOST_PATH) - logger.info("[Done] Writing maestro-driver-ios app") + logger.info("[Start] Writing maestro-driver app") + extractZipToApp("maestro-driver", UI_TEST_HOST_PATH, isTV) + logger.info("[Done] Writing maestro-driver app") } logger.info("[Start] Running XcUITest with `xcodebuild test-without-building`") @@ -207,18 +224,25 @@ class LocalXCTestInstaller( logger.info("[Done] Cleaning up the ui test runner files") } - private fun extractZipToApp(appFileName: String, srcAppPath: String) { - val appFile = File("$tempDir/Debug-iphonesimulator").apply { mkdir() } + private fun extractZipToApp(appFileName: String, srcAppPath: String, isTV: Boolean) { + val appFile = when(isTV) { + true -> File("$tempDir/Debug-appletvsimulator").apply { mkdir() } + false -> File("$tempDir/Debug-iphonesimulator").apply { mkdir() } + } val appZip = File("$tempDir/$appFileName.zip") - writeFileToDestination(srcAppPath, appZip) + writeFileToDestination(srcAppPath, appZip, isTV) ArchiverFactory.createArchiver(appZip).apply { extract(appZip, appFile) } } - private fun writeFileToDestination(srcPath: String, destFile: File) { - LocalXCTestInstaller::class.java.getResourceAsStream(srcPath)?.let { + private fun writeFileToDestination(srcPath: String, destFile: File, isTV: Boolean) { + val prefix = when (isTV) { + true -> "/tvos/" + false -> "/ios/" + } + LocalXCTestInstaller::class.java.getResourceAsStream(prefix + srcPath)?.let { val bufferedSink = destFile.sink().buffer() bufferedSink.writeAll(it.source()) bufferedSink.flush() @@ -226,9 +250,9 @@ class LocalXCTestInstaller( } companion object { - private const val UI_TEST_RUNNER_PATH = "/maestro-driver-iosUITests-Runner.zip" - private const val XCTEST_RUN_PATH = "/maestro-driver-ios-config.xctestrun" - private const val UI_TEST_HOST_PATH = "/maestro-driver-ios.zip" - private const val UI_TEST_RUNNER_APP_BUNDLE_ID = "dev.mobile.maestro-driver-iosUITests.xctrunner" + private const val UI_TEST_RUNNER_PATH = "maestro-driverUITests-Runner.zip" + private const val XCTEST_RUN_PATH = "maestro-driver-config.xctestrun" + private const val UI_TEST_HOST_PATH = "maestro-driver.zip" + private const val UI_TEST_RUNNER_APP_BUNDLE_ID = "dev.mobile.maestro-driverUITests.xctrunner" } } diff --git a/maestro-ios-driver/src/main/resources/ios/maestro-driver-config.xctestrun b/maestro-ios-driver/src/main/resources/ios/maestro-driver-config.xctestrun new file mode 100644 index 0000000000..9a384fde0a --- /dev/null +++ b/maestro-ios-driver/src/main/resources/ios/maestro-driver-config.xctestrun @@ -0,0 +1,237 @@ + + + + + CodeCoverageBuildableInfos + + + Architectures + + x86_64 + + BuildableIdentifier + 44F995232C9D6F8800D15B50:primary + IncludeInReport + + IsStatic + + Name + maestro-driver.app + ProductPaths + + __TESTROOT__/Debug-iphonesimulator/maestro-driver.app/maestro-driver + + SourceFiles + + ContentView.swift + maestro_driverApp.swift + + SourceFilesCommonPathPrefix + /Users/max.phillips/dev/maestro-tvos/maestro-ios-xctest-runner/maestro-driver/ + Toolchains + + com.apple.dt.toolchain.XcodeDefault + + + + Architectures + + x86_64 + + BuildableIdentifier + 52049BF2293503A200807AA3:primary + IncludeInReport + + IsStatic + + Name + maestro-driverUITests.xctest + ProductPaths + + __TESTROOT__/Debug-iphonesimulator/maestro-driverUITests-Runner.app/PlugIns/maestro-driverUITests.xctest/maestro-driverUITests + + SourceFiles + + Routes/Extensions/Logger.swift + Routes/Extensions/StringExtensions.swift + Routes/Extensions/XCUIElement+Extensions.swift + Routes/Handlers/DeviceInfoHandler.swift + Routes/Handlers/EraseTextHandler.swift + Routes/Handlers/InputTextRouteHandler.swift + Routes/Handlers/KeyboardRouteHandler.swift + Routes/Handlers/PressButtonHandler.swift + Routes/Handlers/PressKeyHandler.swift + Routes/Handlers/RunningAppRouteHandler.swift + Routes/Handlers/ScreenDiffHandler.swift + Routes/Handlers/ScreenshotHandler.swift + Routes/Handlers/SetPermissionsHandler.swift + Routes/Handlers/StatusHandler.swift + Routes/Handlers/SwipeRouteHandler.swift + Routes/Handlers/SwipeRouteHandlerV2.swift + Routes/Handlers/TouchRouteHandler.swift + Routes/Handlers/ViewHierarchyHandler.swift + Routes/Helpers/AppError.swift + Routes/Helpers/ScreenSizeHelper.swift + Routes/Helpers/SystemPermissionHelper.swift + Routes/Helpers/TextInputHelper.swift + Routes/Helpers/TimeoutHelper.swift + Routes/Models/AXElement.swift + Routes/Models/DeviceInfoResponse.swift + Routes/Models/EraseTextRequest.swift + Routes/Models/GetRunningAppRequest.swift + Routes/Models/InputTextRequest.swift + Routes/Models/KeyboardHandlerRequest.swift + Routes/Models/KeyboardHandlerResponse.swift + Routes/Models/PressButtonRequest.swift + Routes/Models/PressKeyRequest.swift + Routes/Models/SetPermissionsRequest.swift + Routes/Models/StatusResponse.swift + Routes/Models/SwipeRequest.swift + Routes/Models/TouchRequest.swift + Routes/Models/ViewHierarchyRequest.swift + Routes/RouteHandlerFactory.swift + Routes/XCTest/AXClientSwizzler.swift + Routes/XCTest/EventRecord.swift + Routes/XCTest/EventTarget.swift + Routes/XCTest/KeyModifierFlags.swift + Routes/XCTest/PointerEventPath.swift + Routes/XCTest/RunnerDaemonProxy.swift + Routes/XCTest/RunningApp.swift + Routes/XCTestHTTPServer.swift + maestro_driver_iosUITests.swift + + SourceFilesCommonPathPrefix + /Users/max.phillips/dev/maestro-tvos/maestro-ios-xctest-runner/maestro-driver-iosUITests/ + Toolchains + + com.apple.dt.toolchain.XcodeDefault + + + + ContainerInfo + + ContainerName + maestro-driver-ios + SchemeName + maestro-driver + + TestConfigurations + + + Name + Test Scheme Action + TestTargets + + + BlueprintName + maestro-driverUITests + BlueprintProviderName + maestro-driver-ios + BlueprintProviderRelativePath + maestro-driver-ios.xcodeproj + BundleIdentifiersForCrashReportEmphasis + + dev.mobile.maestro-driver + dev.mobile.maestro-driverUITests + + ClangProfileDataDirectoryPath + __DERIVEDDATA__/Build/Intermediates.noindex/CodeCoverage/ProfileData + CommandLineArguments + + DefaultTestExecutionTimeAllowance + 600 + DependentProductPaths + + __TESTROOT__/Debug-iphonesimulator/maestro-driver.app + __TESTROOT__/Debug-iphonesimulator/maestro-driverUITests-Runner.app + __TESTROOT__/Debug-iphonesimulator/maestro-driverUITests-Runner.app/PlugIns/maestro-driverUITests.xctest + + DiagnosticCollectionPolicy + 1 + EnvironmentVariables + + APP_DISTRIBUTOR_ID_OVERRIDE + com.apple.AppStore + OS_ACTIVITY_DT_MODE + YES + SQLITE_ENABLE_THREAD_ASSERTIONS + 1 + TERM + dumb + + IsUITestBundle + + IsXCTRunnerHostedTestBundle + + PreferredScreenCaptureFormat + screenRecording + ProductModuleName + maestro_driverUITests + SystemAttachmentLifetime + deleteOnSuccess + TestBundlePath + __TESTHOST__/PlugIns/maestro-driverUITests.xctest + TestHostBundleIdentifier + dev.mobile.maestro-driverUITests.xctrunner + TestHostPath + __TESTROOT__/Debug-iphonesimulator/maestro-driverUITests-Runner.app + TestLanguage + + TestRegion + + TestTimeoutsEnabled + + TestingEnvironmentVariables + + DYLD_FRAMEWORK_PATH + __TESTROOT__/Debug-iphonesimulator:__TESTROOT__/Debug-iphonesimulator/PackageFrameworks:__PLATFORMS__/iPhoneSimulator.platform/Developer/Library/Frameworks + DYLD_LIBRARY_PATH + __TESTROOT__/Debug-iphonesimulator:__PLATFORMS__/iPhoneSimulator.platform/Developer/usr/lib + __XCODE_BUILT_PRODUCTS_DIR_PATHS + __TESTROOT__/Debug-iphonesimulator + __XPC_DYLD_FRAMEWORK_PATH + __TESTROOT__/Debug-iphonesimulator + __XPC_DYLD_LIBRARY_PATH + __TESTROOT__/Debug-iphonesimulator + + ToolchainsSettingValue + + UITargetAppCommandLineArguments + + UITargetAppEnvironmentVariables + + APP_DISTRIBUTOR_ID_OVERRIDE + com.apple.AppStore + DYLD_FRAMEWORK_PATH + __TESTROOT__/Debug-iphonesimulator:__TESTROOT__/Debug-iphonesimulator/PackageFrameworks + DYLD_LIBRARY_PATH + __TESTROOT__/Debug-iphonesimulator + __XCODE_BUILT_PRODUCTS_DIR_PATHS + __TESTROOT__/Debug-iphonesimulator + __XPC_DYLD_FRAMEWORK_PATH + __TESTROOT__/Debug-iphonesimulator + __XPC_DYLD_LIBRARY_PATH + __TESTROOT__/Debug-iphonesimulator + + UITargetAppPath + __TESTROOT__/Debug-iphonesimulator/maestro-driver.app + UserAttachmentLifetime + deleteOnSuccess + + + + + TestPlan + + IsDefault + + Name + maestro-driver + + __xctestrun_metadata__ + + FormatVersion + 2 + + + diff --git a/maestro-ios-driver/src/main/resources/ios/maestro-driver.zip b/maestro-ios-driver/src/main/resources/ios/maestro-driver.zip new file mode 100644 index 0000000000..677b0abf00 Binary files /dev/null and b/maestro-ios-driver/src/main/resources/ios/maestro-driver.zip differ diff --git a/maestro-ios-driver/src/main/resources/ios/maestro-driverUITests-Runner.zip b/maestro-ios-driver/src/main/resources/ios/maestro-driverUITests-Runner.zip new file mode 100644 index 0000000000..eec9128227 Binary files /dev/null and b/maestro-ios-driver/src/main/resources/ios/maestro-driverUITests-Runner.zip differ diff --git a/maestro-ios-driver/src/main/resources/maestro-driver-ios-config.xctestrun b/maestro-ios-driver/src/main/resources/maestro-driver-ios-config.xctestrun deleted file mode 100644 index 73724610a4..0000000000 --- a/maestro-ios-driver/src/main/resources/maestro-driver-ios-config.xctestrun +++ /dev/null @@ -1,105 +0,0 @@ - - - - - __xctestrun_metadata__ - - ContainerInfo - - ContainerName - maestro-driver-ios - SchemeName - maestro-driver-ios - - FormatVersion - 1 - - maestro-driver-iosUITests - - BlueprintName - maestro-driver-iosUITests - BlueprintProviderName - maestro-driver-ios - BundleIdentifiersForCrashReportEmphasis - - dev.mobile.maestro-driver-ios - dev.mobile.maestro-driver-iosUITests - - CommandLineArguments - - DefaultTestExecutionTimeAllowance - 600 - DependentProductPaths - - __TESTROOT__/Debug-iphonesimulator/maestro-driver-ios.app - __TESTROOT__/Debug-iphonesimulator/maestro-driver-iosUITests-Runner.app - __TESTROOT__/Debug-iphonesimulator/maestro-driver-iosUITests-Runner.app/PlugIns/maestro-driver-iosUITests.xctest - - DiagnosticCollectionPolicy - 1 - EnvironmentVariables - - OS_ACTIVITY_DT_MODE - YES - SQLITE_ENABLE_THREAD_ASSERTIONS - 1 - - IsUITestBundle - - IsXCTRunnerHostedTestBundle - - ProductModuleName - maestro_driver_iosUITests - RunOrder - 0 - SystemAttachmentLifetime - deleteOnSuccess - TestBundlePath - __TESTHOST__/PlugIns/maestro-driver-iosUITests.xctest - TestHostBundleIdentifier - dev.mobile.maestro-driver-iosUITests.xctrunner - TestHostPath - __TESTROOT__/Debug-iphonesimulator/maestro-driver-iosUITests-Runner.app - TestLanguage - - TestRegion - - TestTimeoutsEnabled - - TestingEnvironmentVariables - - DYLD_FRAMEWORK_PATH - __TESTROOT__/Debug-iphonesimulator:__TESTROOT__/Debug-iphonesimulator/PackageFrameworks:__PLATFORMS__/iPhoneSimulator.platform/Developer/Library/Frameworks - DYLD_LIBRARY_PATH - __TESTROOT__/Debug-iphonesimulator:__PLATFORMS__/iPhoneSimulator.platform/Developer/usr/lib - __XCODE_BUILT_PRODUCTS_DIR_PATHS - __TESTROOT__/Debug-iphonesimulator - __XPC_DYLD_FRAMEWORK_PATH - __TESTROOT__/Debug-iphonesimulator - __XPC_DYLD_LIBRARY_PATH - __TESTROOT__/Debug-iphonesimulator - - ToolchainsSettingValue - - UITargetAppCommandLineArguments - - UITargetAppEnvironmentVariables - - DYLD_FRAMEWORK_PATH - __TESTROOT__/Debug-iphonesimulator:__TESTROOT__/Debug-iphonesimulator/PackageFrameworks - DYLD_LIBRARY_PATH - __TESTROOT__/Debug-iphonesimulator - __XCODE_BUILT_PRODUCTS_DIR_PATHS - __TESTROOT__/Debug-iphonesimulator - __XPC_DYLD_FRAMEWORK_PATH - __TESTROOT__/Debug-iphonesimulator - __XPC_DYLD_LIBRARY_PATH - __TESTROOT__/Debug-iphonesimulator - - UITargetAppPath - __TESTROOT__/Debug-iphonesimulator/maestro-driver-ios.app - UserAttachmentLifetime - deleteOnSuccess - - - diff --git a/maestro-ios-driver/src/main/resources/maestro-driver-ios.zip b/maestro-ios-driver/src/main/resources/maestro-driver-ios.zip deleted file mode 100644 index 57efc0ff27..0000000000 Binary files a/maestro-ios-driver/src/main/resources/maestro-driver-ios.zip and /dev/null differ diff --git a/maestro-ios-driver/src/main/resources/maestro-driver-iosUITests-Runner.zip b/maestro-ios-driver/src/main/resources/maestro-driver-iosUITests-Runner.zip deleted file mode 100644 index 95d3f6f470..0000000000 Binary files a/maestro-ios-driver/src/main/resources/maestro-driver-iosUITests-Runner.zip and /dev/null differ diff --git a/maestro-ios-driver/src/main/resources/tvos/maestro-driver-config.xctestrun b/maestro-ios-driver/src/main/resources/tvos/maestro-driver-config.xctestrun new file mode 100644 index 0000000000..e86c78ef09 --- /dev/null +++ b/maestro-ios-driver/src/main/resources/tvos/maestro-driver-config.xctestrun @@ -0,0 +1,300 @@ + + + + + CodeCoverageBuildableInfos + + + Architectures + + x86_64 + + BuildableIdentifier + FlyingFox:primary + IncludeInReport + + IsStatic + + Name + FlyingFox + ProductPaths + + __TESTROOT__/Debug-appletvsimulator/PackageFrameworks/FlyingFox_-2E0323E0FD627E61_PackageProduct.framework/FlyingFox_-2E0323E0FD627E61_PackageProduct + + SourceFiles + + AsyncSequence+Extensions.swift + HTTPBodyPattern.swift + HTTPConnection.swift + HTTPDecoder.swift + HTTPEncoder.swift + HTTPHandler.swift + HTTPHeader.swift + HTTPLogging+OSLog.swift + HTTPLogging.swift + HTTPMethod.swift + HTTPRequest+QueryItem.swift + HTTPRequest.swift + HTTPResponse.swift + HTTPRoute.swift + HTTPServer+Listening.swift + HTTPServer.swift + HTTPStatusCode.swift + HTTPVersion.swift + Handlers/ClosureHTTPHandler.swift + Handlers/DirectoryHTTPHandler.swift + Handlers/FileHTTPHandler.swift + Handlers/ProxyHTTPHandler.swift + Handlers/RedirectHTTPHandler.swift + Handlers/RoutedHTTPHandler.swift + Handlers/WebSocketHTTPHandler.swift + SocketAddress+Glibc.swift + Task+Timeout.swift + URLSession+Async.swift + UncheckedSendable.swift + WebSocket/AsyncStream+WSFrame.swift + WebSocket/SHA1.swift + WebSocket/WSFrame.swift + WebSocket/WSFrameEncoder.swift + WebSocket/WSFrameValidator.swift + WebSocket/WSHandler.swift + WebSocket/WSMessage.swift + + SourceFilesCommonPathPrefix + /Users/max.phillips/Library/Developer/Xcode/DerivedData/maestro-driver-ios-fvvxconyzcmjvwfefmqamltwvirm/SourcePackages/checkouts/FlyingFox/FlyingFox/Sources/ + Toolchains + + com.apple.dt.toolchain.XcodeDefault + + + + Architectures + + x86_64 + + BuildableIdentifier + 44F995232C9D6F8800D15B50:primary + IncludeInReport + + IsStatic + + Name + maestro-driver.app + ProductPaths + + __TESTROOT__/Debug-appletvsimulator/maestro-driver.app/maestro-driver + + SourceFiles + + ContentView.swift + maestro_driverApp.swift + + SourceFilesCommonPathPrefix + /Users/max.phillips/dev/maestro-tvos/maestro-ios-xctest-runner/maestro-driver/ + Toolchains + + com.apple.dt.toolchain.XcodeDefault + + + + Architectures + + x86_64 + + BuildableIdentifier + 52049BF2293503A200807AA3:primary + IncludeInReport + + IsStatic + + Name + maestro-driverUITests.xctest + ProductPaths + + __TESTROOT__/Debug-appletvsimulator/maestro-driverUITests-Runner.app/PlugIns/maestro-driverUITests.xctest/maestro-driverUITests + + SourceFiles + + Routes/Extensions/Logger.swift + Routes/Extensions/StringExtensions.swift + Routes/Extensions/XCUIElement+Extensions.swift + Routes/Handlers/DeviceInfoHandler.swift + Routes/Handlers/EraseTextHandler.swift + Routes/Handlers/InputTextRouteHandler.swift + Routes/Handlers/KeyboardRouteHandler.swift + Routes/Handlers/PressButtonHandler.swift + Routes/Handlers/PressKeyHandler.swift + Routes/Handlers/RunningAppRouteHandler.swift + Routes/Handlers/ScreenDiffHandler.swift + Routes/Handlers/ScreenshotHandler.swift + Routes/Handlers/SetPermissionsHandler.swift + Routes/Handlers/StatusHandler.swift + Routes/Handlers/SwipeRouteHandler.swift + Routes/Handlers/SwipeRouteHandlerV2.swift + Routes/Handlers/TouchRouteHandler.swift + Routes/Handlers/ViewHierarchyHandler.swift + Routes/Helpers/AppError.swift + Routes/Helpers/ScreenSizeHelper.swift + Routes/Helpers/SystemPermissionHelper.swift + Routes/Helpers/TextInputHelper.swift + Routes/Helpers/TimeoutHelper.swift + Routes/Models/AXElement.swift + Routes/Models/DeviceInfoResponse.swift + Routes/Models/EraseTextRequest.swift + Routes/Models/GetRunningAppRequest.swift + Routes/Models/InputTextRequest.swift + Routes/Models/KeyboardHandlerRequest.swift + Routes/Models/KeyboardHandlerResponse.swift + Routes/Models/PressButtonRequest.swift + Routes/Models/PressKeyRequest.swift + Routes/Models/SetPermissionsRequest.swift + Routes/Models/StatusResponse.swift + Routes/Models/SwipeRequest.swift + Routes/Models/TouchRequest.swift + Routes/Models/ViewHierarchyRequest.swift + Routes/RouteHandlerFactory.swift + Routes/XCTest/AXClientSwizzler.swift + Routes/XCTest/EventRecord.swift + Routes/XCTest/EventTarget.swift + Routes/XCTest/KeyModifierFlags.swift + Routes/XCTest/PointerEventPath.swift + Routes/XCTest/RunnerDaemonProxy.swift + Routes/XCTest/RunningApp.swift + Routes/XCTestHTTPServer.swift + maestro_driver_iosUITests.swift + + SourceFilesCommonPathPrefix + /Users/max.phillips/dev/maestro-tvos/maestro-ios-xctest-runner/maestro-driver-iosUITests/ + Toolchains + + com.apple.dt.toolchain.XcodeDefault + + + + ContainerInfo + + ContainerName + maestro-driver-ios + SchemeName + maestro-driver + + TestConfigurations + + + Name + Test Scheme Action + TestTargets + + + BlueprintName + maestro-driverUITests + BlueprintProviderName + maestro-driver-ios + BlueprintProviderRelativePath + maestro-driver-ios.xcodeproj + BundleIdentifiersForCrashReportEmphasis + + dev.mobile.maestro-driver + dev.mobile.maestro-driverUITests + + ClangProfileDataDirectoryPath + __DERIVEDDATA__/Build/Intermediates.noindex/CodeCoverage/ProfileData + CommandLineArguments + + DefaultTestExecutionTimeAllowance + 600 + DependentProductPaths + + __TESTROOT__/Debug-appletvsimulator/maestro-driver.app + __TESTROOT__/Debug-appletvsimulator/maestro-driverUITests-Runner.app + __TESTROOT__/Debug-appletvsimulator/maestro-driverUITests-Runner.app/PlugIns/maestro-driverUITests.xctest + + DiagnosticCollectionPolicy + 1 + EnvironmentVariables + + APP_DISTRIBUTOR_ID_OVERRIDE + com.apple.AppStore + OS_ACTIVITY_DT_MODE + YES + SQLITE_ENABLE_THREAD_ASSERTIONS + 1 + TERM + dumb + + IsUITestBundle + + IsXCTRunnerHostedTestBundle + + PreferredScreenCaptureFormat + screenRecording + ProductModuleName + maestro_driverUITests + SystemAttachmentLifetime + deleteOnSuccess + TestBundlePath + __TESTHOST__/PlugIns/maestro-driverUITests.xctest + TestHostBundleIdentifier + dev.mobile.maestro-driverUITests.xctrunner + TestHostPath + __TESTROOT__/Debug-appletvsimulator/maestro-driverUITests-Runner.app + TestLanguage + + TestRegion + + TestTimeoutsEnabled + + TestingEnvironmentVariables + + DYLD_FRAMEWORK_PATH + __TESTROOT__/Debug-appletvsimulator:__TESTROOT__/Debug-appletvsimulator/PackageFrameworks:__PLATFORMS__/AppleTVSimulator.platform/Developer/Library/Frameworks + DYLD_LIBRARY_PATH + __TESTROOT__/Debug-appletvsimulator:__PLATFORMS__/AppleTVSimulator.platform/Developer/usr/lib + __XCODE_BUILT_PRODUCTS_DIR_PATHS + __TESTROOT__/Debug-appletvsimulator + __XPC_DYLD_FRAMEWORK_PATH + __TESTROOT__/Debug-appletvsimulator + __XPC_DYLD_LIBRARY_PATH + __TESTROOT__/Debug-appletvsimulator + + ToolchainsSettingValue + + UITargetAppCommandLineArguments + + UITargetAppEnvironmentVariables + + APP_DISTRIBUTOR_ID_OVERRIDE + com.apple.AppStore + DYLD_FRAMEWORK_PATH + __TESTROOT__/Debug-appletvsimulator:__TESTROOT__/Debug-appletvsimulator/PackageFrameworks + DYLD_LIBRARY_PATH + __TESTROOT__/Debug-appletvsimulator + __XCODE_BUILT_PRODUCTS_DIR_PATHS + __TESTROOT__/Debug-appletvsimulator + __XPC_DYLD_FRAMEWORK_PATH + __TESTROOT__/Debug-appletvsimulator + __XPC_DYLD_LIBRARY_PATH + __TESTROOT__/Debug-appletvsimulator + + UITargetAppPath + __TESTROOT__/Debug-appletvsimulator/maestro-driver.app + UserAttachmentLifetime + deleteOnSuccess + + + + + TestPlan + + IsDefault + + Name + maestro-driver + + __xctestrun_metadata__ + + FormatVersion + 2 + + + diff --git a/maestro-ios-driver/src/main/resources/tvos/maestro-driver.zip b/maestro-ios-driver/src/main/resources/tvos/maestro-driver.zip new file mode 100644 index 0000000000..9d9c35bd3c Binary files /dev/null and b/maestro-ios-driver/src/main/resources/tvos/maestro-driver.zip differ diff --git a/maestro-ios-driver/src/main/resources/tvos/maestro-driverUITests-Runner.zip b/maestro-ios-driver/src/main/resources/tvos/maestro-driverUITests-Runner.zip new file mode 100644 index 0000000000..3858fc7bd5 Binary files /dev/null and b/maestro-ios-driver/src/main/resources/tvos/maestro-driverUITests-Runner.zip differ diff --git a/maestro-ios-xctest-runner/build-maestro-ios-runner.sh b/maestro-ios-xctest-runner/build-maestro-ios-runner.sh index 4ef34f5617..2ecb2370a0 100755 --- a/maestro-ios-xctest-runner/build-maestro-ios-runner.sh +++ b/maestro-ios-xctest-runner/build-maestro-ios-runner.sh @@ -12,7 +12,7 @@ xcodebuild \ ARCHS="x86_64 arm64" \ ONLY_ACTIVE_ARCH=NO \ -project ./maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj \ - -scheme maestro-driver-ios \ + -scheme maestro-driver \ -sdk iphonesimulator \ -destination "generic/platform=iOS Simulator" \ -IDEBuildLocationStyle=Custom \ @@ -20,19 +20,46 @@ xcodebuild \ -IDECustomBuildProductsPath="$PWD/build/Products" \ build-for-testing +xcodebuild \ + ARCHS="x86_64 arm64" \ + ONLY_ACTIVE_ARCH=NO \ + -project ./maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj \ + -scheme maestro-driver \ + -sdk appletvsimulator \ + -destination "generic/platform=tvOS Simulator" \ + -IDEBuildLocationStyle=Custom \ + -IDECustomBuildLocationType=Absolute \ + -IDECustomBuildProductsPath="$PWD/build/Products" \ + build-for-testing + ## Remove intermediates, output and copy runner in maestro-ios-driver cp -r \ - ./build/Products/Debug-iphonesimulator/maestro-driver-iosUITests-Runner.app \ - ./maestro-ios-driver/src/main/resources/maestro-driver-iosUITests-Runner.app + ./build/Products/Debug-iphonesimulator/maestro-driverUITests-Runner.app \ + ./maestro-ios-driver/src/main/resources/ios/maestro-driverUITests-Runner.app + +cp -r \ + ./build/Products/Debug-appletvsimulator/maestro-driverUITests-Runner.app \ + ./maestro-ios-driver/src/main/resources/tvos/maestro-driverUITests-Runner.app cp -r \ - ./build/Products/Debug-iphonesimulator/maestro-driver-ios.app \ - ./maestro-ios-driver/src/main/resources/maestro-driver-ios.app + ./build/Products/Debug-iphonesimulator/maestro-driver.app \ + ./maestro-ios-driver/src/main/resources/ios/maestro-driver.app + +cp -r \ + ./build/Products/Debug-appletvsimulator/maestro-driver.app \ + ./maestro-ios-driver/src/main/resources/tvos/maestro-driver.app + +cp \ + ./build/Products/*iphonesimulator*.xctestrun \ + ./maestro-ios-driver/src/main/resources/ios/maestro-driver-config.xctestrun cp \ - ./build/Products/*.xctestrun \ - ./maestro-ios-driver/src/main/resources/maestro-driver-ios-config.xctestrun + ./build/Products/*appletvsimulator*.xctestrun \ + ./maestro-ios-driver/src/main/resources/tvos/maestro-driver-config.xctestrun -(cd ./maestro-ios-driver/src/main/resources && zip -r maestro-driver-iosUITests-Runner.zip ./maestro-driver-iosUITests-Runner.app) -(cd ./maestro-ios-driver/src/main/resources && zip -r maestro-driver-ios.zip ./maestro-driver-ios.app) -rm -r ./maestro-ios-driver/src/main/resources/*.app +(cd ./maestro-ios-driver/src/main/resources/ios && zip -r maestro-driverUITests-Runner.zip ./maestro-driverUITests-Runner.app) +(cd ./maestro-ios-driver/src/main/resources/tvos && zip -r maestro-driverUITests-Runner.zip ./maestro-driverUITests-Runner.app) +(cd ./maestro-ios-driver/src/main/resources/ios && zip -r maestro-driver.zip ./maestro-driver.app) +(cd ./maestro-ios-driver/src/main/resources/tvos && zip -r maestro-driver.zip ./maestro-driver.app) +rm -r ./maestro-ios-driver/src/main/resources/ios/*.app +rm -r ./maestro-ios-driver/src/main/resources/tvos/*.app diff --git a/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/project.pbxproj b/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/project.pbxproj index 8096a1a12d..55fc1df878 100644 --- a/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/project.pbxproj +++ b/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 55; + objectVersion = 70; objects = { /* Begin PBXBuildFile section */ @@ -14,12 +14,6 @@ 32ECCB262980449200A1A0A0 /* TouchRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32ECCB252980449200A1A0A0 /* TouchRequest.swift */; }; 32ECCB28298044C200A1A0A0 /* TouchRouteHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32ECCB27298044C200A1A0A0 /* TouchRouteHandler.swift */; }; 52047F782A7A638E00BF982D /* StatusHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52047F772A7A638E00BF982D /* StatusHandler.swift */; }; - 52049BD72935039F00807AA3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52049BD62935039F00807AA3 /* AppDelegate.swift */; }; - 52049BD92935039F00807AA3 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52049BD82935039F00807AA3 /* SceneDelegate.swift */; }; - 52049BDB2935039F00807AA3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52049BDA2935039F00807AA3 /* ViewController.swift */; }; - 52049BDE2935039F00807AA3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 52049BDC2935039F00807AA3 /* Main.storyboard */; }; - 52049BE0293503A200807AA3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 52049BDF293503A200807AA3 /* Assets.xcassets */; }; - 52049BE3293503A200807AA3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 52049BE1293503A200807AA3 /* LaunchScreen.storyboard */; }; 52049BF8293503A200807AA3 /* maestro_driver_iosUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52049BF7293503A200807AA3 /* maestro_driver_iosUITests.swift */; }; 522785812A54410D008DBC0A /* AppError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522785802A54410D008DBC0A /* AppError.swift */; }; 5279BFD62935ECE20056C609 /* FlyingFox in Frameworks */ = {isa = PBXBuildFile; productRef = 5279BFD52935ECE20056C609 /* FlyingFox */; }; @@ -65,12 +59,12 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 52049BF4293503A200807AA3 /* PBXContainerItemProxy */ = { + 44F995322C9D6FB500D15B50 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 52049BCB2935039F00807AA3 /* Project object */; proxyType = 1; - remoteGlobalIDString = 52049BD22935039F00807AA3; - remoteInfo = "maestro-driver-ios"; + remoteGlobalIDString = 44F995232C9D6F8800D15B50; + remoteInfo = "maestro-driver"; }; /* End PBXContainerItemProxy section */ @@ -81,16 +75,9 @@ 32762AF92966DC8300FB69BD /* SwipeRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwipeRequest.swift; sourceTree = ""; }; 32ECCB252980449200A1A0A0 /* TouchRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchRequest.swift; sourceTree = ""; }; 32ECCB27298044C200A1A0A0 /* TouchRouteHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchRouteHandler.swift; sourceTree = ""; }; + 44F995242C9D6F8800D15B50 /* maestro-driver.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "maestro-driver.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 52047F772A7A638E00BF982D /* StatusHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusHandler.swift; sourceTree = ""; }; - 52049BD32935039F00807AA3 /* maestro-driver-ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "maestro-driver-ios.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 52049BD62935039F00807AA3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 52049BD82935039F00807AA3 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - 52049BDA2935039F00807AA3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 52049BDD2935039F00807AA3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 52049BDF293503A200807AA3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 52049BE2293503A200807AA3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 52049BE4293503A200807AA3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 52049BF3293503A200807AA3 /* maestro-driver-iosUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "maestro-driver-iosUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 52049BF3293503A200807AA3 /* maestro-driverUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "maestro-driverUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 52049BF7293503A200807AA3 /* maestro_driver_iosUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = maestro_driver_iosUITests.swift; sourceTree = ""; }; 522785802A54410D008DBC0A /* AppError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppError.swift; sourceTree = ""; }; 52E35D422A654F67001D97A8 /* RunningApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunningApp.swift; sourceTree = ""; }; @@ -134,8 +121,12 @@ F328D3E52A2A98E7000546D3 /* StringExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringExtensions.swift; sourceTree = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 44F995252C9D6F8800D15B50 /* maestro-driver */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = "maestro-driver"; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ - 52049BD02935039F00807AA3 /* Frameworks */ = { + 44F995212C9D6F8800D15B50 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -157,8 +148,8 @@ 52049BCA2935039F00807AA3 = { isa = PBXGroup; children = ( - 52049BD52935039F00807AA3 /* maestro-driver-ios */, 52049BF6293503A200807AA3 /* maestro-driver-iosUITests */, + 44F995252C9D6F8800D15B50 /* maestro-driver */, 52049BD42935039F00807AA3 /* Products */, 5279BFD42935ECE20056C609 /* Frameworks */, ); @@ -167,26 +158,12 @@ 52049BD42935039F00807AA3 /* Products */ = { isa = PBXGroup; children = ( - 52049BD32935039F00807AA3 /* maestro-driver-ios.app */, - 52049BF3293503A200807AA3 /* maestro-driver-iosUITests.xctest */, + 52049BF3293503A200807AA3 /* maestro-driverUITests.xctest */, + 44F995242C9D6F8800D15B50 /* maestro-driver.app */, ); name = Products; sourceTree = ""; }; - 52049BD52935039F00807AA3 /* maestro-driver-ios */ = { - isa = PBXGroup; - children = ( - 52049BD62935039F00807AA3 /* AppDelegate.swift */, - 52049BD82935039F00807AA3 /* SceneDelegate.swift */, - 52049BDA2935039F00807AA3 /* ViewController.swift */, - 52049BDC2935039F00807AA3 /* Main.storyboard */, - 52049BDF293503A200807AA3 /* Assets.xcassets */, - 52049BE1293503A200807AA3 /* LaunchScreen.storyboard */, - 52049BE4293503A200807AA3 /* Info.plist */, - ); - path = "maestro-driver-ios"; - sourceTree = ""; - }; 52049BF6293503A200807AA3 /* maestro-driver-iosUITests */ = { isa = PBXGroup; children = ( @@ -300,28 +277,31 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 52049BD22935039F00807AA3 /* maestro-driver-ios */ = { + 44F995232C9D6F8800D15B50 /* maestro-driver */ = { isa = PBXNativeTarget; - buildConfigurationList = 52049BFD293503A200807AA3 /* Build configuration list for PBXNativeTarget "maestro-driver-ios" */; + buildConfigurationList = 44F995312C9D6F8900D15B50 /* Build configuration list for PBXNativeTarget "maestro-driver" */; buildPhases = ( - 52049BCF2935039F00807AA3 /* Sources */, - 52049BD02935039F00807AA3 /* Frameworks */, - 52049BD12935039F00807AA3 /* Resources */, + 44F995202C9D6F8800D15B50 /* Sources */, + 44F995212C9D6F8800D15B50 /* Frameworks */, + 44F995222C9D6F8800D15B50 /* Resources */, ); buildRules = ( ); dependencies = ( ); - name = "maestro-driver-ios"; + fileSystemSynchronizedGroups = ( + 44F995252C9D6F8800D15B50 /* maestro-driver */, + ); + name = "maestro-driver"; packageProductDependencies = ( ); - productName = "maestro-driver-ios"; - productReference = 52049BD32935039F00807AA3 /* maestro-driver-ios.app */; + productName = "maestro-driver"; + productReference = 44F995242C9D6F8800D15B50 /* maestro-driver.app */; productType = "com.apple.product-type.application"; }; - 52049BF2293503A200807AA3 /* maestro-driver-iosUITests */ = { + 52049BF2293503A200807AA3 /* maestro-driverUITests */ = { isa = PBXNativeTarget; - buildConfigurationList = 52049C03293503A200807AA3 /* Build configuration list for PBXNativeTarget "maestro-driver-iosUITests" */; + buildConfigurationList = 52049C03293503A200807AA3 /* Build configuration list for PBXNativeTarget "maestro-driverUITests" */; buildPhases = ( 52049BEF293503A200807AA3 /* Sources */, 52049BF0293503A200807AA3 /* Frameworks */, @@ -330,14 +310,14 @@ buildRules = ( ); dependencies = ( - 52049BF5293503A200807AA3 /* PBXTargetDependency */, + 44F995332C9D6FB500D15B50 /* PBXTargetDependency */, ); - name = "maestro-driver-iosUITests"; + name = "maestro-driverUITests"; packageProductDependencies = ( 5279BFD52935ECE20056C609 /* FlyingFox */, ); productName = "maestro-driver-iosUITests"; - productReference = 52049BF3293503A200807AA3 /* maestro-driver-iosUITests.xctest */; + productReference = 52049BF3293503A200807AA3 /* maestro-driverUITests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; /* End PBXNativeTarget section */ @@ -347,16 +327,16 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1340; + LastSwiftUpdateCheck = 1600; LastUpgradeCheck = 1340; TargetAttributes = { - 52049BD22935039F00807AA3 = { - CreatedOnToolsVersion = 13.4.1; + 44F995232C9D6F8800D15B50 = { + CreatedOnToolsVersion = 16.0; }; 52049BF2293503A200807AA3 = { CreatedOnToolsVersion = 13.4.1; LastSwiftMigration = 1430; - TestTargetID = 52049BD22935039F00807AA3; + TestTargetID = 44F995232C9D6F8800D15B50; }; }; }; @@ -376,20 +356,17 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 52049BD22935039F00807AA3 /* maestro-driver-ios */, - 52049BF2293503A200807AA3 /* maestro-driver-iosUITests */, + 44F995232C9D6F8800D15B50 /* maestro-driver */, + 52049BF2293503A200807AA3 /* maestro-driverUITests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 52049BD12935039F00807AA3 /* Resources */ = { + 44F995222C9D6F8800D15B50 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 52049BE3293503A200807AA3 /* LaunchScreen.storyboard in Resources */, - 52049BE0293503A200807AA3 /* Assets.xcassets in Resources */, - 52049BDE2935039F00807AA3 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -403,13 +380,10 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 52049BCF2935039F00807AA3 /* Sources */ = { + 44F995202C9D6F8800D15B50 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 52049BDB2935039F00807AA3 /* ViewController.swift in Sources */, - 52049BD72935039F00807AA3 /* AppDelegate.swift in Sources */, - 52049BD92935039F00807AA3 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -470,33 +444,87 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 52049BF5293503A200807AA3 /* PBXTargetDependency */ = { + 44F995332C9D6FB500D15B50 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 52049BD22935039F00807AA3 /* maestro-driver-ios */; - targetProxy = 52049BF4293503A200807AA3 /* PBXContainerItemProxy */; + target = 44F995232C9D6F8800D15B50 /* maestro-driver */; + targetProxy = 44F995322C9D6FB500D15B50 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ -/* Begin PBXVariantGroup section */ - 52049BDC2935039F00807AA3 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 52049BDD2935039F00807AA3 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; +/* Begin XCBuildConfiguration section */ + 44F9952F2C9D6F8900D15B50 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"maestro-driver/Preview Content\""; + ENABLE_PREVIEWS = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "dev.mobile.maestro-driver"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3"; + }; + name = Debug; }; - 52049BE1293503A200807AA3 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 52049BE2293503A200807AA3 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; + 44F995302C9D6F8900D15B50 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"maestro-driver/Preview Content\""; + ENABLE_PREVIEWS = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "dev.mobile.maestro-driver"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3"; + }; + name = Release; }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ 52049BFB293503A200807AA3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -610,64 +638,6 @@ }; name = Release; }; - 52049BFE293503A200807AA3 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = "maestro-driver-ios/Info.plist"; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "dev.mobile.maestro-driver-ios"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 52049BFF293503A200807AA3 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = "maestro-driver-ios/Info.plist"; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "dev.mobile.maestro-driver-ios"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; 52049C04293503A200807AA3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -675,7 +645,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2P56S3D7L7; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -683,14 +653,17 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "dev.mobile.maestro-driver-iosUITests"; + PRODUCT_BUNDLE_IDENTIFIER = "dev.mobile.maestro-driverUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = "maestro-driver-ios"; + TARGETED_DEVICE_FAMILY = "1,2,3"; + TEST_TARGET_NAME = "maestro-driver"; + TVOS_DEPLOYMENT_TARGET = 14.0; }; name = Debug; }; @@ -701,7 +674,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 2P56S3D7L7; + DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -709,38 +682,41 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "dev.mobile.maestro-driver-iosUITests"; + PRODUCT_BUNDLE_IDENTIFIER = "dev.mobile.maestro-driverUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = "maestro-driver-ios"; + TARGETED_DEVICE_FAMILY = "1,2,3"; + TEST_TARGET_NAME = "maestro-driver"; + TVOS_DEPLOYMENT_TARGET = 14.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 52049BCE2935039F00807AA3 /* Build configuration list for PBXProject "maestro-driver-ios" */ = { + 44F995312C9D6F8900D15B50 /* Build configuration list for PBXNativeTarget "maestro-driver" */ = { isa = XCConfigurationList; buildConfigurations = ( - 52049BFB293503A200807AA3 /* Debug */, - 52049BFC293503A200807AA3 /* Release */, + 44F9952F2C9D6F8900D15B50 /* Debug */, + 44F995302C9D6F8900D15B50 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 52049BFD293503A200807AA3 /* Build configuration list for PBXNativeTarget "maestro-driver-ios" */ = { + 52049BCE2935039F00807AA3 /* Build configuration list for PBXProject "maestro-driver-ios" */ = { isa = XCConfigurationList; buildConfigurations = ( - 52049BFE293503A200807AA3 /* Debug */, - 52049BFF293503A200807AA3 /* Release */, + 52049BFB293503A200807AA3 /* Debug */, + 52049BFC293503A200807AA3 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 52049C03293503A200807AA3 /* Build configuration list for PBXNativeTarget "maestro-driver-iosUITests" */ = { + 52049C03293503A200807AA3 /* Build configuration list for PBXNativeTarget "maestro-driverUITests" */ = { isa = XCConfigurationList; buildConfigurations = ( 52049C04293503A200807AA3 /* Debug */, diff --git a/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/xcshareddata/xcschemes/maestro-driver-ios.xcscheme b/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/xcshareddata/xcschemes/maestro-driver.xcscheme similarity index 68% rename from maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/xcshareddata/xcschemes/maestro-driver-ios.xcscheme rename to maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/xcshareddata/xcschemes/maestro-driver.xcscheme index 7a62ee81d2..a1555be14c 100644 --- a/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/xcshareddata/xcschemes/maestro-driver-ios.xcscheme +++ b/maestro-ios-xctest-runner/maestro-driver-ios.xcodeproj/xcshareddata/xcschemes/maestro-driver.xcscheme @@ -1,10 +1,11 @@ + LastUpgradeVersion = "1600" + version = "1.7"> + buildImplicitDependencies = "YES" + buildArchitectures = "Automatic"> @@ -26,25 +27,16 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES" + shouldAutocreateTestPlan = "YES"> - - - - @@ -64,9 +56,9 @@ runnableDebuggingMode = "0"> @@ -81,9 +73,9 @@ runnableDebuggingMode = "0"> diff --git a/maestro-ios-xctest-runner/maestro-driver-ios/AppDelegate.swift b/maestro-ios-xctest-runner/maestro-driver-ios/AppDelegate.swift deleted file mode 100644 index ec3762c48a..0000000000 --- a/maestro-ios-xctest-runner/maestro-driver-ios/AppDelegate.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// AppDelegate.swift -// maestro-driver-ios -// -// -// - -import UIKit - -@main -class AppDelegate: UIResponder, UIApplicationDelegate { - - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - // MARK: UISceneSession Lifecycle - - func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) - } - - func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. - } - - -} - diff --git a/maestro-ios-xctest-runner/maestro-driver-ios/Assets.xcassets/AppIcon.appiconset/Contents.json b/maestro-ios-xctest-runner/maestro-driver-ios/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 5a3257a7d0..0000000000 --- a/maestro-ios-xctest-runner/maestro-driver-ios/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/maestro-ios-xctest-runner/maestro-driver-ios/Base.lproj/LaunchScreen.storyboard b/maestro-ios-xctest-runner/maestro-driver-ios/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e9329f3..0000000000 --- a/maestro-ios-xctest-runner/maestro-driver-ios/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/maestro-ios-xctest-runner/maestro-driver-ios/Base.lproj/Main.storyboard b/maestro-ios-xctest-runner/maestro-driver-ios/Base.lproj/Main.storyboard deleted file mode 100644 index 25a763858e..0000000000 --- a/maestro-ios-xctest-runner/maestro-driver-ios/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/maestro-ios-xctest-runner/maestro-driver-ios/Info.plist b/maestro-ios-xctest-runner/maestro-driver-ios/Info.plist deleted file mode 100644 index dd3c9afdae..0000000000 --- a/maestro-ios-xctest-runner/maestro-driver-ios/Info.plist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main - - - - - - diff --git a/maestro-ios-xctest-runner/maestro-driver-ios/SceneDelegate.swift b/maestro-ios-xctest-runner/maestro-driver-ios/SceneDelegate.swift deleted file mode 100644 index 1ebc053ed6..0000000000 --- a/maestro-ios-xctest-runner/maestro-driver-ios/SceneDelegate.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// SceneDelegate.swift -// maestro-driver-ios -// -// -// - -import UIKit - -class SceneDelegate: UIResponder, UIWindowSceneDelegate { - - var window: UIWindow? - - - func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). - guard let _ = (scene as? UIWindowScene) else { return } - } - - func sceneDidDisconnect(_ scene: UIScene) { - // Called as the scene is being released by the system. - // This occurs shortly after the scene enters the background, or when its session is discarded. - // Release any resources associated with this scene that can be re-created the next time the scene connects. - // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). - } - - func sceneDidBecomeActive(_ scene: UIScene) { - // Called when the scene has moved from an inactive state to an active state. - // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. - } - - func sceneWillResignActive(_ scene: UIScene) { - // Called when the scene will move from an active state to an inactive state. - // This may occur due to temporary interruptions (ex. an incoming phone call). - } - - func sceneWillEnterForeground(_ scene: UIScene) { - // Called as the scene transitions from the background to the foreground. - // Use this method to undo the changes made on entering the background. - } - - func sceneDidEnterBackground(_ scene: UIScene) { - // Called as the scene transitions from the foreground to the background. - // Use this method to save data, release shared resources, and store enough scene-specific state information - // to restore the scene back to its current state. - } - - -} - diff --git a/maestro-ios-xctest-runner/maestro-driver-ios/ViewController.swift b/maestro-ios-xctest-runner/maestro-driver-ios/ViewController.swift deleted file mode 100644 index 5cfbe4d192..0000000000 --- a/maestro-ios-xctest-runner/maestro-driver-ios/ViewController.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ViewController.swift -// maestro-driver-ios -// -// -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view. - } - - -} - diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Extensions/XCUIElement+Extensions.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Extensions/XCUIElement+Extensions.swift index 5512cd0f4a..81b05aafae 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Extensions/XCUIElement+Extensions.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Extensions/XCUIElement+Extensions.swift @@ -3,8 +3,11 @@ import XCTest extension XCUIElement { func setText(text: String, application: XCUIApplication) { + // TODO: Does this require a tvOS implementation? + #if !os(tvOS) UIPasteboard.general.string = text doubleTap() application.menuItems["Paste"].tap() + #endif } } diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/PressButtonHandler.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/PressButtonHandler.swift index 1732aa0ddf..96da7a34db 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/PressButtonHandler.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/PressButtonHandler.swift @@ -17,10 +17,35 @@ struct PressButtonHandler: HTTPHandler { } switch requestBody.button { - case .home: - XCUIDevice.shared.press(.home) - case .lock: - XCUIDevice.shared.perform(NSSelectorFromString("pressLockButton")) + #if !os(tvOS) + case .home: + XCUIDevice.shared.press(.home) + case .lock: + XCUIDevice.shared.perform(NSSelectorFromString("pressLockButton")) + #else + case .volumeUp: + if #available(tvOS 14.3, *) { + XCUIRemote.shared.press(XCUIRemote.Button.pageUp) + } + case .volumeDown: + if #available(tvOS 14.3, *) { + XCUIRemote.shared.press(XCUIRemote.Button.pageDown) + } + case .remoteDpadUp: + XCUIRemote.shared.press(XCUIRemote.Button.up) + case .remoteDpadDown: + XCUIRemote.shared.press(XCUIRemote.Button.down) + case .remoteDpadLeft: + XCUIRemote.shared.press(XCUIRemote.Button.left) + case .remoteDpadRight: + XCUIRemote.shared.press(XCUIRemote.Button.right) + case .remoteDpadCenter: + XCUIRemote.shared.press(XCUIRemote.Button.select) + case .remoteMediaPlayPause: + XCUIRemote.shared.press(XCUIRemote.Button.playPause) + case .RemoteMenu: + XCUIRemote.shared.press(XCUIRemote.Button.menu) + #endif } return HTTPResponse(statusCode: .ok) } diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/RunningAppRouteHandler.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/RunningAppRouteHandler.swift index 6352c59ffa..6d1ad60518 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/RunningAppRouteHandler.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/RunningAppRouteHandler.swift @@ -9,8 +9,12 @@ struct RunningAppRouteHandler: HTTPHandler { category: String(describing: Self.self) ) - private static let springboardBundleId = "com.apple.springboard" - + #if os(tvOS) + private static let homescreenBundleId = "com.apple.HeadBoard" + #else + private static let homescreenBundleId = "com.apple.springboard" + #endif + func handleRequest(_ request: FlyingFox.HTTPRequest) async throws -> FlyingFox.HTTPResponse { guard let requestBody = try? JSONDecoder().decode(RunningAppRequest.self, from: request.body) else { return AppError(type: .precondition, message: "incorrect request body for getting running app id request").httpResponse @@ -23,7 +27,7 @@ struct RunningAppRouteHandler: HTTPHandler { return app.state == .runningForeground } - let response = ["runningAppBundleId": runningAppId ?? RunningAppRouteHandler.springboardBundleId] + let response = ["runningAppBundleId": runningAppId ?? RunningAppRouteHandler.homescreenBundleId] let responseData = try JSONSerialization.data( withJSONObject: response, diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/StatusHandler.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/StatusHandler.swift index 3a1f91099e..478e437df1 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/StatusHandler.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/StatusHandler.swift @@ -5,7 +5,11 @@ import os @MainActor struct StatusHandler: HTTPHandler { - private static let springboardBundleId = "com.apple.springboard" + #if os(tvOS) + private static let homescreenBundleId = "com.apple.HeadBoard" + #else + private static let homescreenBundleId = "com.apple.springboard" + #endif private let logger = Logger( subsystem: Bundle.main.bundleIdentifier!, diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/ViewHierarchyHandler.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/ViewHierarchyHandler.swift index 6f12591025..43ffc61312 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/ViewHierarchyHandler.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/ViewHierarchyHandler.swift @@ -5,8 +5,12 @@ import os @MainActor struct ViewHierarchyHandler: HTTPHandler { - private static let springboardBundleId = "com.apple.springboard" - private let springboardApplication = XCUIApplication(bundleIdentifier: Self.springboardBundleId) + #if os(tvOS) + private static let homescreenBundleId = "com.apple.HeadBoard" + #else + private static let homescreenBundleId = "com.apple.springboard" + #endif + private let springboardApplication = XCUIApplication(bundleIdentifier: Self.homescreenBundleId) private let snapshotMaxDepth = 60 private let logger = Logger( diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Helpers/ScreenSizeHelper.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Helpers/ScreenSizeHelper.swift index 7d4c2c68b6..f4c8c9ce6d 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Helpers/ScreenSizeHelper.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Helpers/ScreenSizeHelper.swift @@ -1,26 +1,46 @@ import XCTest +// UIKit doesn't include UIDeviceOrientation on tvOS +public enum DeviceOrientation: Int, @unchecked Sendable { + case unknown = 0 + case portrait = 1 // Device oriented vertically, home button on the bottom + case portraitUpsideDown = 2 // Device oriented vertically, home button on the top + case landscapeLeft = 3 // Device oriented horizontally, home button on the right + case landscapeRight = 4 // Device oriented horizontally, home button on the left + case faceUp = 5 // Device oriented flat, face up + case faceDown = 6 // Device oriented flat, face down +} + struct ScreenSizeHelper { static func physicalScreenSize() -> (Float, Float) { - let springboardBundleId = "com.apple.springboard" - let springboardApp = XCUIApplication(bundleIdentifier: springboardBundleId) + #if os(tvOS) + let homescreenBundleId = "com.apple.PineBoard" + #else + let homescreenBundleId = "com.apple.springboard" + #endif + let springboardApp = XCUIApplication(bundleIdentifier: homescreenBundleId) let screenSize = springboardApp.frame.size return (Float(screenSize.width), Float(screenSize.height)) } - private static func actualOrientation() -> UIDeviceOrientation { - let orientation = XCUIDevice.shared.orientation - if orientation == .unknown { + private static func actualOrientation() -> DeviceOrientation { + #if os(tvOS) + // Please don't rotate your AppleTV... + let orientation = Optional(DeviceOrientation.unknown) + #else + let orientation = DeviceOrientation(rawValue: XCUIDevice.shared.orientation.rawValue) + #endif + + guard let unwrappedOrientation = orientation, orientation != .unknown else { // If orientation is "unknown", we assume it is "portrait" to // work around https://stackoverflow.com/q/78932288/7009800 - return UIDeviceOrientation.portrait + return DeviceOrientation.portrait } - - return orientation + return unwrappedOrientation } /// Takes device orientation into account. - static func actualScreenSize() throws -> (Float, Float, UIDeviceOrientation) { + static func actualScreenSize() throws -> (Float, Float, DeviceOrientation) { let orientation = actualOrientation() let (width, height) = physicalScreenSize() diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Helpers/SystemPermissionHelper.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Helpers/SystemPermissionHelper.swift index 82d68d44df..06302e0351 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Helpers/SystemPermissionHelper.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Helpers/SystemPermissionHelper.swift @@ -18,12 +18,17 @@ final class SystemPermissionHelper { case .allow: let allowButton = alert.buttons.element(boundBy: 1) if allowButton.exists { + // TODO: Add a proper shim for tvOS + #if !os(tvOS) allowButton.tap() + #endif } case .deny: let dontAllowButton = alert.buttons.element(boundBy: 0) if dontAllowButton.exists { + #if !os(tvOS) dontAllowButton.tap() + #endif } case .unset, .unknown: // do nothing diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Models/PressButtonRequest.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Models/PressButtonRequest.swift index ce21609764..5144d24b6e 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Models/PressButtonRequest.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Models/PressButtonRequest.swift @@ -4,8 +4,34 @@ import XCTest struct PressButtonRequest: Codable { enum Button: String, Codable { - case home - case lock + #if !os(tvOS) + case home = "Home" + case lock = "Lock" + #else + case volumeUp = "Volume Up" + case volumeDown = "Volume Down" + case remoteDpadUp = "Remote Dpad Up" + case remoteDpadDown = "Remote Dpad Down" + case remoteDpadLeft = "Remote Dpad Left" + case remoteDpadRight = "Remote Dpad Right" + case remoteDpadCenter = "Remote Dpad Center" + case remoteMediaPlayPause = "Remote Media Play Pause" + /** + case remoteMediaNext = "Remote Media Next" + case remoteMediaPrevious = "Remote Media Previous" + case remoteMediaRewind = "Remote Media Rewind" + case remoteMediaFastForward = "Remote Media Fast Forward" + case RemoteSystemNavigationUp = "Remote System Navigation Up" + case RemoteSystemNavigationDown = "Remote System Navigation Down" + **/ + case RemoteMenu = "Remote Menu" + /** + case tvInput = "TV Input" + case tvInputHDMIOne = "TV Input HDMI 1" + case tvInputHDMITwo = "TV Input HDMI 2" + case tvInputHDMIThree = "TV Input HDMI 3" + **/ + #endif } let button: Button diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTest/EventRecord.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTest/EventRecord.swift index b7437395ea..e34b61df48 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTest/EventRecord.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTest/EventRecord.swift @@ -7,11 +7,11 @@ final class EventRecord: NSObject { static let defaultTapDuration = 0.1 enum Style: String { - case singeFinger = "Single-Finger Touch Action" + case singleFinger = "Single-Finger Touch Action" case multiFinger = "Multi-Finger Touch Action" } - init(orientation: UIInterfaceOrientation, style: Style = .singeFinger) { + init(orientation: DeviceOrientation, style: Style = .singleFinger) { eventRecord = objc_lookUpClass("XCSynthesizedEventRecord")?.alloc() .perform( NSSelectorFromString("initWithName:interfaceOrientation:"), diff --git a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTest/RunningApp.swift b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTest/RunningApp.swift index 75d068dbf0..5e9868c46b 100644 --- a/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTest/RunningApp.swift +++ b/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/XCTest/RunningApp.swift @@ -4,7 +4,11 @@ import os struct RunningApp { - private static let springboardBundleId = "com.apple.springboard" + #if os(tvOS) + private static let homescreenBundleId = "com.apple.HeadBoard" + #else + private static let homescreenBundleId = "com.apple.springboard" + #endif private static let logger = Logger( subsystem: Bundle.main.bundleIdentifier!, category: String(describing: Self.self) @@ -21,7 +25,7 @@ struct RunningApp { let app = XCUIApplication(bundleIdentifier: appId) return app.state == .runningForeground - } ?? RunningApp.springboardBundleId + } ?? RunningApp.homescreenBundleId } diff --git a/maestro-ios-xctest-runner/maestro-driver-ios/Assets.xcassets/AccentColor.colorset/Contents.json b/maestro-ios-xctest-runner/maestro-driver/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from maestro-ios-xctest-runner/maestro-driver-ios/Assets.xcassets/AccentColor.colorset/Contents.json rename to maestro-ios-xctest-runner/maestro-driver/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/maestro-ios-xctest-runner/maestro-driver/Assets.xcassets/AppIcon.appiconset/Contents.json b/maestro-ios-xctest-runner/maestro-driver/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..2305880107 --- /dev/null +++ b/maestro-ios-xctest-runner/maestro-driver/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/maestro-ios-xctest-runner/maestro-driver-ios/Assets.xcassets/Contents.json b/maestro-ios-xctest-runner/maestro-driver/Assets.xcassets/Contents.json similarity index 100% rename from maestro-ios-xctest-runner/maestro-driver-ios/Assets.xcassets/Contents.json rename to maestro-ios-xctest-runner/maestro-driver/Assets.xcassets/Contents.json diff --git a/maestro-ios-xctest-runner/maestro-driver/ContentView.swift b/maestro-ios-xctest-runner/maestro-driver/ContentView.swift new file mode 100644 index 0000000000..12e7117737 --- /dev/null +++ b/maestro-ios-xctest-runner/maestro-driver/ContentView.swift @@ -0,0 +1,24 @@ +// +// ContentView.swift +// maestro-driver +// +// Created by Max Phillips on 20/9/2024. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + VStack { + Image(systemName: "globe") + .imageScale(.large) + .foregroundStyle(.tint) + Text("Hello, world!") + } + .padding() + } +} + +#Preview { + ContentView() +} diff --git a/maestro-ios-xctest-runner/maestro-driver/Preview Content/Preview Assets.xcassets/Contents.json b/maestro-ios-xctest-runner/maestro-driver/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000000..73c00596a7 --- /dev/null +++ b/maestro-ios-xctest-runner/maestro-driver/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/maestro-ios-xctest-runner/maestro-driver/maestro_driverApp.swift b/maestro-ios-xctest-runner/maestro-driver/maestro_driverApp.swift new file mode 100644 index 0000000000..5f0f81c593 --- /dev/null +++ b/maestro-ios-xctest-runner/maestro-driver/maestro_driverApp.swift @@ -0,0 +1,17 @@ +// +// maestro_driverApp.swift +// maestro-driver +// +// Created by Max Phillips on 20/9/2024. +// + +import SwiftUI + +@main +struct maestro_driverApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +}