def message = $("#message") message.should == "Select option" def message = $("#message") message.should == ~/option/ def menu = $("#menu ul li") menu.should == ["Hello", "Text", "World"] def message = $("#message") message.should contain("option") def menu = $("#menu ul li").all() menu.should contain("Text") Note: all() is used at element declaration time to disambiguate between contain text in the first element and in the list of elements. It is not required when you do an explicit comparison with the list on the right, since then WebTau can deduce the desired outcome. def menu = $("#menu ul li") menu.should == ["Hello", ~/T..t/, "World"]
def total = $("#total") total.should == 300.6 def total = $("#total") total.shouldBe > 200 def total = $("#total") total.shouldBe >= 300 def split = $("#split ul li") split.should == [100, 28, 172.6] def split = $("#split ul li") split.should == [100, lessThan(100), greaterThanOrEqual(150)]
def number = $("#number-to-change") def trigger = $("#change-number") number.takeSnapshot() trigger.click() number.waitTo change > taking value snapshot by css #number-to-change . value snapshot is taken for by css #number-to-change (19ms) > clicking by css #change-number . clicked by css #change-number (222ms) > waiting for by css #number-to-change to change . by css #number-to-change changed (18ms)