[IMP] website_crm: convert tours to use web_tour.tour

This commit is contained in:
Christophe Matthieu
2016-08-30 13:54:28 +02:00
committed by qsm-odoo
parent ea1c061e11
commit 21e26f6009
2 changed files with 37 additions and 53 deletions
@@ -1,60 +1,44 @@
odoo.define('website_crm.tour', function(require) {
'use strict';
var tour = require('web_tour.tour');
var base = require('web_editor.base');
var core = require('web.core');
var Tour = require('web.Tour');
var Model = require('web.Model');
var Session = require('web.Session');
base.ready().done(function () {
Tour.register({
id: 'website_crm_tour',
name: "Test the contact us form",
path: '/page/contactus',
mode: 'test',
steps: [
{
title: "Complete name",
element: "input[name=contact_name]",
sampleText: "John Smith",
},
{
title: "Complete phone number",
element: "input[name=phone]",
sampleText: "118.218"
},
{
title: "Complete Email",
element: "input[name=email_from]",
sampleText: "john@smith.com"
},
{
title: "Complete Company",
element: "input[name=partner_name]",
sampleText: "Odoo S.A."
},
{
title: "Complete Subject",
element: "input[name=name]",
sampleText: "Useless message"
},
{
title: "Complete Subject",
element: "textarea[name=description]",
sampleText: "### TOUR DATA ###"
},
{
title: "Send the form",
element: ".o_website_form_send"
},
{
title: "Check we were redirected to the success page",
waitFor: "#wrap:has(h1:contains('Thanks')):has(div.alert-success)"
}
]
});
});
tour.register('website_crm_tour', {
test: true,
url: '/page/contactus',
wait_for: base.ready(),
}, [{
content: "Complete name",
trigger: "input[name=contact_name]",
run: "text John Smith",
}, {
content: "Complete phone number",
trigger: "input[name=phone]",
run: "text 118.218"
}, {
content: "Complete Email",
trigger: "input[name=email_from]",
run: "text john@smith.com"
}, {
content: "Complete Company",
trigger: "input[name=partner_name]",
run: "text Odoo S.A."
}, {
content: "Complete Subject",
trigger: "input[name=name]",
run: "text Useless message"
}, {
content: "Complete Subject",
trigger: "textarea[name=description]",
run: "text ### TOUR DATA ###"
}, {
content: "Send the form",
trigger: ".o_website_form_send"
}, {
content: "Check we were redirected to the success page",
trigger: "#wrap:has(h1:contains('Thanks')):has(div.alert-success)"
}]);
return {};
});
+1 -1
View File
@@ -10,7 +10,7 @@ import odoo.tests
class TestWebsiteCrm(odoo.tests.HttpCase):
def test_tour(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('website_crm_tour', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.website_crm_tour")
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('website_crm_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.website_crm_tour.ready")
# need environment using the test cursor as it's not committed
cr = self.registry.cursor()