Last active
September 7, 2016 08:35
-
-
Save wilk/11fe763f593a4deae0210f16d5fa04a9 to your computer and use it in GitHub Desktop.
Sencha Test - ST.play
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beforeAll(function (done) { | |
console.log('BEFORE ALL'); | |
Ext.Ajax.request({ | |
url: AN_URL, | |
method: 'GET', | |
// the http request is going well, so let's skip the failure fn definition | |
success: function () { | |
console.log('starting'); | |
ST.play([ | |
{fn: function (next) { | |
console.log('first'); | |
ST.component(aCmpSelector) | |
.wait(aConditionFn) // this function returns a boolean | |
.and(function () { | |
console.log('end first'); | |
next(); | |
}); | |
}}, | |
{fn: function (next) { | |
console.log('second'); | |
ST.component(anotherCmpSelector) | |
.wait(anotherConditionFn) // this function returns a boolean | |
.and(function () { | |
console.log('end second'); | |
next(); | |
}); | |
}}, | |
{fn: function (next) { | |
console.log('third'); | |
var store = Ext.getStore('aStoreId'); | |
if (store.isLoaded()) return next; | |
store.on('load', next, next, {single: true}); | |
}} | |
], function () { | |
console.log('finishing'); | |
done(); | |
}); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment