You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using stepContext does not handle step metadata and thus can't update display name or attach parameters to a step.
e.g. the following code:
import test from "@playwright/test";
import * as allure from "allure-js-commons";
test("Sample script", async ({ page }) => {
await allure.step("", async (stepContext) => {
await stepContext.displayName("Fill the sign-in form");
await stepContext.parameter("login", "user.login");
await stepContext.parameter("password", "user.password", "masked");
await allure.attachment("response", JSON.stringify({ key: "value" }), { contentType: "application/json" });
// ...
});
});
To Reproduce
Steps to reproduce the behavior:
create a playwright test
create an allure.step with a lambda function containing stepContext argument
put await stepContext.displayName("TEST") and await stepContext.parameter("key", "value") call inside the step
run test
generate allure report
observe generated step
Expected result: You should see an updated step display name and a step parameter.
Actual result: neither step display name is updated nor step parameter added.
Context:
the following logs are emitted during test execution: could not handle step metadata message: no step is running
Describe the bug
Using
stepContext
does not handle step metadata and thus can't update display name or attach parameters to a step.e.g. the following code:
To Reproduce
Steps to reproduce the behavior:
allure.step
with a lambda function containingstepContext
argumentawait stepContext.displayName("TEST")
andawait stepContext.parameter("key", "value")
call inside the stepExpected result: You should see an updated step display name and a step parameter.
Actual result: neither step display name is updated nor step parameter added.
Context:
could not handle step metadata message: no step is running
allure-results result.json file
{ "uuid": "4ae2258f-3223-47d7-bda8-e1f646870eb2", "name": "Sample script", "historyId": "a5e92e768232e6ab3b7905513132c706:5bd835b0d6b1d4ada3b9f0db936e82c8", "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [ { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [ { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [ { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [], "attachments": [], "parameters": [], "start": 1738632654767, "name": "browserType.launch", "stop": 1738632654864 } ], "attachments": [], "parameters": [], "start": 1738632654766, "name": "fixture: browser", "stop": 1738632654864 }, { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [ { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [], "attachments": [], "parameters": [], "start": 1738632654865, "name": "browser.newContext", "stop": 1738632654868 } ], "attachments": [], "parameters": [], "start": 1738632654864, "name": "fixture: context", "stop": 1738632654868 }, { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [ { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [], "attachments": [], "parameters": [], "start": 1738632654869, "name": "browserContext.newPage", "stop": 1738632654923 } ], "attachments": [], "parameters": [], "start": 1738632654869, "name": "fixture: page", "stop": 1738632654923 } ], "attachments": [], "parameters": [], "start": 1738632654763, "name": "Before Hooks", "stop": 1738632654923 }, { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [ { "statusDetails": {}, "stage": "finished", "steps": [], "attachments": [ { "name": "response", "source": "c44f8609-2e54-4f35-94d1-3fb0d95c2be7-attachment.json", "type": "application/json" } ], "parameters": [], "start": 1738632654948, "name": "response", "stop": 1738632654948 } ], "attachments": [], "parameters": [], "start": 1738632654934, "name": "", "stop": 1738632654938 }, { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [ { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [], "attachments": [], "parameters": [], "start": 1738632654938, "name": "fixture: page", "stop": 1738632654938 }, { "status": "passed", "statusDetails": {}, "stage": "finished", "steps": [], "attachments": [], "parameters": [], "start": 1738632654938, "name": "fixture: context", "stop": 1738632654938 } ], "attachments": [], "parameters": [], "start": 1738632654938, "name": "After Hooks", "stop": 1738632654946 } ], "attachments": [], "parameters": [{ "name": "Project", "value": "chromium" }], "labels": [ { "name": "language", "value": "javascript" }, { "name": "framework", "value": "playwright" }, { "name": "package", "value": "sample.spec.ts" }, { "name": "titlePath", "value": " > chromium > sample.spec.ts" }, { "name": "host", "value": "Perchwell.attlocal.net" }, { "name": "thread", "value": "pid-90849-worker-0" }, { "name": "parentSuite", "value": "chromium" }, { "name": "suite", "value": "sample.spec.ts" } ], "links": [], "start": 1738632654763, "testCaseId": "a5e92e768232e6ab3b7905513132c706", "fullName": "sample.spec.ts:4:5", "stop": 1738632654846 }package.json:
package-lock.json
{ "name": "playwright", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "playwright", "version": "1.0.0", "license": "ISC", "devDependencies": { "@playwright/test": "^1.50.1", "@types/node": "^22.13.0", "allure-playwright": "^3.1.0" } }, "node_modules/@playwright/test": { "version": "1.50.1", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.50.1.tgz", "integrity": "sha512-Jii3aBg+CEDpgnuDxEp/h7BimHcUTDlpEtce89xEumlJ5ef2hqepZ+PWp1DDpYC/VO9fmWVI1IlEaoI5fK9FXQ==", "dev": true, "license": "Apache-2.0", "dependencies": { "playwright": "1.50.1" }, "bin": { "playwright": "cli.js" }, "engines": { "node": ">=18" } }, "node_modules/@types/node": { "version": "22.13.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.0.tgz", "integrity": "sha512-ClIbNe36lawluuvq3+YYhnIN2CELi+6q8NpnM7PYp4hBn/TatfboPgVSm2rwKRfnV2M+Ty9GWDFI64KEe+kysA==", "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.20.0" } }, "node_modules/allure-js-commons": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-3.1.0.tgz", "integrity": "sha512-J4ijOvlbdw6nNRUWLgrNlybQ8v3FulgKAcIqiupeDI9bXy8D0yh2ukPtUdvWS+fltAwaQT72pFR2hEq4I21rrQ==", "dev": true, "license": "Apache-2.0", "dependencies": { "md5": "^2.3.0" }, "peerDependencies": { "allure-playwright": "3.1.0" }, "peerDependenciesMeta": { "allure-playwright": { "optional": true } } }, "node_modules/allure-playwright": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/allure-playwright/-/allure-playwright-3.1.0.tgz", "integrity": "sha512-Xfl39cWPMvIAIAwcAhcwHusaU6x/rFChZUyvatd+WuMueM1N/+ckwXgqafdq8OX7yefwUHR9wla1GqAYoEwplQ==", "dev": true, "license": "Apache-2.0", "dependencies": { "allure-js-commons": "3.1.0" }, "peerDependencies": { "@playwright/test": ">=1.36.0" } }, "node_modules/charenc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", "dev": true, "license": "BSD-3-Clause", "engines": { "node": "*" } }, "node_modules/crypt": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", "dev": true, "license": "BSD-3-Clause", "engines": { "node": "*" } }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, "node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true, "license": "MIT" }, "node_modules/md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { "charenc": "0.0.2", "crypt": "0.0.2", "is-buffer": "~1.1.6" } }, "node_modules/playwright": { "version": "1.50.1", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.50.1.tgz", "integrity": "sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw==", "dev": true, "license": "Apache-2.0", "dependencies": { "playwright-core": "1.50.1" }, "bin": { "playwright": "cli.js" }, "engines": { "node": ">=18" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { "version": "1.50.1", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.1.tgz", "integrity": "sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==", "dev": true, "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { "node": ">=18" } }, "node_modules/undici-types": { "version": "6.20.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true, "license": "MIT" } } }The text was updated successfully, but these errors were encountered: