【发布时间】:2016-07-12 06:09:57
【问题描述】:
在Geb 和WATIR 中,我们使用某些关键字来访问我们在页面类中指定的page_url。例如。 Geb 中的 to 关键字和 WATIR 中的 visit 关键字。
我们可以在nightwatch.js 中使用什么类似的东西。这是我尝试过的,但它给出了错误:
我试过了:
module.exports = {
url: function () {
return this.api.globals.launchUrl + "/goto/desiredPage.html";
},
commands: [pageCommands],
elements: {}
};
在页面类中,我将其用作:
desiredPage
.url()
.foo()
.bar();
client.end();
但它给出了错误.url is not a function。
【问题讨论】: