webdriverio-boneyard / wdio-cucumber-framework

A WebdriverIO v4 plugin. Adapter for Cucumber testing framework.
MIT License
77 stars 61 forks source link

[SOS]The version of 'wdio-sync'' package is old, the hook function 'AfterStep' misses args! #141

Closed xenera-panrenping closed 6 years ago

xenera-panrenping commented 6 years ago

The version of 'wdio-sync'' package is old. There are three args, "hook", "step " and "result", when hookRunning.js invokes executeHooksWithArgs in wdio-cucumber-framework. return _get__('executeHooksWithArgs')(this.config.afterStep, step, result); //Line 67

But in old wdio-sync package: var executeHooksWithArgs = function executeHooksWithArgs() { var hooks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var args = arguments[1]; ... The argument "result" will miss!! Please fix it, thanks.

BorisOsipov commented 6 years ago

We use "wdio-sync@0.7.1" in package.json. It is latest version. Check your other dependencies and find how pulls older version.

xenera-panrenping commented 6 years ago

Hi, @BorisOsipov Thank you for reply, but the problem missing argument is still exsit, I think...

BorisOsipov commented 6 years ago

I don't know where you find this code var executeHooksWithArgs = function executeHooksWithArgs() { var hooks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var args = arguments[1];

may you show where is the problem in source code here? https://github.com/webdriverio-boneyard/wdio-sync/blob/master/index.js#L93

BorisOsipov commented 6 years ago

@pactera-testing-PanRenping Or maybe describe the issue you ran into, causes you to start investigating wdio-sync\cucumber internals

xenera-panrenping commented 6 years ago

Hi @BorisOsipov, Sorry for my late reply. I did a test on my local.

  1. Download the project git@github.com:webdriverio/cucumber-boilerplate.git
  2. yard install
  3. Realize a function in wdio.conf.js file afterStep: (step, result) => { console.log('Result: ' +result); ... },
  4. Then run the test. I expect a result of step executed, but the value of the result is undefined, so I try to investigate why the result is missed.

I checked the wdio-sync module installed in my local node_modules directory. The context of code is older than you shared https://github.com/webdriverio-boneyard/wdio-sync/blob/master/index.js#L93

I download the package(https://registry.npmjs.org/wdio-sync/-/wdio-sync-0.7.1.tgz) and checked the context of the index.js are still old style...

I don't know which step I did wrong, please help. (My real project dependences "wdio-cucumber-framework": "^2.2.2" in package.json)

christian-bromann commented 6 years ago

The last release contained an update to the wdio-sync package.