我正在将节点wdio-cucumber-framework
的依赖项从2.2.8
升级到1.1.0
。
当前尝试使用"webdriverio": "^4.13.2"
问题:
webdriverio
supports cucumber specific hooks,我正在使用beforeFeature
钩子
:
beforeFeature: function (feature) {
console.log(feature)
console.log(feature.uri)
//do some other stuff here
}
现在将2.2.8
的功能对象更新为
Feature {
description: undefined,
keyword: 'Feature',
line: 1,
name: 'Sample',
tags: [],
uri: 'my\\feature\\location\\sample.feature',
scenarios:
[ Scenario {
feature: [Circular],
keyword: 'Scenario',
lines: [Array],
name: '01: Check menu items for Structure',
tags: [],
uri: 'my\\feature\\location\\sample.feature',
line: 6,
description: undefined,
steps: [Array] } ] }
到
{ type: 'Feature',
tags: [],
location: { line: 1, column: 1 },
language: 'en',
keyword: 'Feature',
name: 'Sample',
description: undefined,
children:
[ { type: 'Background',
location: [Object],
keyword: 'Background',
name: '',
description: undefined,
steps: [Array] },
{ type: 'Scenario',
tags: [],
location: [Object],
keyword: 'Scenario',
name: '01: Check menu items for Structure',
description: undefined,
steps: [Array] } ] }
新的显然不具有uri
属性。还有其他方法可以从钩子中获取该信息吗?
提前谢谢!