Javascript 每个键必须是多个字符串;获得功能

Javascript 每个键必须是多个字符串;获得功能,javascript,html,angular,cucumberjs,Javascript,Html,Angular,Cucumberjs,我在Cucumber中有这样一个场景: Scenario Outline: Protractor and Cucumber Test InValid Given I have already...... When I fill the <number> .... Examples: | number|... | 3 |... |4 |... 我得到了这个错误:每个键必须是一个字符串的数字;got函数 当我在没有场景大纲的情况下通过自己输入一个

我在Cucumber中有这样一个场景:

Scenario Outline: Protractor and Cucumber Test InValid

    Given I have already......
    When I fill the <number>
    ....


    Examples:
| number|...
| 3 |...
|4  |...
我得到了这个错误:每个键必须是一个字符串的数字;got函数

当我在没有场景大纲的情况下通过自己输入一个值来执行测试时,例如:.sendKeys('4'),它可以工作


我做错什么了吗?

你的论点顺序不对<代码>回调始终是参数列表中的最后一个元素

修正:

 When('I fill the {int}',{timeout: 90 * 1000},  function(callback, number) {

        element(by.css("*[id='field_identificador']")).click();
        element(by.css("*[id='field_identificador']")).sendKeys(number).then(callback);

    });
When('I fill the {int}',{timeout: 90 * 1000},  function(number, callback) {

        element(by.css("*[id='field_identificador']")).click();
        element(by.css("*[id='field_identificador']")).sendKeys(number).then(callback);

    });