"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 3 replies
-
|
Could you please specify the versions of I just checked it with using latest versions: {
"name": "playwright-yarn-esm-ts",
"type": "module",
"version": "1.0.0",
"description": "",
"scripts": {
"test": "playwright test"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.48.2",
"@types/node": "^22.9.0",
"allure-js-commons": "^3.0.6",
"allure-playwright": "^3.0.6",
"typescript": "^5.6.3"
},
"packageManager": "[email protected]"
}import { test, expect } from "@playwright/test";
import { step } from "allure-js-commons";
test("sample test", async ({ page }) => {
await page.goto("https://allurereport.org");
const names = [
"Manual QA",
"Developers",
"Project Managers"
]
for (const name of names) {
await step(`check ${name}`, async () => {
await expect(page.getByRole("button", { name })).toBeVisible();
})
}
});And everything works as expected:
|
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.