webdriverio-boneyard / wdio-cucumber-framework

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

All scenarios start at once #129

Closed motycka closed 6 years ago

motycka commented 6 years ago

Hello, I have recently upgraded to version 2.x and with that upgrade, my scenarios are now starting all in parallel and it appears they run in the same browser window. This does not seem OK to me, since every cucumber scenario should establish it's own, independent context.

Example feature file:

Feature: Scenarios

    Scenario: My first scenario should run first

        When I run my first scenario
        Then my first scenario needs to do it's thing

    Scenario: My second scenario should run after

        When I run my second scenario
        Then my second scenario needs to do it's thing

    Scenario: My third scenario should run last

        When I run my third scenario
        Then my third scenario needs to do it's thing

log:

  Feature: Scenarios

    Scenario: My first scenario should run first

    Scenario: My second scenario should run after

    Scenario: My third scenario should run last
      I run my first scenario
      my first scenario needs to do it's thing
      I run my second scenario
      my second scenario needs to do it's thing
      I run my third scenario
      my third scenario needs to do it's thing

6 steps (6 passed, 0 failed, 0 pending)

Is it a setup thing, or a bug?

This was last OK in version 1.1.1

christian-bromann commented 6 years ago

@motycka please describe how do you run webdriverio? Are you using wdio testrunner? What are you package versions?

motycka commented 6 years ago

@christian-bromann yes, wdio test runner, I believe.

    "wdio-cucumber-framework": "2.1.0",
    "wdio-cucumber-reporter": "0.0.2",
    "wdio-selenium-standalone-service": "0.0.10",
    "webdriverio": "^4.12.0"

Let me know if you need to see anything else.

wswebcreation commented 6 years ago

@motycka

Is this problem already solved for you? And if not, can you please provide some more info like your step implementation.

woolter commented 6 years ago

@wswebcreation @motycka @christian-bromann is the same issue that #130, I think we can close one of them.

BorisOsipov commented 6 years ago

@woolter yes, thanks

BorisOsipov commented 6 years ago

From: https://github.com/webdriverio/wdio-cucumber-framework/issues/130#issuecomment-409205762

The problem here is the order in which the messages are sent.

All steps are assigned to the last, because "event": "suite:start", are send together and after all steps

V1.1.1

