dir-expect-dom

Action

DOM-specific assertions for testing Rhyme code. Use /expect-dom for clean test syntax

Syntax

dir-expect-dom dom-text contains "text"

check if DOM text content contains substring

dir-expect-dom dom-text equals "text"

check if DOM text content equals string exactly

dir-expect-dom action .text exists

check if element with action type exists in DOM

dir-expect-dom action .text not exists

check if element with action type does not exist in DOM

dir-expect-dom action .text count 5

check if exact count of elements with action type exist

dir-expect-dom action .text count-gte 3

check if at least N elements with action type exist

dir-expect-dom query ".my-class" exists

check if CSS selector matches any element

dir-expect-dom query ".my-class" not exists

check if CSS selector matches no elements

dir-expect-dom query ".btn" count 3

check if exact count of elements match CSS selector

dir-expect-dom query ".item" text-contains "hello"

check if first matching element's text contains substring

dir-expect-dom query "#main" text-equals "Hello"

check if first matching element's text equals string exactly

dir-expect-dom has-class ".e12345" "active"

check if element has specific CSS class

dir-expect-dom attribute ".btn" "disabled" exists

check if element has specific attribute

dir-expect-dom style ".circle" contains "border-radius"

check if element's style attribute contains substring

dir-expect-dom attribute ".btn" "style" contains "color"

check if element's attribute value contains substring

dir-expect-dom head contains "viewport"

check if document head contains substring (meta tags, title, links, etc.)

dir-expect-dom head query "meta[name=viewport]" exists

check if CSS selector matches element in document head

Developer Reference
Set: unittest
Version: 0.0.0-12
Encoding: T_OP_S8
Actcode: 2093388145
Set ID: 112