我正在使用量角器和黄瓜进行e2e测试。 该方案大纲是这样的:步骤定义不确认
Scenario Outline: Visit HomeScreen
Given I am on the homescreen
When I do nothing
Then I should see the element with id <elemid>
Examples:
|elemid|
|scan-sample-image|
|how-to-run|
|navigation-button|
的 “则” 部分是喜欢我的步骤定义:
this.Then(/^I should see the element with id \<elemid\>$/, function(id){
//some code
});
然而,当我打电话量角器,我看到:
Scenario: Visit HomeScreen
V Given I am on the homescreen
V When I do nothing
? Then I should see the element with id scan-sample-image
Scenario: Visit HomeScreen
V Given I am on the homescreen
V When I do nothing
? Then I should see the element with id how-to-run
Scenario: Visit HomeScreen
V Given I am on the homescreen
V When I do nothing
? Then I should see the element with id navigation-button
“那么”并不是被认可的。 我的错误在哪里?
与java相同的是'^我应该看到带有id的元素“([^ \”] *)\“$' –
@alecxe:谢谢。这是解决方案。 :) – saab
@Ashish Deshmukh:两个引号\“最终出现在同一个问题中,即方法未被识别 – saab