我需要检查页面上使用Cucumber.js的404链接。所以我猜出两件事。
Feature: Check broken links
Scenario: User clicks on links on web page Given User is on website And he clicks on link Then he shouldn't see 404 And user returns back to click to another link on page
发布于 2016-05-19 04:36:25
您应该考虑在这类测试中使用Mocha,Gherkin不是为循环等而设计的。有关更多细节,请参见这个答案:
发布于 2016-05-20 13:19:46
您可以使用场景大纲并将url作为变量传递。
Feature: Check broken links
Scenario Outline: User clicks on links on web page
Given User is on website
And he clicks on <link>
Then he shouldn't see 404
And user returns back to click to another link on page
Examples:
| link |
| http://www.google.com |
| http://www.gmail.com |https://stackoverflow.com/questions/37190633
复制相似问题