根据http://www.gebish.org/manual/current/modules.html#modules,模块的定义应如下所示:
class ExamplePage extends Page {
static content = {
theModule { module ExampleModule }
}
}
从Geb的文档中:
16.2.2强类型
为了获得更好的创作支持,您必须在测试和页面对象中包括类型。此外,您必须显式访问浏览器和页面对象,而不要依赖动态调度。
所以:
HomePage homePage = browser.to HomePage
homePage.loginButton.click()
它对Pages很好用,但是我还能找到与Modules一起使用的方法吗?在这里具有自动补全功能:
HomePage homePage = browser.to HomePage
homePage.loginFormModule. *autosuggestion here*
(其中“ loginFormModule”-是主页的模块)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句