-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Generating cucumber reports with hooks #107
Comments
Sound like a bug. Could you create a reproducable example in https://github.com/vitalets/playwright-bdd-example |
Sorry for spamming if you get edits as well, but I think now I found the actual issue. So basically what happens is that cucumber report stops in case one of the hooks fail. In my setup I have a hook running, which does not take into account specific conditions, so in some cases it is failing, which was not causing any issues for playwright report as they seem to ignore hook failures, but in playwright-bdd hook failures are blocking report generation. In summary it is more of a optimization and not actual bug:) |
I've created the similar setup in https://github.com/vitalets/playwright-bdd-example/tree/failing-hook-107 Playwright html report looks similar to yours: Could you compare this example code with your setup and try to reproduce on it? |
Hello, I tried this solution and it works for me as well. However when I add a sleep (i.e. 60000 msec) in the After hook, which is longer than Playwright configured timeout, which by default is 30000 msec, then I can reproduce it. So it something to do with timeout error. |
Reproduced now, good catch! Checking for the fix. |
Fixed in 6.0.3. |
Works fine now. Thanks! |
I am trying to utilize cucumberReporter feature and I noticed that it is struggling to generate a report in case a test fails and contains "After" hooks.
My playwright config file:
reporter: [
['list'],
['html', { open: 'never' }],
['junit', { outputFile: 'results.xml' }],
cucumberReporter('html', {
outputFile: 'cucumber-report/bdd_report.html',
}),
],
and the hook it has problem with:
After({ tags: '@delete' }, async function ({ page, $testInfo }) {
// Account cleanup
const accountSettingsPage = createAccountSettingsPage(page, $testInfo)
await accountSettingsPage.deleteAccount()
})
The message I get:
"Error in reporter Error: BDD data attachment is not found for test: As an user, I would like to create a basic account @smoke @regression @Validation @test
Did you set enrichReporterData: true in the Playwright config?
Please note that this is not causing any issues if test case is passing although same hooks are applied.
Wanted to hear if this is a bug or I am settings up something wrong?
Thank you!
The text was updated successfully, but these errors were encountered: