将 playwright 与 cucumber 和 typescript 成功集成后,我可以使用命令“npx cucumber-js”一次性运行所有功能文件。但我想运行一个特定的功能文件。
这是我的package.json
{
"name": "test-playwright",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "cucumber-js"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@cucumber/cucumber": "^9.5.0",
"@playwright/test": "^1.37.1"
},
"dependencies": {
"ts-node": "^10.9.1"
}
}
这是我的 cucumber.json
{
"default": {
"paths": ["src/features/**/*.feature"],
"require": ["src/step-definations/*.ts", "src/support/hooks.ts"],
"requireModule": ["ts-node/register"],
"format": ["html:cucumber-report.html"],
"publish-quite": true
}
}
我尝试了多个命令,但没有任何效果,它们都运行 src 中存在的所有功能文件,我尝试过的一些命令是