Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

The allure report mixes steps, it no longer attaches the steps to GIVEN, WHEN, THAN #4931

Closed
zbachir opened this issue Mar 19, 2025 · 3 comments

Comments

@zbachir
Copy link

zbachir commented Mar 19, 2025

I use codeceptjs 3.7.2 with playwright 1.28.1 (bdd) with allure-codeceptjs: 3.2.0, this is part of my codecept.conf.js :
....
plugins: {
screenshotOnFail: {
enabled: true
},
allure: {
enabled: true,
require: 'allure-codeceptjs',
resultsDir: env.reportOutput
},
....

The final allure report mixes steps :

  • it no longer attaches the steps to GIVEN, WHEN, THAN,
  • Or, attach all steps the one GIVEN or WHEN or THAN
  • Or, attach some steps one GIVEN or WHEN or THAN and other steps to other one ... etc

example here the scenario:
@FEAT-01-002
Scenario: Authenticated user sets the quantity and add a product to the cart
Given I am logged in as a customer
And My cart is empty
When I add 3 instances of a product1 to my cart
Then My cart contains 3 instances of product1
And I should be able to empty my cart

the phrase "And My cart is empty" contains many steps, but on the report, no step is attached.

please rename this file with extention html before open it:
index.txt

please take a look the the generated report here (see attached file)

@zbachir
Copy link
Author

zbachir commented Mar 19, 2025

I modify my step like this, but same problem:

const allure = require("allure-js-commons");

Given('I am logged in as a customer', async function() {
await allure.step("Login as a customer", async () => {
await commonPage.loginAsUser(env.ENV, env.user, env.pwd);
global.env.userType = 'customer';
global.values.isConnected = true;
// Empty cart
await utils._emptyMyCart();
I.refreshPage();
})
})

@zbachir
Copy link
Author

zbachir commented Mar 19, 2025

When I put an assert in end of the GIVEN it resolve the problem !

like:

Given('I am logged in as a customer', async function() {
await commonPage.loginAsUser(env.ENV, env.user, env.pwd);
global.env.userType = 'customer';
global.values.isConnected = true;
// Empty cart
await utils._emptyMyCart();
I.refreshPage();
I.waitForVisible("//button[contains(., 'My Account')]", 35)
assert.ok(await I.grabNumberOfVisibleElements("//button[contains(., 'My Account')]") > 0)
})

@zbachir
Copy link
Author

zbachir commented Mar 20, 2025

do not use I.say with this workaround.

@codeceptjs codeceptjs locked and limited conversation to collaborators Mar 24, 2025
@kobenguyent kobenguyent converted this issue into discussion #4932 Mar 24, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant