Hi everyone,
I have a nice accumulated quite a few tests for my current project and i am happily relying on them by now.
Sadly the newer version of xolvio:cucumber (v0.11.x and v0.12.x) break my tests in a weird way that i can’t wrap my head around, so i need some help to migrate my tests to the newer version.
Right now i am running in to false positives which is very scary.
The main thing i don’t understand is, why my feature steps are showing up out of order in my cucumber.log.
I think if i could understand why that is happening i will be able to fix my tests. I’ve already spent more then a day on figuring it out, i know it has somehow be related to the promise style syntax/logic in all this but I’m kind of new to that.
I’ve read in the change-log that the Webdriver.io API was updated to v3 and found in some discussions that this brought major changes. But i can’t seem to find any documentation on how to handle this. I feel like most of the cucumber tutorials are not up to date with the speed of development…
So for now I’ll have to stay with the old v0.10.0 of the xolvio:cucumber package.
Let’s jump into a small example I’ve stripped out of my real world project:
I have the following small feature making sure my background layer on my leaflet map is loading:
If I break my feature intentionally this is how cucumber reports the failure:
When i run the exact same test with the newer versions of xolvio:cucumber, here is what happens:
Now you surely want to see my step definitions:
@Given /^I view the map$/, (next) ->
@client.url(process.env.ROOT_URL)
.waitForVisible('.map')
.call next
@Then /^I should see the background tiles loading$/, (next) ->
@client.waitForVisible('img.leaflet-tile-loaded')
.call next
The steps are written in coffescript.
If i start executing more tests so it takes longer after some time the
I should see the background tiles loading
step fails eventually but still step execution is totally out of order and more steps then actually available/set-up are executed.
I’ve also tried these variants of the steps with no success:
@Then /^I should see the background tiles loading$/, (next) ->
@client.isVisible('img.leaflet-tile-loaded')
.should.become(true)
.and.notify next
@Then /^I should see the background tiles loading$/, (next) ->
@client.isVisible('img.leaflet-tile-loaded')
.should.eventually.be.true
.and.notify next
@Given /^I view the map$/, (next) ->
@client.url(process.env.ROOT_URL)
.isVisible('.map')
.should.eventually.be.true
.and.notify next
Hope to get some decent hints on how to understand the situation!
Thanks for your time!