onWindow

Finds the single window matching matcher among every window currently realized in the test JVM, whether or not it is shown. A window realized by a org.jetbrains.compose.swing.window.Window or org.jetbrains.compose.swing.window.Dialog composable stays realized while that composable is in the composition and leaves the match set once it is disposed on leaving the composition. The match is resolved lazily when the returned interaction is first used.

setContent { Window(onCloseRequest = {}, title = "Settings") { ... } }
onWindow(SwingMatcher.hasTitle("Settings")).assertIsVisible()

Return

a handle that fails on use unless exactly one realized window matches.

Parameters

matcher

applied to the window itself - its title, its type - rather than to anything in its content.