-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix iOS landscape mode #1809
Fix iOS landscape mode #1809
Conversation
I think I got it working: demorec.mp4Current limitations:
|
Another approach idea: instead of mapping input coordinates (e.g in tapOn), let's map output coordinates when querying the view hierarchy. This will probably work better with Maestro Studio. |
maestro-ios-driver/src/main/resources/maestro-driver-ios-config.xctestrun
Outdated
Show resolved
Hide resolved
...unner/maestro-driver-ios.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Outdated
Show resolved
Hide resolved
case .portrait: (requestBody.x, requestBody.y) | ||
case .landscapeLeft: (width - requestBody.y, requestBody.x) | ||
case .landscapeRight: (requestBody.y, height - requestBody.x) | ||
default: fatalError("Not implemented yet") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm honeslty not sure what's the right indentation here, I haven't been writing much Swift recently.
I created #1827 to make this situation better in the future:)
maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Helpers/ScreenSizeHelper.swift
Show resolved
Hide resolved
What do you think about following?
|
I believe it unblocks ~80% of the users who complained about landscape mode.
That's right, Android landscape has always worked.
I consider this a quick-fix to unblock some people, who run tests locally. AFAIK Maestro Cloud doesn't allow for handling orientation changes. Maestro doesn't have a command for that as well (see #1221).
I agree, yes! Sum upAfter this PR gets merged, there will be still 3 problems:
But I believe this PR gets us the most value for now. |
Last night I was trying out this approach, but it failed. Yet another idea: maestro/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/TouchRouteHandler.swift Line 26 in 1f7bbaa
Maybe it's enough to just pass the current orientation there? |
Sure you can check if it works. Btw heads up this is a private API so you have to check if its even available as an option. |
I'm not sure if we discussed this. This could also be something we do in separate PR: Right now maestro start-device doesn't,t support start device by default in landscape. I'm not even sure if that's possible. But it would be good if user also has an option to pass orientation while starting device. What do you think? |
I did, but it doesn't work (admittedly though I didn't try very hard). Here's the result of that small investigation (and here is what didn't work)
That's right, I made a separate issue for this: #1833 |
doesn't work on iPad |
@chiefchief Can you tell more? Did you build Maestro yourself locally? This is not yet released. |
as i understand, after the merge of this PR, new version was released, then i ran the command curl -Ls "https://get.maestro.mobile.dev" | bash which install maestro from the latest release |
So this is expected. New version (1.37.7) was released before this PR was merged. |
Got it, thank you, i'll check once new version will be released |
This reverts commit ac0bb66.
This reverts commit ac0bb66.
Proposed changes
Aims to fix #565 by mapping coordinates according to current simulator orientation.
Testing
Tested locally.
I would like to have automated tests as well, but not sure yet how to go about it.