All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mvysny.kaributesting.v8.LocatorAddons.kt Maven / Gradle / Ivy

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