-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit 096a1d4.
- Loading branch information
1 parent
3ce9bdb
commit 8f2a2d6
Showing
11 changed files
with
93 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-305 Bytes
(100%)
maestro-ios-driver/src/main/resources/maestro-driver-ios.zip
Binary file not shown.
Binary file modified
BIN
+19.1 KB
(100%)
maestro-ios-driver/src/main/resources/maestro-driver-iosUITests-Runner.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Helpers/ScreenSizeHelper.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import XCTest | ||
|
||
struct ScreenSizeHelper { | ||
static func physicalScreenSize() -> (Float, Float) { | ||
let springboardBundleId = "com.apple.springboard" | ||
let springboardApp = XCUIApplication(bundleIdentifier: springboardBundleId) | ||
let screenSize = springboardApp.frame.size | ||
return (Float(screenSize.width), Float(screenSize.height)) | ||
} | ||
|
||
/// Takes device orientation into account. | ||
static func actualScreenSize() -> (Float, Float) { | ||
let orientation = XCUIDevice.shared.orientation | ||
|
||
let (width, height) = physicalScreenSize() | ||
let (actualWidth, actualHeight) = switch (orientation) { | ||
case .portrait, .portraitUpsideDown: (width, height) | ||
case .landscapeLeft, .landscapeRight: (height, width) | ||
case .faceDown, .faceUp, .unknown: fatalError("Unsupported orientation: \(orientation)") | ||
@unknown default: fatalError("Unsupported orientation: \(orientation)") | ||
} | ||
|
||
return (actualWidth, actualHeight) | ||
} | ||
|
||
static func orientationAwarePoint(width: Float, height: Float, point: CGPoint) -> CGPoint { | ||
let orientation = XCUIDevice.shared.orientation | ||
|
||
return switch (orientation) { | ||
case .portrait: point | ||
case .landscapeLeft: CGPoint(x: CGFloat(width) - point.y, y: CGFloat(point.x)) | ||
case .landscapeRight: CGPoint(x: CGFloat(point.y), y: CGFloat(height) - point.x) | ||
default: fatalError("Not implemented yet") | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
maestro-ios-xctest-runner/maestro-driver-iosUITests/maestro_driver_iosUITests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters