使用带有 Gherkin 5.1.0 法语测试的 codeceptJs 2.1.1 我试图检查所有字段是否存在于使用数据表提供字段名称的表单中。
这是小黄瓜测试:
@tabletest
Scénario: Les champs
Alors je vois les champs :
| coteComplete |
| typeOptionCote |
这是相应的步骤:
Then('je vois les champs( de saisie) :', (name) => {
I.say('name', name);
I.seeElement(`input[name=${name}], select[name=${name}], textearea[name=${name}]`);
});
这是堆栈跟踪:
$ npx codeceptjs run --grep "tabletest" --debug --verbose
CodeceptJS v2.1.1
Using test root "C:\PISTARD\diffusion\dev\pistard-diffusion"
Helpers: Protractor
Plugins: screenshotOnFail, wdio
Recherche par cote @PDIFF-56 --
Emitted | suite.before ([object Object])
» Started SeleniumStandaloneLauncher
» [Session] Starting singleton browser session
Les champs @tabletest
Emitted | test.before ([object Object])
Emitted | hook.start ([object Object])
Emitted | step.before (I am on page "recherche-avancee")
Emitted | step.after (I am on page "recherche-avancee")
Emitted | step.start (I am on page "recherche-avancee")
Etant donné que je suis sur la page "recherche avancee"
I am on page "recherche-avancee"
» Visited http://localhost:4200/recherche-avancee
Emitted | step.passed (I am on page "recherche-avancee")
Emitted | step.finish (I am on page "recherche-avancee")
Emitted | hook.passed ([object Object])
Emitted | test.start ([object Object])
[1] Error | TypeError: Cannot read property 'bold' of undefined
[1] Starting <teardown> session
Emitted | test.failed ([object Object])
Emitted | test.finish ([object Object])
[1] <teardown> Stopping recording promises
» <screenshotOnFail> Test failed, saving screenshot
» Screenshot has been saved to C:\PISTARD\diffusion\dev\pistard-diffusion\codeceptjs-output\Les_champs_1557763592.failed.png
× FAILED in 287ms
[2] Starting recording promises
Emitted | test.after ([object Object])
Emitted | suite.after ([object Object])
-- FAILURES:
1) Recherche par cote @PDIFF-56
Les champs @tabletest:
Cannot read property 'bold' of undefined
ypeError: Cannot read property 'bold' of undefined
at Object.say (node_modules\codeceptjs\lib\output.js:139:53)
at recorder.add (node_modules\codeceptjs\lib\actor.js:40:78)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
FAIL | 0 passed, 1 failed // 5s
Emitted | global.result ([object Object])
Emitted | global.after ([object Object])
» Stopped SeleniumStandaloneLauncher