无法从使用Cucumber Framework工具量角器实现的类型记录中调用功能文件中的值。如何在时间块中的类型记录方法中调用这些示例值。
特征文件代码
功能:导航到计算器站点并添加两个数字。
场景:使用计算器站点添加两个数字
给出导航到计算器站点url "cal“
当提供两个数字以添加第一个数字和
然后单击计算器站点上的add按钮
场景大纲:提供参数
例子:\x{e76f} key1 \ key2 \x
| 2 | 3 |
|2 |60 |时块代码
当(‘提供两个数字以添加第一个数字和’时,异步(key1 1:string,key1 2:string)=>{
// Write code here that turns the phrase above into concrete actions
await cal.firstEditBox.sendKeys(key1);
await cal.secondEditBox.sendKeys(key2);});
一执行它就是给了我错误
给定导航到计算器站点url "cal“# stepDefinations\steps.ts:10的√
*时提供两个数字以添加第一个数字和# stepDefinations\steps.ts:16
函数有2个参数,应该有0(如果同步或返回承诺)或1(如果接受回调)
- Then Click on add button on calculator site # stepDefinations\steps.ts:24# node_modules\protractor-cucumber-framework\lib\resultsCapturer.js:27之后的√
发布于 2020-07-18 09:12:40
Feature: Navigate to calculator site and add two number
Scenario: Add two number using calculator site
Given Navigate to calculator site url "cal"
When Provide two numbers "<key1>" and "<key2>"
Then Click on add button on calculator site
Scenario Outline: Provide parameters
Examples:
| key1 | key2 |
| 2 | 3 |
| 2 | 60 |When('Provide two numbers {string} and {string}', async (key1:string,key2:string)=> {
// Write code here that turns the phrase above into concrete actions
await cal.firstEditBox.sendKeys(key1);
await cal.secondEditBox.sendKeys(key2);
});https://stackoverflow.com/questions/62966633
复制相似问题