[FIX] ugly race condition hack

bzr revid: ddm@openerp.com-20140110132734-n0ip9wyinw19c76e
This commit is contained in:
ddm@openerp.com 2014-01-10 14:27:34 +01:00
parent 4998764d40
commit 44adcd9f2d
3 changed files with 20 additions and 25 deletions

View File

@ -291,7 +291,7 @@
var self = this;
var testId = 'test_'+tour.id+'_tour';
this.tours.push(tour);
var stepDelay = 500; //ms
var defaultDelay = 500; //ms
var test = {
id: tour.id,
run: function (force) {
@ -306,29 +306,26 @@
function next () {
var nextStep = actionSteps.shift();
if (nextStep) {
// Ensure the previous step has been fully propagated
setTimeout(function () {
setTimeout(function () {
executeStep(nextStep);
}, stepDelay);
}, 0);
executeStep(nextStep);
} else {
window.localStorage.removeItem(testId);
}
}
if (step.triggers) step.triggers(next);
var $element = $(step.element);
if (step.snippet && step.trigger === 'drag') {
website.TestConsole.dragAndDropSnippet(step.snippet);
} else if (step.trigger && step.trigger.id === 'change') {
$element.trigger($.Event("change", { srcElement: $element }));
} else if (step.sampleText) {
$element.val(step.sampleText);
$element.trigger($.Event("change", { srcElement: $element }));
} else if ($element.is(":visible")) { // Click by default
$element.trigger($.Event("click", { srcElement: $element }));
}
if (!step.triggers) next();
setTimeout(function () {
if (step.triggers) step.triggers(next);
var $element = $(step.element);
if (step.snippet && step.trigger === 'drag') {
website.TestConsole.dragAndDropSnippet(step.snippet);
} else if (step.trigger && step.trigger.id === 'change') {
$element.trigger($.Event("change", { srcElement: $element }));
} else if (step.sampleText) {
$element.val(step.sampleText);
$element.trigger($.Event("change", { srcElement: $element }));
} else if ($element.is(":visible")) { // Click by default
$element.trigger($.Event("click", { srcElement: $element }));
}
if (!step.triggers) next();
}, step.delay || defaultDelay);
}
var url = new website.UrlParser(window.location.href);
if (tour.path && url.pathname !== tour.path) {
@ -347,11 +344,7 @@
executeStep(currentStep);
});
} else {
setTimeout(function () {
setTimeout(function () {
executeStep(currentStep);
}, stepDelay);
}, 0);
executeStep(currentStep);
}
}
},

View File

@ -148,6 +148,7 @@
title: "Publish Your Post",
content: "Your blog post is not yet published. You can update this draft version and publish it once you are ready.",
trigger: 'click',
delay: 5000,
},
{
stepId: 'end-tutorial',

View File

@ -146,6 +146,7 @@
title: "Publish your event",
content: "Click to publish your event.",
trigger: 'click',
delay: 5000,
},
{
stepId: 'customize-event',