Skip to content

Instantly share code, notes, and snippets.

@wilk
Last active September 7, 2016 08:35
Show Gist options
  • Save wilk/11fe763f593a4deae0210f16d5fa04a9 to your computer and use it in GitHub Desktop.
Save wilk/11fe763f593a4deae0210f16d5fa04a9 to your computer and use it in GitHub Desktop.
Sencha Test - ST.play
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