![JAR search and dependency download from the Maven repository](/logo.png)
com.github.mvysny.kaributesting.v8.LocatorAddons.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of karibu-testing-v8 Show documentation
Show all versions of karibu-testing-v8 Show documentation
Karibu Testing, support for browserless Vaadin testing in Kotlin
The newest version!
package com.github.mvysny.kaributesting.v8
import com.vaadin.ui.Component
import java.util.function.Predicate
/**
* Makes sure that the component's [Component.getCaption] contains given [substring].
*/
public fun SearchSpec.captionContains(substring: String) {
predicates.add(CaptionContainsPredicate(substring))
}
private data class CaptionContainsPredicate(val substring: String) : Predicate {
override fun test(t: T): Boolean = (t.caption ?: "").contains(substring)
override fun toString() = "captionContains('$substring')"
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy