playwright
playwright copied to clipboard
[Feature] Stacktrace in Debugger Mode
I have an easy function here as a reuseableComponent to click a button (Which i call in test scripts)
async clickButton(name: string) { await this.getByRole('button', {name}).click(); }
snippet of script: await vorsorgemodellPage.clickButton('Abbbrechen'); (there is a typo in the button name to showcase)
With running the script with the debugger (playwright:debug) you just get a timeout without stack trace pointing to the reuseableComponent file and you don't get the Stacktrace with the action/step in the script where it actually fails unlike in headless mode (playwright:test)
debugger mode:
Headlless mode:
can you please also add the stacktrace option in debug mode? I think this is really helpfull for debugging and others for sure will benefit from this as well
You should 'box' your helper function as stated here: https://playwright.dev/docs/release-notes#hide-implementation-details-box-test-steps
Thank you fro the answer..i don't use this test.step() in my helper. what i wanted to have is to implement the same for all modes. why different?.. You can see in the debugger mode there is only one source and it pounts to the helper file
unlike in headles mode ..there is two sources where as the second one points to the failed test step in the script where the error actually occures
Yes, so you should use test.step to achieve your goal of boxing.
Closing as per above
Ok thank you for the reply and the tipp :)