class Bezel::Testing::Node

An element of a Testing::Doc (or its root, without a tag), or a text.

src/testing/doc.qz:50

Constants

HIDDEN: Array[String]

Elements whose text is no part of the page's.

src/testing/doc.qz:93

BLOCKS: Array[String]

Elements that begin a line of text.

src/testing/doc.qz:96

Class methods

def self.squish(text: String) -> String

text with runs of whitespace as one space, trimmed.

src/testing/doc.qz:140

Methods

def tag -> String

The tag in lowercase ("" for the root and for a text).

src/testing/doc.qz:60

def attrs -> Hash[String, String]

The attributes, names in lowercase.

src/testing/doc.qz:63

def attr(name: String) -> String?

The attribute name, or nil.

src/testing/doc.qz:66

def children -> Array[Bezel::Testing::Node]

The child elements and texts.

src/testing/doc.qz:69

def text? -> Bool

Whether this is a text.

src/testing/doc.qz:77

def classes -> Array[String]

The classes of the class attribute.

src/testing/doc.qz:80

def text -> String

The text inside, whitespace collapsed: inline elements joined as they are (Hello, <b>Ann</b>! is Hello, Ann!), block elements apart; script, style, template and title inside leave theirs out (the element's own text gives it).

src/testing/doc.qz:86

def select(selector: String) -> Array[Bezel::Testing::Node]

The elements under this one selector matches, in document order.

src/testing/doc.qz:115

def descendants -> Array[Bezel::Testing::Node]

The elements under this one, in document order.

src/testing/doc.qz:137