I am also facing the same issue while running the scripts in sequence regardless of previous task's status
My original script which I want to achieve all 3 tasks-
"testChrome": "npm run deleteOutput && npx playwright test --project=chrome --grep @smoke && npm run generateReport"
here, in my pipeline I am running 'npm run testChrome'
the last task of generateReport will only executes if previous 2 are passed.
I tried with ';' but it's giving an error. I am using Playwright framework.
Below worked for me but I need to have multiple scripts (for each browser) which is not recommended; otherwise require me to change the script every time. Like below
"chrome": "npx playwright test --project=chrome --grep @smoke"
"edge": "npx playwright test --project=edge --grep @smoke"
"safari": "npx playwright test --project=safari --grep @smoke"
"runChromeTestsWithReport": "npm-run-all -s -c deleteOutput testEdge generateReport"
"runFirefoxTestsWithReport": "npm-run-all -s -c deleteOutput testEdge generateReport"
"runSafariTestsWithReport": "npm-run-all -s -c deleteOutput testEdge generateReport"
Then finally I can run 'npm run runChromeTestsWithReport'
so I would need to create 6 scripts.
Let me know if anyone has better solution on this. Thanks