Don't prevent use of done in before and after functions
I am attempting to use Jasmine's beforeEach on the describe level to reset my DB to a known good state for running tests.
There seems to be some action on behalf of Protractor to prevent users from doing this. Is it really necessary? It seems to prevent beforeEach and afterEach from doing anything asynchronous outside of WebDriver if I understand the implementation correctly.
If I comment out these two lines in protractor/jasminewd/index.js my tests pass.
global.beforeEach = wrapInControlFlow(global.beforeEach, 'beforeEach');
global.afterEach = wrapInControlFlow(global.afterEach, 'afterEach');
We may be able to get around this by creating a new 'done' function which waits for both the WebDriver promises and any other promises to finish. Should investigate.
Yeah I was thinking exactly the same.
@hankduan this might be a fun one to take a look at!
I guess this also means I can't do anything asynchronous in it calls either...
I've fixed this here: https://github.com/angular/protractor/pull/728
I have async call inside the "it" and that is never been executed. Can you point me what's wrong in the below code please?
describe('vCDBubble', function() { it('Check Org exists on the vCD', function(done) {
console.log("Ourside the async"); setTimeout(function(){ x = 1; console.log("Inside the async"); done(); }, 500); });
});
The PR will be in the next release (May 24, 2014). You can use master if you need the code right now
Yes i like to clone the master and do my work. Can you guide how to clone and install the master please ?
Just a 'git clone https://github.com/angular/protractor.git' should do it Alternatively, you can apply the changes from jasminewd/index.js in https://github.com/angular/protractor/commit/43ff9e5e2a05b4e51d04133122d763ef4ed3f2d1 to the version you have temporarily to run your test
Whichever method you follow, you can just revert it once 0.23 gets released