zats.zul
<zk> <window title="hello" border="normal" width="300px" apply="org.zkoss.zats.sample.ZatsTestComposer"> <label id="lbl1"/> <button id="helloBtn" label="Hello" /> </window> </zk>
ZatsTestComposer.java
public class ZatsTestComposer extends SelectorComposer<Window> { @Wire Label lbl1; @WireVariable private Map arg; @Listen("onClick= #helloBtn") public void hello(Event evt) { String a1 = (String) arg.get("arg1"); lbl1.setValue(a1); } }
ZatsTest.java
... @Test public void test() { DesktopAgent desktop = Zats.newClient().connect("/zats.zul?arg1=value1"); ComponentAgent button = desktop.query("button"); button.click(); ComponentAgent label = desktop.query("label"); assertEquals("value1", label.as(Label.class).getValue()); }
Expected: Test should pass. Implicit object arg should be correctly populated with the arguments passed when connecting to zul from ZatsTest
Actual: Test fails. arg implicit object doesn't contain any arguments passed as query strings while connecting to zul page from ZatsTest
Note: Doesn't work under ZK 5 environment either.