Angular 在 Cucumber js 中执行完成后,括号参数不会在 Cucumber Feature 文件中被替换
Angular bracket arguments don't get replaced in Cucumber Feature file after completion of execution in cucumber js
我将黄瓜 js 与节点 js 和 webdriverio 一起使用。
我在步骤定义文件中编写了钩子,例如..
Given(/^I login with username (.*) and password (.*)$/, function(username,password) {
pageModule.open();
pageModule.Login("abc","abc");
return Promise.resolve();
});
我使用的Feature文件如下
Scenario: Create New
Given I login with username "<username>" and password "<password>"
执行后,生成的报告类似于..并且在特征文件中不会替换为实际值
如果需要取多个用户名和密码:
1) 我们需要将其声明为 Scenario Outline 而不是 Scenario
2) 我们需要按照以下格式创建场景大纲:
Scenario Outline: Create New
Given I login with username <username> and password <password>
Examples:
|username|password|
|firstUserName|firstPassword|
|secondUserName|secondPassword|
通过这种方式,我们的场景将通过多个示例重复我们在示例 table 中证明的内容,如上所示。
我将黄瓜 js 与节点 js 和 webdriverio 一起使用。
我在步骤定义文件中编写了钩子,例如..
Given(/^I login with username (.*) and password (.*)$/, function(username,password) {
pageModule.open();
pageModule.Login("abc","abc");
return Promise.resolve();
});
我使用的Feature文件如下
Scenario: Create New
Given I login with username "<username>" and password "<password>"
执行后,生成的报告类似于..并且在特征文件中不会替换为实际值
如果需要取多个用户名和密码:
1) 我们需要将其声明为 Scenario Outline 而不是 Scenario 2) 我们需要按照以下格式创建场景大纲:
Scenario Outline: Create New
Given I login with username <username> and password <password>
Examples:
|username|password|
|firstUserName|firstPassword|
|secondUserName|secondPassword|
通过这种方式,我们的场景将通过多个示例重复我们在示例 table 中证明的内容,如上所示。