Bharath Kumar S
Bharath Kumar S

Reputation: 1408

How to addStep in @wdio/allure-reporter with wdio mocha

I am not able to add a new step.

I need to add a step in my report for a negative scenario. I had referred the documentation https://www.npmjs.com/package/@wdio/allure-reporter.

const { addFeature } = require('@wdio/allure-reporter').default

describe('Suite', () => {
    it('Case', () => {
        addStep('**exceptions**')
    })
})

I am using allure report 5.3.4

"@wdio/allure-reporter": "^5.3.4",

Upvotes: 0

Views: 1797

Answers (2)

Ajinkya Gangawane
Ajinkya Gangawane

Reputation: 41

Based on your query i guess you need to add two things first the startStep Method and then try to add your addStep method.

const { addFeature } = require('@wdio/allure-reporter').default

describe('Suite', () => {
    it('Case', () => {
        startStep('*** negative test starts here *****')
        addStep('**exceptions**') 
        endStep("passed") //Accepts two values passed or failed
    })
})

Upvotes: 0

Bharath Kumar S
Bharath Kumar S

Reputation: 1408

I was able to figure out

import AllureReporter from '@wdio/allure-reporter';

it('*************  *********', async () => {

    await AllureReporter.addStep(`The ${ele} does not exist ..... `)
    await AllureReporter.addStep(`The ${ele} does not exist ..... `)

})

enter image description here

Upvotes: 0

Related Questions