在我的剧作家测试中,我试图使用npm run cucumber --profile dev运行一个黄瓜特性,但是没有获得任何场景:

这是我的index.ts文件:
const common = `./src/features/**/*.feature \
--require-module ts-node/register \
--require ./src/step-definitions/**/**/*.ts \
-f json:./reports/report.json \
--format progress-bar `;
const dev = `${common} --tags '@dev'`;
const smoke = `${common} --tags '@smoke'`;
const regression = `${common} --tags '@regression'`;
export { dev, smoke, regression }下面是我的文件夹结构,因为它可能很有用:

另外,我的home-page.feature文件:
Feature: As a user I expect to be able to navigate to the home page
@dev
@regression
Scenario: As a user I expect to be able to see contacts
Given I am on the 'home' page
Then the 'contacts header' should contain the text 'Contacts'还有我的package.json
{
"name": "personalised-offers-platform-e2e-pw",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"transpile": "rimraf dist && babel --extensions .ts --out-dir dist src",
"cucumber": "npm run transpile && cucumber-js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.18.9",
"@babel/preset-env": "^7.18.9",
"@babel/preset-typescript": "^7.18.6",
"@cucumber/cucumber": "^8.5.0",
"@playwright/test": "^1.23.4",
"playwright": "^1.23.4",
"ts-node": "^10.9.1",
"typescript": "^4.7.4"
}
}我试过只运行npm run cucumber来查看标记是否是问题所在,但它提供了与上面相同的输出。
最初,我认为问题在于我的common路径在我的index.ts中,因为这个特性没有被采纳,但是在我看来它们现在看起来还可以。
有人能解释一下我做错了什么吗?我怎样才能解决这个问题?
我可以提供更多的代码来帮助了解这个问题。
发布于 2022-10-29 08:31:39
尝试使用“黄瓜”选项-p或--profile
npm run transpile && cucumber-js -phttps://stackoverflow.com/questions/73081897
复制相似问题