Skip to content
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

Add rotation #143

Merged
merged 1 commit into from
Dec 10, 2012
Merged

Add rotation #143

merged 1 commit into from
Dec 10, 2012

Conversation

bootstraponline
Copy link
Contributor

Fix #133

Example spec.

@spec
Scenario: Rotate everything
  Then I wait for 15 seconds
    And I rotate the device to portrait
    And I wait for 5 seconds
    And I rotate the device to landscape
    And I wait for 5 seconds
    And I rotate the device to portrait
    And I wait for 5 seconds
    And I rotate the device to landscape

@jonasmaturana
Copy link
Contributor

The problem with this approach is that it works on activity level and not on a device level and therefore the behavior is pretty far from the user experience.

The consequence is that:

  • The event sequence is not the same as when you rotate the device.
  • When you go to another activity the app orientation returns to portrait.

Currently I don't think this belongs in the official project because of all the confusion it will cause.

I think a better solution would be to make the emulator rotate like when when you use 7 and 9.

@bootstraponline
Copy link
Contributor Author

Calabash currently provides nothing for rotation. Robotium has setActivityOrientation which some people have found useful and is better than nothing.

Sending key presses to the emulator depends on using OS specific APIs to focus the Android emulator and then send the key press. I don't think that's ideal.

Telling people that rotation is exclusive to the expensive LessPainful device cloud is not cool. Surely there's some way to add this in a way that doesn't cause confusion.

@jonasmaturana
Copy link
Contributor

We try to keep everything in calabash working like something an user would do to the app.

It could give value to some people that we add "set_activity_orientation" to the api I just want it to be very clear that using that api is not simulating user input very well. Also, I don't think a predefined step is suitable for something as low level as this.

I'm sorry if I made the impression that I don't want to include something like rotation into calabash because we want something extra on lesspainful.com because that's really not the case. We want calabash to be as powerful as possible.
The reason we added device rotation to our service is not because we enjoy playing with servos but because we worked with customers who used setActivityOrientation and it didn't work for them.

@bootstraponline
Copy link
Contributor Author

It could give value to some people that we add "set_activity_orientation" to the api I just want it to be very clear that using that api is not simulating user input very well.

Adding set_activity_orientation to the API would be nice.

I'm sorry if I made the impression that I don't want to include something like rotation into calabash because we want something extra on lesspainful.com because that's really not the case. We want calabash to be as powerful as possible.

Thanks for the explanation.

@bootstraponline
Copy link
Contributor Author

@jonasmaturana What do you think of this commit? I've removed the predefined step.

@bootstraponline
Copy link
Contributor Author

Have you had a chance to look at the new rotation code?

@jonasmaturana
Copy link
Contributor

I have been looking at the code.

I would like to merge the new action but I think the key should be set_activity_orientation.
The changes to rotation_steps.rb and operations.rb I will not merge because I think they will confuse people.

@jonasmaturana jonasmaturana reopened this Dec 1, 2012
@bootstraponline
Copy link
Contributor Author

I have been looking at the code.

You're looking at the new code from https://github.com/calabash/calabash-android/pull/143/files? It seems as if your comments are based on the old code. I replaced the code 12 days ago and eliminated the rotation changes in favor of set_activity_orientation.

I'm happy to make additional changes for this to be merged.

@bootstraponline
Copy link
Contributor Author

Let me know if changes are required. The key has already been updated.

jonasmaturana pushed a commit that referenced this pull request Dec 10, 2012
@jonasmaturana jonasmaturana merged commit bf01fcc into calabash:master Dec 10, 2012
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.

Device rotation
2 participants