Repository navigation
feat(options): add missing Android, UiAutomator2, and Espresso capabilities - #2503
hoanle0126 wants to merge 2 commits into
Conversation
mykola-mokhnach
left a comment
There was a problem hiding this comment.
- [minor] The PR adds 11 interfaces and no
BREAKING CHANGE. I found nothing breaking, only new default methods on the two options classes. A one-line check that no existing subclass or implementer already declares clashing method names would settle that.
| String AUTO_WEBVIEW_NAME_OPTION = "autoWebviewName"; | ||
|
|
||
| /** | ||
| * Sets a custom context name suffix to match instead of the application package |
There was a problem hiding this comment.
[major] The driver doc defines autoWebviewName as replacing only the application package part of the context name. The driver builds the context name as WEBVIEW_ + (autoWebviewName || app package). The Javadoc here says "context name suffix" and "Custom webview context name". The tests pass "WEBVIEW_sample" and "WEBVIEW_espresso". A user following that pattern would make the driver look for WEBVIEW_WEBVIEW_sample, and autoWebview would never find the webview. Please reword the Javadoc to say the value replaces the package part (for example com.example.app). Also change the test values and the PR example to match.
There was a problem hiding this comment.
Updated the Javadoc, unit tests, and PR snippet in 5a5d6ae to clarify that autoWebviewName replaces the application package part (for example com.example.app).
| * | ||
| * @return self instance for chaining. | ||
| */ | ||
| default T enableWebviewDetailsCollection() { |
There was a problem hiding this comment.
[minor] The driver default for enableWebviewDetailsCollection is true, so the no-arg enableWebviewDetailsCollection() changes nothing. The useful action is disabling it, which is only possible through setEnableWebviewDetailsCollection(false). Please state the default in the Javadoc. You could also drop the no-arg enabler, or add a disableWebviewDetailsCollection() helper.
There was a problem hiding this comment.
Documented the true default and replaced the no-op enabler with disableWebviewDetailsCollection() in 5a5d6ae.
| String CHROMEDRIVER_FORWARD_BIDI_OPTION = "chromedriverForwardBiDi"; | ||
|
|
||
| /** | ||
| * Enables forwarding the ChromeDriver BiDi WebSocket to the driver WebSocket |
There was a problem hiding this comment.
[minor] The driver requires BiDi to be enabled (webSocketUrl set to true, via enableBiDi()) for this capability to take effect. Calling only chromedriverForwardBiDi() gives no forwarding and no error. Please say so in the Javadoc. The driver docs also give 6.1.0 as the minimum driver version.
There was a problem hiding this comment.
Added the BiDi requirement (webSocketUrl: true / enableBiDi()) and minimum appium-android-driver 6.1.0 version to the Javadoc in 5a5d6ae.
| String ENABLE_ACCESSIBILITY_EVENTS_SERVICE_OPTION = "enableAccessibilityEventsService"; | ||
|
|
||
| /** | ||
| * Enables the Appium Settings accessibility events service for the session. |
There was a problem hiding this comment.
[nit] The driver docs say enabling this also stops suppressing accessibility services unless disableSuppressAccessibilityService is explicitly false. The minimum driver version (9.1.0) is only in the PR description. It would help to put both in the Javadoc.
There was a problem hiding this comment.
Added both the disableSuppressAccessibilityService interaction and the minimum appium-uiautomator2-driver 9.1.0 version to the Javadoc in 5a5d6ae.
|
Thanks for the review @mykola-mokhnach. Addressed all inline notes in 5a5d6ae, and verified across |
Change list
Add typed option interfaces on
UiAutomator2OptionsandEspressoOptionsfor capabilities supported byappium-android-driverandappium-uiautomator2-driverthat did not have getters and setters yet.Types of changes
Details
Shared Android options added to both
UiAutomator2OptionsandEspressoOptions:UiAutomator2-only options added to
UiAutomator2Options:appium-uiautomator2-driver9.1.0), forceAppLaunch, shouldTerminateApp