NodeJS:wdio-cucumber-framework v2.2.8-Feature.uri属性丢失

时间:2019-03-08 10:02:23

标签: node.js cucumber webdriver-io cucumberjs wdio-v4

我正在将节点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属性。还有其他方法可以从钩子中获取该信息吗?

提前谢谢!

0 个答案:

没有答案