Skip to content

Conversation

@KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented May 2, 2025

iOS hasn't been handled properly yet

Closes #793

@KazuCocoa KazuCocoa changed the title fix: handle orientation command properly fix: handle orientation command properly for ios May 2, 2025
@KazuCocoa KazuCocoa merged commit 6b199cf into main May 2, 2025
11 of 12 checks passed
@KazuCocoa KazuCocoa deleted the orientation branch May 2, 2025 15:48
@KazuCocoa KazuCocoa requested a review from Copilot May 3, 2025 16:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the orientation handling for iOS by adding explicit orientation commands in both iOS and Android test cases, and updating the driver to route orientation commands appropriately.

  • Added tests for setting and asserting orientations for iOS and Android.
  • Updated the driver to handle iOS orientation commands using proxyCommand and to distinguish between orientation-related commands in the executeCommand method.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
example/ruby/example_sample2_ios.rb Added orientation setting tests for iOS.
example/ruby/example_sample2.rb Added orientation setting tests for Android.
driver/lib/driver.ts Updated get/setOrientation methods and command handling.

@samitrepo
Copy link

@KazuCocoa How to adopt your fix?
I did mvn clean install to get your latest fix on Orientation. But getting same issue with driver.rotate(ScreenOrientation.LANDSCAPE);

Below maven dependency is being used in my pom.

com.github.saikrishna321
flutter
1.0


io.github.5v1988
appium-flutter-client
1.0.5

@KazuCocoa
Copy link
Member Author

This is appium flutter driver fix. Please use appium flutter driver 2.15.2. This is not client side code. (I guess you're saying client side stuff)

@samitrepo
Copy link

samitrepo commented May 6, 2025

@KazuCocoa
I am not using Appium Flutter Driver as I have experienced most of the method not yet implemented.

So I am using Appium Driver as base driver..
and casting to AndroidDriver or IOSDriver as per requirement.
So there only driver.rotate(ScreenOrientation.LANDSCAPE) is working for Android but not for IOS.
My jdk is 17

@KazuCocoa
Copy link
Member Author

Sorry, I'm confused.

Your original ticket had:

/nix/store/4bwfw6qgz3ayw9l4zm6qywwq3qryckjv-appium-2.6.0/packages/appium/flutter/2.6.0/node_modules/appium-flutter-driver

#793

so you use appium flutter driver, correct? This is not client-side talk.

@samitrepo
Copy link

samitrepo commented May 6, 2025

My ticket
#793

Let me try once more to explain.
We have one Dev application using Flutter.
We have created an Automation Test Framework in Java where we have used Appium Driver (not Appium Flutter Driver) to test the Dev application. And we are facing issue when we are trying to write an Automation Script to rotate screen.
In Android is fine but in IOS it is not working.

Though I can see AndroidDriver and IOSDriver both extend AppiumDriver which have ScreenRotation method available.

@KazuCocoa
Copy link
Member Author

KazuCocoa commented May 6, 2025

Could you make sure you don't talk about classes in https://github.com/appium/java-client?

This is not client side stuff. So in case your Appium Driver is AppiumDriver like https://github.com/appium/java-client/blob/3e5f9e2045913d35b859bc37b55453dcebe94324/src/main/java/io/appium/java_client/AppiumDriver.java#L70, you say Appium client-side stuff, which is out of scope.

Then, what appium server and drivers do you use in your framework? If this appium flutter driver was hidden in the framework from your perspective, the necessary update is in the framework side, how to manage appium servers/drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Screen Rotation between LANDSCAPE and PORTRAIT is not working for iOS with Flutter in Java

3 participants