Closed kurtharriger closed 8 years ago
I thought I had reproduced it by increasing the timeout, but in my removing and adding things I put the timeout in the wrong test so it failed for the wrong reason.
The problem still exists its just harder verify as the test will pass providing an afterAll/afterEach exists, so I updated this failing example by commenting out the afterAll/afterEach. Not ideal as we still want to test those functions, but this reproduces the error anyway.
Cleaned up the test so that its no longer necessary to comment out after* methods to reproduce the failure by creating additional specs for this behavior.
This can be merged after https://github.com/webdriverio/wdio-sync/pull/34 has been merged and updated.
@kurtharriger could you please bump the wdio-sync version to v0.5.3
and rerun the build?
Updated.
I also added an additional test for https://github.com/webdriverio/webdriverio/issues/1278
Awesome thanks! Is this PR ready to get merged now?
Yes
@kurtharriger thanks for the tests and the wdio-sync
fix
Here is a failing test for issue https://github.com/webdriverio/wdio-jasmine-framework/issues/13.
I figured out why your test was passing and mine was not.
Promises returned by the
it
block are not being waited on, but because you have anafterEach
block that also waits the promise has sufficient time to resolve before the test is completed.The key difference I think is that in jasmine a function is executed in async mode only when the provided function has argument length 1. If the function provided takes no arguments, jasmine assumes the test is synchronous does not provide a done function and thus does not wait for it to be called.
This is the only occurrence in
wdio-sync
whereorigFn
is called using a function with 0 arguments and thus explains why there is different behavior forit/fit
blocks thenbefore/after
* blocks.https://github.com/webdriverio/wdio-sync/blob/master/index.js#L476
I can reproduce the failure in the
wdio-jasmine-framework
tests by simply making the timeout for theit
block longer than the timeout for theafterEach
block.