我正在尝试测试ag网格组件的行为,该组件允许我使用键盘或单击来选择一个单元格,网格组件捕获按键并将其传递给我按照描述编写的编辑器组件。
here
.
下面的工作和模拟用户单击、点击的情况
进入
类型
五
Y
命中
进入
,但我还想在没有中间Enter键的情况下验证正确的行为,例如模拟单击、单击、类型
五
Y
命中
进入
actor.attemptsTo(
Click.on(cell),
new Performable() {
@Override
public <T extends Actor> void performAs(final T actor) {
pricerPage.withAction().sendKeys(Keys.ENTER).perform();
}
},
Enter.theValue("5y").into(PricerPage.POPUP_TEXT_EDITOR).thenHit(Keys.ENTER)
)
我好像没有
五
按键按预期传递到我的组件,例如,以下操作不会以与发送相同的方式触发编辑器组件
进入
.
actor.attemptsTo(
Click.on(cell),
new Performable() {
@Override
public <T extends Actor> void performAs(final T actor) {
pricerPage.withAction().sendKeys("5").perform();
}
},
Enter.theValue("y").into(PricerPage.POPUP_TEXT_EDITOR).thenHit(Keys.ENTER)
)
有没有更好的方法发送没有目标的密钥,或者这是正确的方法?