com.github.mvysny.kaributesting.v10.ElementUtils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of karibu-testing-v10 Show documentation
Show all versions of karibu-testing-v10 Show documentation
Karibu Testing, support for browserless Vaadin testing in Kotlin
package com.github.mvysny.kaributesting.v10
import com.vaadin.flow.component.Component
import com.vaadin.flow.component.ComponentUtil
import com.vaadin.flow.dom.DomEvent
import com.vaadin.flow.dom.Element
import com.vaadin.flow.internal.nodefeature.ElementListenerMap
/**
* Fires a DOM [event] on this element.
*/
public fun Element._fireDomEvent(event: DomEvent) {
node.getFeature(ElementListenerMap::class.java).fireEvent(event)
}
/**
* Returns all components that are closest to [this] element.
*/
public fun Element._findComponents(): List {
val components = mutableListOf()
ComponentUtil.findComponents(this) {
components.add(it)
}
return components
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy