cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.06k stars 1.09k forks source link

How can I use playwright reporter in cucumber js #2221

Closed bodycombathuang closed 1 year ago

bodycombathuang commented 1 year ago

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

davidjgoss commented 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?

bodycombathuang commented 1 year ago

@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...) playwright 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

cucumberreport

HanLiu1976 commented 1 year ago

This is the one I also concern. For how the error indicator detail as playwright by cucumber report. any suggestions?

davidjgoss commented 1 year ago

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:

bodycombathuang commented 1 year ago

@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

davidjgoss commented 1 year ago

I don't know @bodycombathuang, you'd need to consult Playwright's docs for that, it's not in scope of Cucumber's support.

davidjgoss commented 1 year ago

Going to close this one because the unknowns are about Playwright not Cucumber.