Wait And Should

Use waitTo to wait on a condition, and should to assert right away. All the code below you can freely swap between should and waitTo .

Text Value

header.should(equal("super search")) > expecting by css #header to equal "super search" . by css #header equals "super search" (136ms)

Attribute Value

pageElement.attribute("class").waitTo(equal(~/\bfancy\b/)) > waiting for attribute "class" of by css #table-wrapper to equal ~/\bfancy\b/ . attribute "class" of by css #table-wrapper equals ~/\bfancy\b/ (16ms)