Skip to content

Add SelectionContainer iOS instrumented tests#3113

Open
janinadavydova wants to merge 7 commits into
jb-mainfrom
davydova/selection-container-tests
Open

Add SelectionContainer iOS instrumented tests#3113
janinadavydova wants to merge 7 commits into
jb-mainfrom
davydova/selection-container-tests

Conversation

@janinadavydova

Copy link
Copy Markdown

Describe proposed changes and the issue being fixed

(Optional) Fixes CMP-10302 [iOS] Add instrumented tests for SelectionContainer

Release Notes

N/A

@google-cla

google-cla Bot commented Jun 10, 2026

Copy link
Copy Markdown

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.

@janinadavydova janinadavydova force-pushed the davydova/selection-container-tests branch from fb5966b to 3b9cc7f Compare June 16, 2026 18:38
@janinadavydova janinadavydova marked this pull request as ready for review June 16, 2026 21:45
return tap(frame.center())
}

fun focusThenDoubleTap(tag: String, delayMillis: Long = 500L) {

@ASalavei Andrei Salavei (ASalavei) Jun 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The proper name should be longPressNodeWithTagAndAwaitContextMenu


setSelectionContainerContent(state = selectionState, text = text)

focusThenDoubleTap(Tag, delayMillis = DoubleTapPreparationDelayMillis)

@ASalavei Andrei Salavei (ASalavei) Jun 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

focusThenDoubleTap uses the same value as DoubleTapPreparationDelayMillis by default - we can omit the delayMillis parameter here.

content: @Composable () -> Unit,
) {
setContent {
Box(modifier = Modifier.fillMaxSize()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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.

2 participants