{"event":"suite:start","cid":"0-0","uid":"SEARCH TOOLS ONE1","title":"SEARCH TOOLS ONE","pending":false,"parent":null,"type":"suite","file":"/src/features/testSimple/search_ONE.feature","err":{},"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[]}
{"event":"suite:start","cid":"0-0","uid":"GOOGLE3","title":"GOOGLE","pending":false,"parent":"SEARCH TOOLS ONE1","type":"suite","file":"/src/features/testSimple/search_ONE.feature","err":{},"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[]}
{"event":"test:start","cid":"0-0","uid":"I open the url \"https://www.google.com/\"4","title":"I open the url \"https://www.google.com/\"","pending":false,"parent":"GOOGLE3","type":"test","file":"/Users/src/features/testSimple/search_ONE.feature","err":{},"duration":0,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"featureName":"SEARCH TOOLS ONE","scenarioName":"GOOGLE"}
{"event":"test:pass","cid":"0-0","uid":"I open the url \"https://www.google.com/\"4","title":"I open the url \"https://www.google.com/\"","pending":false,"parent":"GOOGLE3","type":"test","file":"/src/features/testSimple/search_ONE.feature","err":{},"duration":458,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[]}
{"event":"test:start","cid":"0-0","uid":"I pause for 3000ms5","title":"I pause for 3000ms","pending":false,"parent":"GOOGLE3","type":"test","file":"/Users/src/features/testSimple/search_ONE.feature","err":{},"duration":0,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"featureName":"SEARCH TOOLS ONE","scenarioName":"GOOGLE"}
{"event":"test:pass","cid":"0-0","uid":"I pause for 3000ms5","title":"I pause for 3000ms","pending":false,"parent":"GOOGLE3","type":"test","file":"/src/features/testSimple/search_ONE.feature","err":{},"duration":3007,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[]}
{"event":"suite:end","cid":"0-0","uid":"GOOGLE3","title":"GOOGLE","pending":false,"parent":"SEARCH TOOLS ONE1","type":"suite","file":"/src/features/testSimple/search_ONE.feature","err":{},"duration":3477,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[]}
{"event":"suite:start","cid":"0-0","uid":"DUCK DUCK GO8","title":"DUCK DUCK GO","pending":false,"parent":"SEARCH TOOLS ONE1","type":"suite","file":"/src/features/testSimple/search_ONE.feature","err":{},"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[]}
{"event":"test:start","cid":"0-0","uid":"I open the url \"https://duckduckgo.com/\"9","title":"I open the url \"https://duckduckgo.com/\"","pending":false,"parent":"DUCK DUCK GO8","type":"test","file":"/Users/src/features/testSimple/search_ONE.feature","err":{},"duration":0,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"featureName":"SEARCH TOOLS ONE","scenarioName":"DUCK DUCK GO"}
{"event":"test:pass","cid":"0-0","uid":"I open the url \"https://duckduckgo.com/\"9","title":"I open the url \"https://duckduckgo.com/\"","pending":false,"parent":"DUCK DUCK GO8","type":"test","file":"/src/features/testSimple/search_ONE.feature","err":{},"duration":334,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[]}
{"event":"test:start","cid":"0-0","uid":"I pause for 3000ms10","title":"I pause for 3000ms","pending":false,"parent":"DUCK DUCK GO8","type":"test","file":"/Users/src/features/testSimple/search_ONE.feature","err":{},"duration":0,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"featureName":"SEARCH TOOLS ONE","scenarioName":"DUCK DUCK GO"}
{"event":"test:pass","cid":"0-0","uid":"I pause for 3000ms10","title":"I pause for 3000ms","pending":false,"parent":"DUCK DUCK GO8","type":"test","file":"/src/features/testSimple/search_ONE.feature","err":{},"duration":3010,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[]}
{"event":"suite:end","cid":"0-0","uid":"DUCK DUCK GO8","title":"DUCK DUCK GO","pending":false,"parent":"SEARCH TOOLS ONE1","type":"suite","file":"/src/features/testSimple/search_ONE.feature","err":{},"duration":3354,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[]}
{"event":"suite:end","cid":"0-0","uid":"SEARCH TOOLS ONE1","title":"SEARCH TOOLS ONE","pending":false,"parent":null,"type":"suite","file":"/src/features/testSimple/search_ONE.feature","err":{},"duration":6885,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[]}

V2.2.2

{"event":"suite:start","cid":"0-0","uid":"SEARCH TOOLS ONE1","title":"SEARCH TOOLS ONE","pending":false,"parent":null,"type":"suite","file":"src/features/testSimple/search_ONE.feature","err":{},"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"keyword":"Feature"}
{"event":"suite:start","cid":"0-0","uid":"GOOGLE3","title":"GOOGLE","pending":false,"parent":"SEARCH TOOLS ONE1","type":"suite","file":"src/features/testSimple/search_ONE.feature","err":{},"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"keyword":null}
{"event":"suite:start","cid":"0-0","uid":"DUCK DUCK GO7","title":"DUCK DUCK GO","pending":false,"parent":"SEARCH TOOLS ONE1","type":"suite","file":"src/features/testSimple/search_ONE.feature","err":{},"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"keyword":null}
{"event":"test:start","cid":"0-0","uid":"I open the url \"https://www.google.com/\"4","title":"I open the url \"https://www.google.com/\"","pending":false,"parent":"GOOGLE3","type":"test","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":0,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"featureName":"SEARCH TOOLS ONE","scenarioName":"GOOGLE","keyword":null}
{"event":"test:pass","cid":"0-0","uid":"I open the url \"https://www.google.com/\"4","title":"I open the url \"https://www.google.com/\"","pending":false,"parent":"GOOGLE3","type":"test","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":338,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"keyword":"Given ","argument":[]}
{"event":"test:start","cid":"0-0","uid":"I pause for 3000ms5","title":"I pause for 3000ms","pending":false,"parent":"GOOGLE3","type":"test","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":0,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"featureName":"SEARCH TOOLS ONE","scenarioName":"GOOGLE","keyword":null}
{"event":"test:pass","cid":"0-0","uid":"I pause for 3000ms5","title":"I pause for 3000ms","pending":false,"parent":"GOOGLE3","type":"test","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":3009,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"keyword":"And ","argument":[]}
{"event":"suite:end","cid":"0-0","uid":"GOOGLE3","title":"GOOGLE","pending":false,"parent":"SEARCH TOOLS ONE1","type":"suite","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":3567,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"keyword":null}
{"event":"test:start","cid":"0-0","uid":"I open the url \"https://duckduckgo.com/\"8","title":"I open the url \"https://duckduckgo.com/\"","pending":false,"parent":"DUCK DUCK GO7","type":"test","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":0,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"featureName":"SEARCH TOOLS ONE","scenarioName":"DUCK DUCK GO","keyword":null}
{"event":"test:pass","cid":"0-0","uid":"I open the url \"https://duckduckgo.com/\"8","title":"I open the url \"https://duckduckgo.com/\"","pending":false,"parent":"DUCK DUCK GO7","type":"test","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":318,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"keyword":"Given ","argument":[]}
{"event":"test:start","cid":"0-0","uid":"I pause for 3000ms9","title":"I pause for 3000ms","pending":false,"parent":"DUCK DUCK GO7","type":"test","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":0,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"featureName":"SEARCH TOOLS ONE","scenarioName":"DUCK DUCK GO","keyword":null}
{"event":"test:pass","cid":"0-0","uid":"I pause for 3000ms9","title":"I pause for 3000ms","pending":false,"parent":"DUCK DUCK GO7","type":"test","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":3010,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"keyword":"And ","argument":[]}
{"event":"suite:end","cid":"0-0","uid":"DUCK DUCK GO7","title":"DUCK DUCK GO","pending":false,"parent":"SEARCH TOOLS ONE1","type":"suite","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":6901,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"keyword":null}
{"event":"suite:end","cid":"0-0","uid":"SEARCH TOOLS ONE1","title":"SEARCH TOOLS ONE","pending":false,"parent":null,"type":"suite","file":"src/features/testSimple/search_ONE.feature","err":{},"duration":6910,"runner":{"0-0":{"browserName":"chrome","name":"SEARCH TOOLS ONE"}},"specs":["/Users/src/features/testSimple/search_ONE.feature"],"tags":[],"keyword":null}
woolter commented 6 years ago

We can close this issue. It was solve with https://github.com/webdriverio/wdio-cucumber-framework/pull/147

BorisOsipov commented 6 years ago

Yes. Thanks @woolter