diff options
| author | qsm-odoo <qsm@odoo.com> | 2016-07-13 14:06:33 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2016-07-18 14:22:29 +0200 |
| commit | eaf8e82efbe99eec013650890f7605d63526b7bc (patch) | |
| tree | dee31796f3b3ce6b13072530a2d0d355539dd342 /addons/website_forum | |
| parent | 35a264144e815b005767a92a037ebaa1bbe0a1b0 (diff) | |
[IMP] *: activate automatic tour tests
* project, crm, point_of_sale, website, website_sale, website_blog,
website_event, website_forum
Diffstat (limited to 'addons/website_forum')
| -rw-r--r-- | addons/website_forum/static/src/js/website_tour_forum.js | 134 | ||||
| -rw-r--r-- | addons/website_forum/tests/test_forum_process.py | 3 |
2 files changed, 13 insertions, 124 deletions
diff --git a/addons/website_forum/static/src/js/website_tour_forum.js b/addons/website_forum/static/src/js/website_tour_forum.js index d0d2f2e8d85..508ca40b4c4 100644 --- a/addons/website_forum/static/src/js/website_tour_forum.js +++ b/addons/website_forum/static/src/js/website_tour_forum.js @@ -2,136 +2,15 @@ odoo.define("website_forum.tour_forum", function (require) { "use strict"; var core = require("web.core"); - var Tour = require("web.Tour"); var tour = require("web_tour.tour"); var base = require("web_editor.base"); var _t = core._t; base.ready().done(function () { - Tour.register({ - id: 'question', - mode: 'test', - name: _t("Create a question"), - steps: [ - { - title: _t("Create a Question!"), - content: _t("Let's go through the first steps to create a new question."), - popover: { next: _t("Start Tutorial"), end: _t("Skip It") }, - }, - { - title: _t("Add Content"), - element: '#oe_main_menu_navbar a[data-action=new_page]', - placement: 'bottom', - content: _t("Use this button to create a new forum like any other document (page, menu, products, event, ...)."), - popover: { fixed: true }, - }, - { - title: _t("New Forum"), - element: 'a[data-action=new_forum]', - placement: 'left', - content: _t("Select this menu item to create a new forum."), - popover: { fixed: true }, - }, - { - title: _t("Forum Name"), - element: '.modal #editor_new_forum input[type=text]', - sampleText:'New Forum', - placement: 'right', - content: _t("Enter a name for your new forum."), - }, - { - title: _t("Create Forum"), - waitNot: ".modal #editor_new_forum input[type=text]:propValue('')", - element: '.modal button.btn-primary', - placement: 'right', - content: _t("Click <em>Continue</em> to create the forum."), - }, - { - title: _t("New Forum Created"), - waitNot: '.modal:visible', - content: _t("This page contains all the information related to the new forum."), - popover: { next: _t("Continue") }, - }, - { - title: _t("Ask a Question"), - element: '.btn-block a:first', - placement: 'left', - content: _t("Ask the question in this forum by clicking on the button."), - }, - { - title: _t("Question Title"), - element: 'input[name=post_name]', - sampleText:'First Question Title', - placement: 'top', - content: _t("Give your question title."), - }, - { - title: _t("Question"), - waitNot: "input[name=post_name]:propValue('')", - element: '.note-editable p', - sampleText: 'First Question', - placement: 'top', - content: _t("Put your question here."), - }, - { - title: _t("Give Tag"), - waitNot: '.note-editable p:containsExact("<br>")', - element: '.select2-choices', - placement: 'top', - content: _t("Insert tags related to your question."), - }, - { - title: _t("Post Question"), - waitNot: "input[id=s2id_autogen2]:propValue('Tags')", - element: 'button:contains("Post Your Question")', - placement: 'bottom', - content: _t("Click to post your question."), - }, - { - title: _t("New Question Created"), - waitFor: '.fa-star', - content: _t("This page contains the newly created questions."), - popover: { next: _t("Continue") }, - }, - { - title: _t("Answer"), - element: '.note-editable p', - sampleText: 'First Answer', - placement: 'top', - content: _t("Put your answer here."), - }, - { - title: _t("Post Answer"), - waitNot: '.note-editable p:containsExact("<br>")', - element: 'button:contains("Post Answer")', - placement: 'bottom', - content: _t("Click to post your answer."), - }, - { - title: _t("Answer Posted"), - waitFor: '.fa-check-circle', - content: _t("This page contains the newly created questions and its answers."), - popover: { next: _t("Continue") }, - }, - { - title: _t("Accept Answer"), - element: 'a[data-karma="20"]:first', - placement: 'right', - content: _t("Click here to accept this answer."), - }, - { - title: _t("Congratulations"), - waitFor: '.oe_answer_true', - content: _t("Congratulations! You just created and post your first question and answer."), - popover: { next: _t("Close Tutorial") }, - }, - ] - }); - tour.register("question", { url: "/", - }, [{ + }, [tour.STEPS.WEBSITE_NEW_PAGE, { trigger: "a[data-action=new_forum]", content: _t("Select this menu item to create a new forum."), position: "bottom", @@ -157,26 +36,37 @@ odoo.define("website_forum.tour_forum", function (require) { extra_trigger: "input[name=post_name]:not(:propValue(\"\"))", content: _t("Put your question here."), position: "bottom", + run: "text", }, { trigger: ".select2-choices", extra_trigger: ".note-editable p:not(:containsExact(\"<br>\"))", content: _t("Insert tags related to your question."), position: "top", + run: function (actions) { + actions.auto("input[id=s2id_autogen2]"); + }, }, { trigger: "button:contains(\"Post Your Question\")", extra_trigger: "input[id=s2id_autogen2]:not(:propValue(\"Tags\"))", content: _t("Click to post your question."), position: "bottom", }, { + trigger: ".modal-header button.close", + auto: true, + }, { trigger: ".note-editable p", content: _t("Put your answer here."), position: "bottom", + run: "text", }, { trigger: "button:contains(\"Post Answer\")", extra_trigger: ".note-editable p:not(:containsExact(\"<br>\"))", content: _t("Click to post your answer."), position: "bottom", }, { + trigger: ".modal-header button.close", + auto: true, + }, { trigger: "a[data-karma=\"20\"]:first", content: _t("Click here to accept this answer."), position: "right", diff --git a/addons/website_forum/tests/test_forum_process.py b/addons/website_forum/tests/test_forum_process.py index e367c845af0..18f8812346e 100644 --- a/addons/website_forum/tests/test_forum_process.py +++ b/addons/website_forum/tests/test_forum_process.py @@ -4,8 +4,7 @@ import openerp.tests @openerp.tests.common.post_install(True) class TestUi(openerp.tests.HttpCase): def test_01_admin_forum_tour(self): - self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('question', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.question", login="admin") + self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('question')", "odoo.__DEBUG__.services['web_tour.tour'].tours.question", login="admin") def test_02_demo_question(self): self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('forum_question', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.forum_question", login="demo") - |
