【发布时间】:2020-09-06 08:09:10
【问题描述】:
我有一个 Cucumber 场景大纲,我想在其中的示例表中传递 6 个空格字符串 (" ") 作为值。在示例表中,将值留空,传递一个空字符串。我试过双引号和单引号,它是一样的。它传递 8 个字符串(包括 2 个引号),而不是 6 个。
场景大纲如下所示:
Scenario Outline: Change password - Negative Invalid Confirm Password
Given I log in as a user on the change password page
When I insert the current password
And I insert password
And I insert invalid confirm password <value>
And I move focus to another element on the change password page
Then <message> appears under the confirm password field
Examples:
|value |message |
|Aa1! |Passwords Invalid or Do Not Match |
|" " |Passwords Invalid or Do Not Match |
这就是特征定义的样子:
When(/^I insert invalid confirmPassword (.*)$/, async (confirmNewPass:string) => {
await changePasswordPage.changePasswordComponent.insertConfirmNewPassword(confirmNewPass);
});
【问题讨论】:
标签: typescript cucumber bdd gherkin