Closed bodycombathuang closed 1 year ago
How can I use playwright reporter in cucumber js
You can't; Playwright Test is a different test runner to Cucumber.
cucumber.js report does not contain the info for each line of code, but playwright report has
Could you elaborate a little on the functionality you'd like to get from the Cucumber report?
@davidjgoss here is the report generated by playwright test runner, it shows whether each expression of code is executed successfully or not (locator.click(internal:role=link[name="Get started"i]), expect.toHaveTitle...) here is the html report generated by cucumber js test runner, it only contains words from feature file and exceptions in case of error, is it possible cucumber js report can show whether each expression of code is executed successfully or not
This is the one I also concern. For how the error indicator detail as playwright by cucumber report. any suggestions?
Cucumber isn't going to do something that's specific to Playwright itself. But if you can get the information you want out of Playwright there are maybe things you can try:
this.log
from within a step will emit a plain text attachment that shows up in the report. Is there some logging from Playwright you could hook into and send to this?setDefinitionFunctionWrapper
could be used to wrap the step and do something with the exception before it bubbles up to Cucumber. Maybe there's some detail you can pull out of there and log?@davidjgoss thanks for your help. I have more question which apis/method can return expressions (like page.goto ,expect.toHaveTitle expressions in the above picture), that each test run has called and return whether each expression succeeds or fails
I don't know @bodycombathuang, you'd need to consult Playwright's docs for that, it's not in scope of Cucumber's support.
Going to close this one because the unknowns are about Playwright not Cucumber.
How can I use playwright reporter in cucumber js cucumber.js report does not contain the info for each line of code, but playwright report has