0
我正在使用geb-spock。我试图验证页面类的内容,在页面本身,以便我只调用变量或函数。使用功能。我做了这样的事情不能与页面类内容中的框架一起使用
class BasePage extends Page {
static content = {
verifyheader { withFrame ("myFrame") { assert $("h1").text() == "Header1" }
}
}
}
...
then:
to BasePage
and:
verifyheader
我得到一个错误,测试失败和withFrame为空。 这并不occuer当我把withFrame测试用例
then:
to BasePage
and:
withFrame('myFrame') {...}
这完美地工作,但我期待在页面类使用它。可能吗?我怎么去解决它?或换句话说,我的代码有什么问题
你可以张贴堆栈跟踪 –