akshayp7/playwright-typescript-playwright-test

Debug with codegen

AutoQA23 opened this issue · 3 comments

Hi,

Debugging using codegen --debug with the command npx cross-env ENV=qa npm run test:single is not working. Running from Debug console is debugging. How to make codgen work for debugging in this framework?

Hi Thanks for your question.
You can start the debug process by using Cntrl+Shift+P and then go for "Debug:Debug npm script" option.
Now select test:single option, it will fail in first run as you said but there is work around. After it fails give the below command in VSCode terminal. Please let me know if it worked
"npx cross-env ENV=qa npm run test:single"

Hi Akshay,

It is debugging but checking testinfo.js, util.js, workerRunner.js etc rather stepping into test file directly. How to make the debug run on the test file directly?

Hi Again,
I managed to get Playwright inspector by adding debug to the scripts in package.json