Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

tags at Example causing exception #162

Closed
jonn-set opened this issue Jan 23, 2019 · 9 comments
Closed

tags at Example causing exception #162

jonn-set opened this issue Jan 23, 2019 · 9 comments

Comments

@jonn-set
Copy link
Contributor

I am using wdio-cucumber-framework with cucumber 4 and have seen that passing tag expression that includes tags at Example level is not getting filtered, instead it end up throwing an exception.

If I pass a tag expression of @F1 and @Sc01 and @ex01, it will throw the below exception:

Error

ERROR: Cannot read property 'steps' of undefined
chrome
Type    at CucumberEventListener.onTestCasePrepared (/Users/john/workspace/sample/node_modules/wdio-cucumber-framework/build/cucumberEventListener.js:211:45)
    at emitOne (events.js:121:20)
    at EventEmitter.emit (events.js:211:7)
    at TestCaseRunner.emit (/Users/john/workspace/sample/node_modules/wdio-cucumber-framework/node_modules/cucumber/lib/runtime/test_case_runner.js:94:29)
    at TestCaseRunner.emitPrepared (/Users/john/workspace/sample/node_modules/wdio-cucumber-framework/node_modules/cucumber/lib/runtime/test_case_runner.js:127:12)
    at TestCaseRunner.<anonymous> (/Users/john/workspace/sample/node_modules/wdio-cucumber-framework/node_modules/cucumber/lib/runtime/test_case_runner.js:219:14)
    at Generator.next (<anonymous>)
    at Generator.tryCatcher (/Users/john/workspace/sample/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseFulfilled (/Users/john/workspace/sample/node_modules/bluebird/js/release/generators.js:97:49)
    at TestCaseRunner.<anonymous> (/Users/john/workspace/sample/node_modules/bluebird/js/release/generators.js:201:15)
    at TestCaseRunner.run (/Users/john/workspace/sample/node_modules/wdio-cucumber-framework/node_modules/cucumber/lib/runtime/test_case_runner.js:236:22)
    at Runtime.<anonymous> (/Users/john/workspace/sample/node_modules/wdio-cucumber-framework/node_modules/cucumber/lib/runtime/index.js:113:51)
    at Generator.next (<anonymous>)
    at Generator.tryCatcher (/Users/john/workspace/sample/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseFulfilled (/Users/john/workspace/sample/node_modules/bluebird/js/release/generators.js:97:49)
    at Runtime.<anonymous> (/Users/john/workspace/sample/node_modules/bluebird/js/release/generators.js:201:15)
    at Runtime.runTestCase (/Users/john/workspace/sample/node_modules/wdio-cucumber-framework/node_modules/cucumber/lib/runtime/index.js:123:22)
    at tryCatcher (/Users/john/workspace/sample/node_modules/bluebird/js/release/util.js:16:23)
    at Object.gotValue (/Users/john/workspace/sample/node_modules/bluebird/js/release/reduce.js:155:18)
    at Object.gotAccum (/Users/john/workspace/sample/node_modules/bluebird/js/release/reduce.js:144:25)
    at Object.tryCatcher (/Users/john/workspace/sample/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/john/workspace/sample/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/john/workspace/sample/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromiseCtx (/Users/john/workspace/sample/node_modules/bluebird/js/release/promise.js:606:10)
    at _drainQueueStep (/Users/john/workspace/sample/node_modules/bluebird/js/release/async.js:142:12)
    at _drainQueue (/Users/john/workspace/sample/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/Users/john/workspace/sample/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues (/Users/john/workspace/sample/node_modules/bluebird/js/release/async.js:17:14)

My feature file

@F1
Feature: Feature 1

  @Sc01
  Scenario Outline: Some Outline

    Given On "<arg01>" website, I enter "<arg02>"

  @ex01
    Examples:
      | arg01  | arg02 |
      | google | blah  |

  @ex02
    Examples:
      | arg01  | arg02 |
      | google | blah  |
      | bing   | blah  |

  @ex03
    Examples:
      | arg01      | arg02 |
      | duckduckgo | blah  |

If I remove the @ex01 tag then it will work and the test runs. I was using cucumber 1 and compatible wdio-cucumber-framework earlier with the old type tags and it use to work without any issues

@jonn-set
Copy link
Contributor Author

jonn-set commented Jan 28, 2019

@BorisOsipov Can you review this and merge it please?

@jonn-set
Copy link
Contributor Author

Hi, its been 2 months, appreciate you guys are busy but can someone have a look at this merge request please?

@BorisOsipov
Copy link
Contributor

BorisOsipov commented Mar 25, 2019

@jonn-set would you mind adding unit test for this?

@jonn-set
Copy link
Contributor Author

@BorisOsipov, sure, will do.

I ran through the existing tests and was wondering if there's a way to check that the right number of scenarios have been picked up using CucumberAdapter. It looks like all the tests call run function to execute the tests, which only return 0 or 1, is there something else that I can use as I don't really need to run the whole test, just make sure the right scenarios are filtered for testing.

Thanks

@BorisOsipov
Copy link
Contributor

@jonn-set I am not ready to drive deep into current testing suite. I would like to have corresponding test at least to make sure we won't have regression in future with this fix

jonn-set added a commit to jonn-set/wdio-cucumber-framework that referenced this issue Mar 26, 2019
@jonn-set
Copy link
Contributor Author

@BorisOsipov I have added some unit tests, have a look and if you are happy with it, please merge.

Thank you

@jonn-set
Copy link
Contributor Author

@BorisOsipov, thanks for merging, when will this be released?

@BorisOsipov
Copy link
Contributor

@christian-bromann ping

@jonn-set
Copy link
Contributor Author

@christian-bromann, was this released?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants