Geb 和 Spock 中页面对象的接口

Interfaces for Page Objects in Geb and Spock

当我使用 Java + selenium 时,我习惯于为页面对象创建接口,然后我使用 Spring 将特定实现绑定到抽象接口。
我的文件可能如下所示:
src\main\pageobjects\MyPageInterface
src\main\pageobjects\MyPageWebImpl
src\main\pageobjects\MyPageMobileImpl
src\test\Test
因此,我能够编写一项测试并 运行 它针对两种不同的实现(在本例中,一种用于桌面,一种用于移动)。

如何使用 Geb 页面对象在 Geb 中执行此操作 http://www.gebish.org/manual/current/#pages

Spock 的数据驱动测试应该能够运行针对不同实现的相同规范。

http://spockframework.org/spock/docs/1.0/data_driven_testing.html