[FIX] website_blog: tour

bzr revid: chm@openerp.com-20140121152307-kx92ee0za0w0pprr
This commit is contained in:
Christophe Matthieu 2014-01-21 16:23:07 +01:00
parent c35ac33cf1
commit b38d4d8a81
4 changed files with 19 additions and 8 deletions

View File

@ -156,8 +156,8 @@
this.stop();
} else if (index >= 0) {
var self = this;
$('.popover.tour').remove();
setTimeout(function () {
$('.popover.tour').remove();
setTimeout(function () {
self.tour.goto(index);
}, 0);
@ -346,7 +346,7 @@
window.localStorage.setItem("last-"+testId, tryStep);
if (tryStep > 2) {
window.localStorage.removeItem(testId);
throw "Test: '" + testId + "' cycling stape: '" + step.stepId + "'";
throw "Test: '" + testId + "' cycling step: '" + step.stepId + "'";
}
var _next = false;
@ -365,12 +365,12 @@
}
overlapsCrash = setTimeout(function () {
window.localStorage.removeItem(testId);
throw "Test: '" + testId + "' can't resolve stape: '" + step.stepId + "'";
throw "Test: '" + testId + "' can't resolve step: '" + step.stepId + "'";
}, (step.delay || defaultDelay) + 500);
var $element = $(step.element);
if (step.triggers) step.triggers(next);
if ((step.trigger === 'reload' || step.trigger.url) && _next) return;
if ((step.trigger === 'reload' || (step.trigger && step.trigger.url)) && _next) return;
if (step.snippet && step.trigger === 'drag') {
website.TestConsole.dragAndDropSnippet(step.snippet);

View File

@ -635,6 +635,9 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
</div>
</div>
<div class="col-md-4 mb32">
<div groups="base.group_website_publisher" t-ignore="true" class="pull-right css_editable_mode_hidden" t-att-style="style or ''">
<a class="btn btn-primary" t-att-href="'/web#return_label=Website&amp;model=%s&amp;id=%s' % (res_company._name, res_company.id)" title='Edit in backend'>Edit</a>
</div>
<t t-call="website.company_description"/>
</div>
</div>

View File

@ -62,7 +62,9 @@
placement: 'right',
title: "Create Blog Post",
content: "Click <em>Continue</em> to create the blog post.",
trigger: 'click',
trigger: {
url: /blogpost\/[0-9]+\/.*/,
},
},
{
stepId: 'post-page',
@ -139,7 +141,7 @@
title: "Save Your Blog",
content: "Click the <em>Save</em> button to record changes on the page.",
template: self.popover({ fixed: true }),
trigger: 'click',
trigger: 'reload',
},
{
stepId: 'publish-post',

View File

@ -15,9 +15,15 @@ testRunner.run(function websiteSaleTest (page, timeout) {
window.openerp.website.TestConsole.test('shoptest').run(true);
});
waitFor(function testExecuted () {
return page.evaluate(function () { return window.$ && $('#wrap:contains("Order Confirmed")').length; });
return page.evaluate(function () {
console.err($('#wrap:contains("Order Confirmed")'));
console.err("-----------------------");
console.err($('#wrap').text());
console.err("-----------------------");
return window.$ && $('#wrap:contains("Order Confirmed")').length;
});
}, function finish () {
console.log('{ "website_sale": "success" }');
console.log('{ "event": "success" }');
phantom.exit();
}, 4*timeout/5);
}, timeout/5);