Add SelectionContainer iOS instrumented tests#3113
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
fb5966b to
3b9cc7f
Compare
| return tap(frame.center()) | ||
| } | ||
|
|
||
| fun focusThenDoubleTap(tag: String, delayMillis: Long = 500L) { |
There was a problem hiding this comment.
The function name is not very clear (missing "Node"/"Tag" nouns in the function name) to keep it as is here.
I would rather refactor it to the AccessibilityTestNode.focusThenDoubleTap(delayMillis: Long = 500L) to be able to use like:
findNodeWithTag(NodeTag).focusThenDoubleTap()
| } No newline at end of file | ||
| } | ||
|
|
||
| internal fun UIKitInstrumentedTest.longPressAndAwaitContextMenu(tag: String) { |
There was a problem hiding this comment.
The proper name should be longPressNodeWithTagAndAwaitContextMenu
|
|
||
| setSelectionContainerContent(state = selectionState, text = text) | ||
|
|
||
| focusThenDoubleTap(Tag, delayMillis = DoubleTapPreparationDelayMillis) |
There was a problem hiding this comment.
focusThenDoubleTap uses the same value as DoubleTapPreparationDelayMillis by default - we can omit the delayMillis parameter here.
| content: @Composable () -> Unit, | ||
| ) { | ||
| setContent { | ||
| Box(modifier = Modifier.fillMaxSize()) { |
There was a problem hiding this comment.
| Box(modifier = Modifier.fillMaxSize()) { | |
| Box(modifier = Modifier.fillMaxSize().safeDrawingPadding()) { |
The top are under the notch/dynamic island may be not responsive for touches. Let's add padding.
| } | ||
| } | ||
|
|
||
| private fun UIKitInstrumentedTest.longPressAndReleaseAfterLoupe(tag: String) { |
There was a problem hiding this comment.
It's better to make this and the following functions as extension to AccessibilityTestNode to eliminate misunderstanding between "Node With Tag" and "Node With Label" as we're using both in tests.
Describe proposed changes and the issue being fixed
(Optional) Fixes CMP-10302 [iOS] Add instrumented tests for SelectionContainer
Release Notes
N/A