我想知道 Javascript (NodeJS) 中是否有一个用于Protractor的框架,它支持一种干净的方式来定义页面对象上的页面对象元素,就像site_prism一样。我已经检查了星盘,但不太符合目的。
class Home < SitePrism::Page
set_url "/index.htm"
set_url_matcher /google.com\/?/
element :search_field, "input[name='q']"
element :search_button, "button[name='btnK']"
elements :footer_links, "#footer a"
section :menu, MenuSection, "#gbx3"
end
class MenuSection < SitePrism::Section
element :search, "a.search"
element :images, "a.image-search"
element :maps, "a.map-search"
end
有谁知道或已经开发了类似上述的解决方案,但对于Protractor。也许有人在内部使用自定义框架,你愿意开源吗?
关于星盘它缺乏集合支持,我正在寻找一种更具声明性的语法;代替
username: { get: function() { return this.findElement(this.by.input('username')); },
我期待一些更具声明性的东西,例如:
username: By.input('username'),
可以在这里进一步挖掘缺少的星盘功能,但我的问题不是星盘本身,而是关于 JS 是否有更好的site_prism等价物。
注意:从软件质量保证和测试迁移问题,因为那里没有得到足够的关注。