-
-
Notifications
You must be signed in to change notification settings - Fork 75
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 set value immediately, replace value #484
fix set value immediately, replace value #484
Conversation
espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/handlers/ElementValue.kt
Outdated
Show resolved
Hide resolved
@@ -1,5 +1,5 @@ | |||
package io.appium.espressoserver.lib.model | |||
|
|||
data class ElementValueParams( |
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.
w3c also requires text
parameter to be set, which contains a string rather than array
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.
Okay. Will add text and update routes, too
} | ||
|
||
val viewInteraction = Element.getViewInteractionById(elementId) | ||
if (isReplacing) { | ||
viewInteraction.perform(replaceText(value)) | ||
} else { | ||
viewInteraction.perform(typeText(value)) | ||
try { |
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.
is this block of code duplicated?
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.
A part of.
Will refactor as another PR (SendKeys.kt)
Pair(first=true, second=false) -> params.text!! | ||
else -> params.value!!.joinToString() // for backward-compatibility | ||
Pair(first=false, second=true) -> params.value!!.joinToString(separator="") // for MJSONWP | ||
else -> params.text!! // Prior W3C |
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.
actually, text was added in W3C
Below error happens for set immediate value and replace value.
Tested in Ruby to make the behaviour the same as UIA2
https://dev.azure.com/kazucocoa/ruby_lib_core/_build/results?buildId=1265