简体   繁体   中英

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",

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 ..... `)

})

在此处输入图像描述

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
    })
})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM