不能使用变量测试退出柑橘重复直到语句
cannot use test on variable to exit in citrus repeat until statement
使用柑橘,我试图在 "repeat until" 容器中重复一些操作,但找不到使用循环索引以外的其他变量的方法。
这是有效的基本形式
repeat().until("i = 5")
.actions(
sleep(2000L),
applyBehavior(new GetProcessState())
);
见下文,尝试添加一些其他条件。
我试过这个:
repeat().until("(i = 5) and @assertThat(${processState},equalTo('RUNNING'))@)").index("i")
还有这个
repeat().until("(i = 5) and (${processIsRunning}=false)").index("i")
但无法正常工作。任何人都知道如何实现这一点?
感谢任何帮助。
你的第二种做法其实是正确的。不幸的是,由于一些实现细节,必须将周围的空格添加到包含布尔字符串的组中。
否则 Citrus 将无法正确解析表达式。
例如
repeat().until("(i = 5) and ( ${processIsRunning} = false )").index("i")
使用柑橘,我试图在 "repeat until" 容器中重复一些操作,但找不到使用循环索引以外的其他变量的方法。
这是有效的基本形式
repeat().until("i = 5") .actions( sleep(2000L), applyBehavior(new GetProcessState()) );
见下文,尝试添加一些其他条件。
我试过这个:
repeat().until("(i = 5) and @assertThat(${processState},equalTo('RUNNING'))@)").index("i")
还有这个
repeat().until("(i = 5) and (${processIsRunning}=false)").index("i")
但无法正常工作。任何人都知道如何实现这一点?
感谢任何帮助。
你的第二种做法其实是正确的。不幸的是,由于一些实现细节,必须将周围的空格添加到包含布尔字符串的组中。 否则 Citrus 将无法正确解析表达式。
例如
repeat().until("(i = 5) and ( ${processIsRunning} = false )").index("i")