After successful integration of playwright with cucumber and typescript, I am able to run feature files all in one go by using command "npx cucumber-js". But I want to run a specific feature file.
Here is my 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"
}
}
And here is my 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
}
}
I have tried multiple commands but nothing works they all run all feature files present in src, some commands I tried are
Seems like I am missing some thing but can't sort it out
The method I found is to specify the unique file I want to run under paths
{
"default": {
"paths": ["src/features/YourFeatureName.feature"],
"require": ["src/step-definations/*.ts", "src/support/hooks.ts"],
"requireModule": ["ts-node/register"],
"format": ["html:cucumber-report.html"],
"publish-quite": true
}
}