Allure codeceptjs mix sub steps, and do not attach sub steps to (GIVEN, THAN, WHEN) #2934
zbachir
started this conversation in
General Discussion
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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 step "And My cart is empty" contains many sub-steps, but on the report, no sub-steps are 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)
Workaound:
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)
})
do not use I.say with this workaround.
Beta Was this translation helpful? Give feedback.
All reactions