【发布时间】:2017-12-07 19:32:51
【问题描述】:
我正在使用 nightwatch-cucumber 编写测试。我有一个这样的场景:
Given I have loaded the dashboard page
And I have clicked on the result menu item
When I click on 'OK' in the prompt box
Then the results page is present
我的问题是:如何使用“And”关键字创建步骤?例如:
And(/^I have clicked on the result menu item$/, () => {
return client.click('#results-box');
});
当我尝试这个时,我得到以下错误:
ReferenceError: And is not defined
【问题讨论】:
-
将 And 切换为 GIven 或 When 或 Then....