Ir al contenido principal
Versión: 5.7.x

Comparadores Jsoup

[Traducción Beta No Oficial]

Esta página fue traducida por PageTurner AI (beta). No está respaldada oficialmente por el proyecto. ¿Encontraste un error? Reportar problema →

Esta página enumera todos los comparadores actuales en la biblioteca de extensiones para jsoup de KotlinTest. Para utilizar esta biblioteca, debes agregar kotlintest-assertions-jsoup a tu configuración de compilación.

Element
element.shouldHaveChildWithTag(tag)Asserts that the element has a child with the given tag
element.shouldHaveText(text)Asserts that the element has the given text
element.shouldHaveAttribute(name)Asserts that the element has an attribute with the given name
element.shouldHaveAttributeValue(name, value)Asserts that the element have an attribute with the given value
Elements
elements.shouldBePresent()Asserts that the Elements object has some item
elements.shouldBePresent(n)Asserts that the Elements object has N items
elements.shouldBePresent(n)Asserts that the Elements object has N items
HTML
element.shouldHaveId(id)Asserts that the element has an attribute id with the given value
element.shouldHaveClass(class)Asserts that the element has the specified class
element.shouldHaveSrc(src)Asserts that the element has an attribute src with the given value
element.shouldHaveHref(href)Asserts that the element has an attribute href with the given value
element.shouldHaveElementWithId(id)Asserts that the element has a child with the given id
element.shouldHaveChildWithClass(id)Asserts that the element has a child with the given class