如何使用wdio摩卡在@ wdio / allure-reporter中添加步骤

时间:2019-04-10 06:55:47

标签: mocha allure wdio-v4

我无法添加新步骤。

对于负面的情况,我需要在报告中添加一个步骤。我已经参考了文档https://www.npmjs.com/package/@wdio/allure-reporter

# units = "cm"
dev.new(width=10, height=4, noRStudioGD = TRUE, units = "cm")
plot(1:20, main = "units = cm")

# units = "inch"
dev.new(width=10, height=4, noRStudioGD = TRUE, units = "inch")
plot(1:20, main = "units = inch")

我正在使用魅力报告5.3.4

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

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

2 个答案:

答案 0 :(得分:0)

我能够弄清楚

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

答案 1 :(得分:0)

根据您的查询,我想您需要添加两件事,首先是startStep方法,然后尝试添加您的addStep方法。

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