Skip to content

add support to set UiAutomator Congfigurator values#6561

Merged
imurchie merged 1 commit intoappium:masterfrom
truebit:master
Jul 1, 2016
Merged

add support to set UiAutomator Congfigurator values#6561
imurchie merged 1 commit intoappium:masterfrom
truebit:master

Conversation

@truebit
Copy link
Copy Markdown

@truebit truebit commented Jun 8, 2016

Proposed changes

UiAutomator Configurator provides several methods to change its the configurations.
I have implemented them in appium using appium settings api

This is the overall PR for all other three PRs:
appium-android-driver
appium-android-bootstrap
java-client

I know there would be appium-uiautomator2-server and appium-uiautomator2-driver in upcoming versions. Since I used existing API, It would be OK for me to merge this feature to the new android server and driver

Types of changes

What types of changes does your code introduce to Appium?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

But according to android uiautomator fixed timeout bug in UiAutomatorBridge, the timeout in dynamic page still cannot be changed.
Maybe we need to recompile uiautomator.jar to change the static final field TOTAL_TIME_TO_WAIT_FOR_IDLE_STATE from 10 * 1000 to Configurator.getInstance().getWaitForIdleTimeout().
That's a little more complexed, I have not tried that.

Reviewers:

@triager
Copy link
Copy Markdown
Contributor

triager commented Jun 8, 2016

Can one of the admins verify this patch?

1 similar comment
@triager
Copy link
Copy Markdown
Contributor

triager commented Jun 8, 2016

Can one of the admins verify this patch?

Comment thread docs/en/advanced-concepts/settings.md Outdated

**"ignoreUnimportantViews"** - Boolean which sets whether Android devices should use `setCompressedLayoutHeirarchy()` which ignores all views which are marked IMPORTANT_FOR_ACCESSIBILITY_NO or IMPORTANT_FOR_ACCESSIBILITY_AUTO (and have been deemed not important by the system), in an attempt to make things less confusing or faster.

**"configurator"** - JSON string (example: `{"method":"setWaitForIdleTimeout","value":5000}`) which sets [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) timeouts and delays in Android devices.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

any reason it couldn't just be a JSON object that gets sent rather than a JSON string?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think in http request, all params are treated as String. In client implementation, we could parse to JSON Object

@jlipps
Copy link
Copy Markdown
Member

jlipps commented Jun 29, 2016

👍 just squash please!

@truebit
Copy link
Copy Markdown
Author

truebit commented Jun 30, 2016

It seems that because I merged from upstream master, the squash included some changes in other upstream commits. Is that OK?

@jlipps
Copy link
Copy Markdown
Member

jlipps commented Jun 30, 2016

@truebit, no, this PR should contain only your changes! looks like you need to rebase on upstream master instead of merging from it

@truebit
Copy link
Copy Markdown
Author

truebit commented Jul 1, 2016

sqash done as you said :)

@imurchie imurchie merged commit 0b5df72 into appium:master Jul 1, 2016
@truebit
Copy link
Copy Markdown
Author

truebit commented Jul 2, 2016

@imurchie You merged this PR, but left appium/appium-android-driver#153 unaccepted. without the left PR, it won't work.

@imurchie
Copy link
Copy Markdown
Contributor

imurchie commented Jul 5, 2016

Yes. Once everyone is happy with that PR, it will be merged. This one is just documentation, and being slightly out of sync is not too much of a problem. Especially since the work will only be available to someone using the source code anyway, until we have time to release a new version.

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.

4 participants