【发布时间】:2021-12-28 09:09:28
【问题描述】:
我想重写一个函数“它”。我能做到吗?
old_it = it
it = (name, foo) ->
console.log('111')
old_it(name, foo)
console.log('222')
当我运行此代码时,控制台会输出一条消息“it = undefined”
【问题讨论】:
标签: testing webdriver-io wdio
我想重写一个函数“它”。我能做到吗?
old_it = it
it = (name, foo) ->
console.log('111')
old_it(name, foo)
console.log('222')
当我运行此代码时,控制台会输出一条消息“it = undefined”
【问题讨论】:
标签: testing webdriver-io wdio
您需要更正文件 wdio.conf.js 中的 beforeTest 和 afterTest 属性
...
beforeTest: function (test, context) {
console.log('start test ' + test.title)
},
...
afterTest: function(test, context, { error, result, duration, passed, retries }) {
console.log('finish test ' + test.title)
},
...
【讨论】: