79291361

Date: 2024-12-18 14:07:55
Score: 4
Natty:
Report link
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
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (1): I am also facing the same issue
  • Blacklisted phrase (0.5): I need
  • Whitelisted phrase (-1): worked for me
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): I am also facing the same issue
  • Low reputation (1):
Posted by: Irshad Telsang