"Stepception" in playwright allure report when iterating over values with allure-js-common.step() #2795
-
Hi there, I'm having trouble to understand how can i show allure steps in report without nesting. Ive added repository whoever wants to reproduce it.
But essentially test setup looks like this: test('stepception', { tag: ['@stepception'] },
async ({ page }) => {
const logos: string[] = [
'VS Code',
'Bing',
'Outlook',
'Non existing logo'
];
logos.forEach(async name => {
await step('validate logo alt tag', async () => {
await expect(page.getByRole('link', { name })).toBeVisible()
});
});
}) I'd expect to see
Is there a way to achive my expected view instead of nested one? Or maybe someone knows anoter way to check lots of values and show readable result in report. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
Yeah, the issue is that you have async functions in
forEach
. This leads to unresolved promises, which is why you have an undetermined order and nesting of steps.