Allure Cucumbers.js Integration: Error with allure.step or attachment - 'test.info() can only be called while test is running #2824
-
I have created a project with CucumberJs and Allure. So importing allure from allure-js-commons and writing steps throwing an error. import { Given, Then, When, setDefaultTimeout } from "@cucumber/cucumber"; Given("I am on the login page", async function () { Could anyone help me out with this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Please provide more details on your setup. It looks like you're using CucumberJS runner with Playwright as a library. But according to the error, you're trying to use the |
Beta Was this translation helpful? Give feedback.
-
Its my cucumber.json {
} As you provided in the allure cucumberjs official document. I have tried allure.step but got the same error. its my package.json "devDependencies": { "dependencies": { And nothing else. Just before and after hooks to open and close the browser. And these BeforeAll, Before, After and AfterAll hooks not being considered by allure. In the allure report I can only see the test body. Setup and Teardown sections are empty. |
Beta Was this translation helpful? Give feedback.
-
I have removed allure-playwright from the package.json
this is sample hooks im using
This is the error im getting if I just remove allure-playwright from the package.json Error: a BeforeAll hook errored, process exiting: tests\hooks\hooks.js:14 And I tried uninstalling allure-playwright and deleted allure-playwright from node_modules and this is the error I got Error: a BeforeAll hook errored, process exiting: tests\hooks\hooks.js:14 |
Beta Was this translation helpful? Give feedback.
You will have such an effect if you don't import
allure-cucumberjs
in cucumber world; see https://github.com/allure-examples/cucumberjs-npm-esm-ts/blob/main/features/support/world.ts