summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2016-08-25 15:03:30 +0200
committerqsm-odoo <qsm@odoo.com>2016-08-30 13:54:28 +0200
commit48fccec1f232f1725fa082f0ef8d0e05183d1f2b (patch)
treeca66f726c141de26365c7c06f949da6ee6838f38 /addons
parentd39fbea9ad5d8dc130171488297312a27cd347aa (diff)
[IMP] website_hr_recruitment: convert tours to use web_tour.tour
Diffstat (limited to 'addons')
-rw-r--r--addons/website_hr_recruitment/static/src/js/website_hr_recruitment_tour.js71
-rw-r--r--addons/website_hr_recruitment/tests/test_website_hr_recruitment.py2
2 files changed, 29 insertions, 44 deletions
diff --git a/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_tour.js b/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_tour.js
index a85d7760034..aedbdca8445 100644
--- a/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_tour.js
+++ b/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_tour.js
@@ -2,50 +2,35 @@ odoo.define('website_hr_recruitment.tour', function(require) {
'use strict';
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');
+ var tour = require("web_tour.tour");
- base.ready().done(function () {
- Tour.register({
- id: 'website_hr_recruitment_tour',
- name: "Test the hr applicants form",
- path: '/jobs/apply/3',
- mode: 'test',
- steps: [
- {
- title: "Complete name",
- element: "input[name=partner_name]",
- sampleText: "John Smith"
- },
- {
- title: "Complete Email",
- element: "input[name=email_from]",
- sampleText: "john@smith.com"
- },
- {
- title: "Complete phone number",
- element: "input[name=partner_phone]",
- sampleText: "118.218"
- },
- {
- title: "Complete Subject",
- element: "textarea[name=description]",
- sampleText: "### HR RECRUITMENT TEST DATA ###"
- },
- // TODO: Upload a file ?
- {
- title: "Send the form",
- element: ".o_website_form_send"
- },
- {
- title: "Check the form is submited without errors",
- waitFor: ".oe_structure:has(h1:contains('Thank you!'))"
- }
- ]
- });
- });
+ tour.register('website_hr_recruitment_tour', {
+ test: true,
+ url: '/jobs/apply/3',
+ wait_for: base.ready(),
+ }, [{
+ content: "Complete name",
+ trigger: "input[name=partner_name]",
+ run: "text John Smith"
+ }, {
+ content: "Complete Email",
+ trigger: "input[name=email_from]",
+ run: "text john@smith.com"
+ }, {
+ content: "Complete phone number",
+ trigger: "input[name=partner_phone]",
+ run: "text 118.218"
+ }, {
+ content: "Complete Subject",
+ trigger: "textarea[name=description]",
+ run: "text ### HR RECRUITMENT TEST DATA ###"
+ }, { // TODO: Upload a file ?
+ content: "Send the form",
+ trigger: ".o_website_form_send"
+ }, {
+ content: "Check the form is submited without errors",
+ trigger: ".oe_structure:has(h1:contains('Thank you!'))"
+ }]);
return {};
});
diff --git a/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py b/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py
index a84aee1ebaa..db68b4811d6 100644
--- a/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py
+++ b/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py
@@ -8,7 +8,7 @@ import odoo.tests
@odoo.tests.common.post_install(True)
class TestWebsiteHrRecruitmentForm(odoo.tests.HttpCase):
def test_tour(self):
- self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('website_hr_recruitment_tour', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.website_hr_recruitment_tour")
+ self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('website_hr_recruitment_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.website_hr_recruitment_tour.ready")
# get test cursor to read from same transaction browser is writing to
cr = self.registry.cursor()