[IMP] *: activate automatic tour tests

* project, crm, point_of_sale, website, website_sale, website_blog,
website_event, website_forum
This commit is contained in:
qsm-odoo
2016-07-18 14:22:29 +02:00
parent 35a264144e
commit eaf8e82efb
19 changed files with 123 additions and 579 deletions
+28 -15
View File
@@ -6,12 +6,14 @@ var tour = require('web_tour.tour');
var _t = core._t;
tour.register('crm_tour', [{
tour.register('crm_tour', {
url: "/web",
}, [tour.STEPS.MENU_MORE, {
trigger: '.o_app[data-menu-xmlid="sales_team.menu_base_partner"], .oe_menu_toggler[data-menu-xmlid="sales_team.menu_base_partner"]',
content: _t("Ready to boost you sales? Your <b>sales pipeline</b> can be found here, under this app."),
position: 'bottom',
}, {
trigger: ".o_welcome_content .o_dashboard_action",
trigger: ".o_sales_dashboard .o_dashboard_action[name=\"crm.action_your_pipeline\"]:last",
extra_trigger: '.o_sales_dashboard',
content: _t("Let\'s have a look at your opportunities pipeline."),
position: "bottom"
@@ -21,24 +23,39 @@ tour.register('crm_tour', [{
content: _t("Click here to <b>create your first opportunity</b> and add it to your pipeline."),
position: "right"
}, {
trigger: ".o_opportunity_kanban .o_kanban_record:nth-child(2)",
content: _t("<b>Drag &amp; drop opportunities</b> between columns as you progress in your sales cycle."),
position: "right"
trigger: ".modal-body input:first",
auto: true,
run: function (actions) {
actions.auto();
actions.auto(".modal-footer .btn-primary");
},
}, {
trigger: ".o_kanban_record .oe_kanban_status_red",
trigger: ".o_opportunity_kanban .o_kanban_group:first-child .o_kanban_record:last-child",
content: _t("<b>Drag &amp; drop opportunities</b> between columns as you progress in your sales cycle."),
position: "right",
run: "drag_and_drop .o_opportunity_kanban .o_kanban_group:nth-child(2)",
}, {
trigger: ".o_kanban_record:not(.o_updating) .oe_kanban_status_red",
extra_trigger: ".o_opportunity_kanban",
content: _t("This opportunity has <b>no next activity scheduled</b>. <i>Click to set one.</i>"),
position: "bottom"
}, {
trigger: ".o_recommended_activity .o_radio_item:first()",
trigger: ".o_recommended_activity .o_radio_item",
extra_trigger: ".o_opportunity_kanban",
content: _t("<p>You will be able to customize your followup activities. Examples:</p><ol><li>introductory email</li><li>call 10 days after</li><li>second call 3 days after, ...</li></ol><p class='mb0'><i>Select a standard activity for now on.</i></p>"),
position: "left"
position: "left",
run: function (actions) {
actions.auto(this.$anchor.children("input").first());
actions.auto(".modal-footer .btn-primary");
},
}, {
trigger: ".o_kanban_record",
extra_trigger: ".o_opportunity_kanban",
content: _t("Click on an opportunity to zoom to it."),
position: "bottom"
position: "bottom",
run: function (actions) {
actions.auto(".o_kanban_record .oe_kanban_action[data-type=edit]");
},
}, {
trigger: ".o_opportunity_form .o_chatter_button_new_message",
content: _t('<p><b>Send messages</b> to your prospect and get replies automatically attached to this opportunity.</p><p class="mb0">Type <i>\'@\'</i> to mention people - it\'s like cc-ing on emails.</p>'),
@@ -48,12 +65,8 @@ tour.register('crm_tour', [{
extra_trigger: '.o_opportunity_form',
content: _t("Use the breadcrumbs to <b>go back to your sales pipeline</b>."),
position: "bottom"
}, {
trigger: ".o_main_navbar .o_menu_toggle",
content: _t('Click the <i>Home icon</i> to navigate across apps.'),
edition: "enterprise",
position: "bottom"
}, {
}, tour.STEPS.TOGGLE_APPSWITCHER,
tour.STEPS.MENU_MORE, {
trigger: '.o_app[data-menu-xmlid="base.menu_administration"], .oe_menu_toggler[data-menu-xmlid="base.menu_administration"]',
content: _t("Configuration options are available in the Settings app."),
position: "bottom"
+1
View File
@@ -4,3 +4,4 @@ import test_crm_lead
import test_new_lead_notification
import test_lead2opportunity
import test_crm_activity
import test_crm_ui
+9
View File
@@ -0,0 +1,9 @@
import openerp.tests
# Part of Odoo. See LICENSE file for full copyright and licensing details.
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_01_crm_tour(self):
self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('crm_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.crm_tour", login="admin")
+3 -1
View File
@@ -6,7 +6,9 @@ var tour = require('web_tour.tour');
var _t = core._t;
tour.register('point_of_sale_tour', [{
tour.register('point_of_sale_tour', {
url: "/web",
}, [{
trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"], .oe_menu_toggler[data-menu-xmlid="point_of_sale.menu_point_root"]',
content: _t("Ready to launch your <b>point of sale</b>? <i>Click here</i>."),
position: 'bottom',
+1
View File
@@ -3,3 +3,4 @@
import test_point_of_sale_flow
import test_frontend
import test_point_of_sale_ui
@@ -0,0 +1,9 @@
import openerp.tests
# Part of Odoo. See LICENSE file for full copyright and licensing details.
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_01_point_of_sale_tour(self):
self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('point_of_sale_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.point_of_sale_tour", login="admin")
+29 -14
View File
@@ -6,7 +6,9 @@ var tour = require('web_tour.tour');
var _t = core._t;
tour.register('project_tour', [{
tour.register('project_tour', {
url: "/web",
}, [tour.STEPS.MENU_MORE, {
trigger: '.o_app[data-menu-xmlid="base.menu_main_pm"], .oe_menu_toggler[data-menu-xmlid="base.menu_main_pm"]',
content: _t('Want a better way to <b>manage your projects</b>? <i>It starts here.</i>'),
position: 'bottom',
@@ -20,10 +22,17 @@ tour.register('project_tour', [{
trigger: 'input.o_project_name',
content: _t('Choose a <b>project name</b>. (e.g. Website Launch, Product Development, Office Party, etc.)'),
position: 'right',
run: function (actions) {
actions.auto();
actions.auto(".modal:visible .btn.btn-primary");
},
}, {
trigger: '.o_project_kanban .o_kanban_record:first-child',
content: _t('Click on the card to <b>go to your project</b> and start organizing tasks.'),
position: 'right',
run: function (actions) {
actions.auto(this.$anchor.find(".o_project_kanban_box:first > a"));
},
}, {
trigger: ".o_kanban_project_tasks .o_column_quick_create",
content: _t("Add columns to configure <b>stages for your tasks</b>.<br/><i>e.g. Specification &gt; Development &gt; Done</i>"),
@@ -34,22 +43,26 @@ tour.register('project_tour', [{
content: _t("Now that the project is setup, <b>create a few tasks</b>."),
position: "right"
}, {
trigger: ".o_kanban_record:nth-child(3)",
trigger: ".o_kanban_group:first-child .o_kanban_record:last-child",
extra_trigger: '.o_kanban_project_tasks',
content: _t("<b>Drag &amp; drop tasks</b> between columns as you work on them."),
position: "right"
position: "right",
run: "drag_and_drop .o_kanban_group:nth-child(2)",
}, {
trigger: ".o_kanban_record .o_priority_star",
extra_trigger: '.o_kanban_project_tasks',
content: _t("<b>Star tasks</b> to mark team priorities."),
position: "bottom"
position: "bottom",
}, {
trigger: ".o_kanban_record",
extra_trigger: '.o_kanban_project_tasks',
content: _t("Click on a card to get the details of the task."),
position: "bottom"
position: "bottom",
run: function (actions) {
actions.auto(".o_kanban_record .oe_kanban_action[data-type=edit]");
},
}, {
trigger: ".o_form_button_edit:visible",
trigger: ".o_form_button_edit",
extra_trigger: '.o_form_project_tasks',
content: _t('Click on this button to modify the task.'),
position: "bottom"
@@ -57,7 +70,13 @@ tour.register('project_tour', [{
trigger: ".o_form_field.o_task_user_field",
extra_trigger: '.o_form_project_tasks.o_form_editable',
content: _t('<b>Assign the task</b> to someone. <i>You can create and invite a new user on the fly.</i>'),
position: "bottom"
position: "bottom",
run: function (actions) {
actions.text("Demo User", this.$anchor.find("input"));
},
}, {
trigger: ".ui-autocomplete > li > a",
auto: true,
}, {
trigger: ".o_form_button_save",
extra_trigger: '.o_form_project_tasks.o_form_editable',
@@ -65,15 +84,11 @@ tour.register('project_tour', [{
position: "bottom"
}, {
trigger: ".breadcrumb li:not(.active):last",
extra_trigger: '.o_form_project_tasks',
extra_trigger: '.o_form_project_tasks.o_form_readonly',
content: _t("Click on layers in the path to easily <b>return to tasks</b>."),
position: "bottom"
}, {
trigger: ".o_main_navbar .o_menu_toggle",
content: _t('Click the <i>Home icon</i> to navigate across apps.'),
edition: "enterprise",
position: "bottom"
}, {
}, tour.STEPS.TOGGLE_APPSWITCHER,
tour.STEPS.MENU_MORE, {
trigger: '.o_app[data-menu-xmlid="base.menu_administration"], .oe_menu_toggler[data-menu-xmlid="base.menu_administration"]',
content: _t("Configuration options are available in the Settings app."),
position: "bottom"
+1 -1
View File
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
from . import test_project_base, test_project_flow, test_access_rights
from . import test_project_base, test_project_flow, test_access_rights, test_project_ui
+9
View File
@@ -0,0 +1,9 @@
import openerp.tests
# Part of Odoo. See LICENSE file for full copyright and licensing details.
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_01_project_tour(self):
self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('project_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.project_tour", login="admin")
@@ -2,118 +2,12 @@ odoo.define("website.tour.banner", 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: 'banner',
mode: 'test',
name: _t("Build a page"),
path: '/page/homepage',
steps: [
{
waitNot: 'body.editor_enable',
title: _t("Welcome to your website!"),
content: _t("This tutorial will guide you to build your home page. We will start by adding a banner."),
popover: { next: _t("Start Tutorial"), end: _t("Skip It") },
},
{
waitNot: '.popover.tour',
element: 'a[data-action=edit]',
placement: 'bottom',
title: _t("Edit this page"),
content: _t("Every page of your website can be modified through the <i>Edit</i> button."),
popover: { fixed: true },
},
{
snippet: '#snippet_structure .oe_snippet:eq(1)',
placement: 'bottom',
title: _t("Drag & Drop a Banner"),
content: _t("Drag the Banner block and drop it in your page."),
popover: { fixed: true },
},
{
waitFor: '.oe_overlay_options .oe_options:visible',
element: '#wrapwrap .s_text_block_image_fw h2',
placement: 'top',
title: _t("Customize banner's text"),
content: _t("Click in the title text and start editing it."),
sampleText: 'Here, a customized text',
},
{
waitFor: '#wrapwrap .s_text_block_image_fw h2:not(:containsExact(\"Headline\"))',
element: '.oe_snippet_parent:visible',
placement: 'bottom',
title: _t("Get banner properties"),
content: _t("Select the parent container to get the global options of the banner."),
popover: { fixed: true },
},
{
element: '.oe_overlay_options .oe_options:visible',
placement: 'bottom',
title: _t("Customize the banner"),
content: _t("Customize any block through this menu. Try to change the background of the banner."),
popover: { next: _t("Continue") },
},
{
waitNot: '.popover.tour',
snippet: '#snippet_structure .oe_snippet:eq(6)',
placement: 'bottom',
title: _t("Drag & Drop This Block"),
content: _t("Drag the <em>'Features'</em> block and drop it below the banner."),
popover: { fixed: true },
},
{
waitFor: '.oe_overlay_options .oe_options:visible',
element: 'button[data-action=save]',
placement: 'bottom',
title: _t("Save your modifications"),
content: _t("Publish your page by clicking on the <em>'Save'</em> button."),
popover: { fixed: true },
},
{
waitNot: 'body.editor_enable',
title: _t("Good Job!"),
content: _t("Well done, you created your homepage."),
popover: { next: _t("Continue") },
},
{
waitNot: '.popover.tour',
element: 'a[data-action=show-mobile-preview]',
placement: 'bottom',
title: _t("Test Your Mobile Version"),
content: _t("Let's check how your homepage looks like on mobile devices."),
popover: { fixed: true },
},
{
element: '.modal-dialog:has(#mobile-viewport) button[data-dismiss=modal]',
placement: 'right',
title: _t("Check Mobile Preview"),
content: _t("Scroll to check rendering and then close the mobile preview."),
},
{
waitNot: '.modal-dialog:has(#mobile-viewport)',
element: '#content-menu-button',
placement: 'right',
title: _t("Pages and menus"),
content: _t("The 'Content' menu allows you to rename and delete pages or add them to the top menu."),
popover: { next: _t("Continue") },
},
{
waitNot: '.popover.tour',
element: '#oe_main_menu_navbar a[data-action=new_page]',
placement: 'bottom',
title: _t("Add new pages"),
content: _t("Use this button to add pages"),
popover: { next: _t("Close Tutorial") },
},
]
});
tour.register("banner", {
url: "/",
}, [{
+1 -1
View File
@@ -9,7 +9,7 @@ class TestUi(openerp.tests.HttpCase):
self.phantom_js("/", "console.log('ok')", "'website.snippets.editor' in odoo.__DEBUG__.services", login='admin')
def test_03_admin_tour_banner(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('banner', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.banner", login='admin')
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('banner')", "odoo.__DEBUG__.services['web_tour.tour'].tours.banner", login='admin')
def test_03_admin_tour_rte_translator(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('rte_translator', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.rte_translator", login='admin')
@@ -2,142 +2,24 @@ odoo.define("website_blog.tour", 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: 'blog',
mode: 'test',
name: _t("Create a blog post"),
steps: [
{
title: _t("New Blog Post"),
content: _t("Let's go through the first steps to write beautiful blog posts."),
popover: { next: _t("Start Tutorial"), end: _t("Skip") },
},
{
element: '#oe_main_menu_navbar a[data-action=new_page]',
placement: 'bottom',
title: _t("Add Content"),
content: _t("Use this button to create a new blog post like any other document (page, menu, products, event, ...)."),
popover: { fixed: true },
},
{
element: 'a[data-action=new_blog_post]',
placement: 'left',
title: _t("New Blog Post"),
content: _t("Select this menu item to create a new blog post."),
popover: { fixed: true },
},
{
waitFor: '#o_scroll .oe_snippet',
title: _t("Blog Post Created"),
content: _t("This is your new blog post. Let's edit it."),
popover: { next: _t("Continue") },
},
{
element: 'h1[data-oe-expression="blog_post.name"]',
placement: 'top',
title: _t("Post Headline"),
sampleText:'Blog Post Title',
content: _t("Write a title, the subtitle is optional."),
popover: { fixed: true },
},
{
waitNot: '#wrap h1[data-oe-expression="blog_post.name"]:'+'containsExact("")',
element: '#oe_manipulators .oe_overlay.oe_active a.btn.btn-primary.btn-sm',
placement: 'right',
title: _t("Customize Cover"),
content: _t("Change and customize your blog post cover."),
popover: { fixed: true },
},
{
element: 'a:'+ 'containsExact(' + _t("Change Cover")+ '):eq(1)',
placement: 'right',
title: _t("Cover"),
content: _t("Select this menu item to change blog cover."),
popover: { fixed: true },
},
{
waitFor: '.modal:has(.o_existing_attachment_cell:nth(1))',
element: '.modal .o_existing_attachment_cell:nth(1) img',
placement: 'top',
title: _t("Choose an image"),
content: _t("Choose an image from the library."),
popover: { fixed: true },
},
{
waitFor: '.o_existing_attachment_cell.o_selected',
element: '.modal-content button.o_save_button',
placement: 'top',
title: _t("Save"),
content: _t("Click on '<em>Save</em>' to set the picture as cover."),
popover: { fixed: true },
},
{
waitNot: '.modal-content:visible',
element: '.blog_content section.mt16',
placement: 'top',
title: _t("Content"),
content: _t("Start writing your story here."),
sampleText: ' ',
popover: { fixed: true },
},
{
waitNot: '#blog_content section:first p:first:containsExact(' + _t('Start writing here...') + ')',
element: 'button[data-action=save]',
placement: 'bottom',
title: _t("Save your modifications once you are done"),
content: _t("Click on '<em>Save</em>' button to record changes on the page."),
popover: { fixed: true },
},
{
waitNot: 'button[data-action=save]:visible',
element: 'a[data-action=show-mobile-preview]',
placement: 'bottom',
title: _t("Mobile Preview"),
content: _t("Click on the mobile icon to preview how your blog post will be displayed on a mobile device."),
popover: { fixed: true },
},
{
waitFor: '.modal:has(#mobile-viewport):visible',
element: '.modal:has(#mobile-viewport) button[data-dismiss=modal]',
placement: 'right',
title: _t("Check Mobile Preview"),
content: _t("Scroll to check rendering and then close the mobile preview."),
popover: { fixed: true },
},
{
waitNot: '.modal:has(#mobile-viewport) button[data-dismiss=modal]:visible',
element: 'button.btn-danger.js_publish_btn',
placement: 'top',
title: _t("Publishing status"),
content: _t(" Click on this button to send your blog post online."),
popover: { fixed: true },
},
{
waitFor: '.js_publish_management button.js_publish_btn.btn-success:visible',
title: "Thanks!",
content: _t("This tutorial is over. To discover more features and improve the content of this page, go to the upper left customize menu. You can also add some cool content with your text in the edit mode with the upper right button."),
popover: { next: _t("Close Tutorial") },
},
]
});
tour.register("blog", {
url: "/",
}, [{
}, [tour.STEPS.WEBSITE_NEW_PAGE, {
trigger: "a[data-action=new_blog_post]",
content: _t("Select this menu item to create a new blog post."),
position: "bottom",
}, {
trigger: "h1[data-oe-expression=\"blog_post.name\"]",
extra_trigger: "body.editor_has_snippets",
content: _t("Write a title, the subtitle is optional."),
position: "top",
run: "text",
}, {
trigger: "#oe_manipulators .oe_overlay.oe_active a.btn.btn-primary.btn-sm",
extra_trigger: "#wrap h1[data-oe-expression=\"blog_post.name\"]:not(:containsExact(\"\"))",
@@ -161,6 +43,10 @@ odoo.define("website_blog.tour", function (require) {
trigger: ".blog_content section.mt16",
content: _t("Start writing your story here."),
position: "top",
run: function (actions) {
actions.auto();
actions.text("Blog content", this.$anchor.find("p"));
},
}, {
trigger: "button[data-action=save]",
extra_trigger: "#blog_content section:first p:first:not(:containsExact(" + _t("Start writing here...") + "))",
+1 -1
View File
@@ -4,4 +4,4 @@ import openerp.tests
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_admin(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('blog', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.blog", login='admin')
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('blog')", "odoo.__DEBUG__.services['web_tour.tour'].tours.blog", login='admin')
@@ -2,94 +2,15 @@ odoo.define("website_event.tour", 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: 'event',
mode: 'test',
name: _t("Create an event"),
steps: [
{
title: _t("Create an Event"),
content: _t("Let's go through the first steps to publish a new event."),
popover: { next: _t("Start Tutorial"), end: _t("Skip It") },
},
{
element: '#oe_main_menu_navbar a[data-action=new_page]',
placement: 'bottom',
title: _t("Add Content"),
content: _t("This button allows you to create new pages, events, menus, etc."),
popover: { fixed: true },
},
{
element: 'a[data-action=new_event]',
placement: 'left',
title: _t("New Event"),
content: _t("Click here to create a new event."),
popover: { fixed: true },
},
{
element: '.modal-dialog #editor_new_event input[type=text]',
sampleText: 'Advanced Technical Training',
placement: 'right',
title: _t("Create an Event Name"),
content: _t("Create a name for your new event and click <em>'Continue'</em>. e.g: Technical Training"),
},
{
waitNot: '.modal-dialog #editor_new_event input[type=text]:not([value!=""])',
element: '.modal-dialog button.btn-primary.btn-continue',
placement: 'right',
title: _t("Create Event"),
content: _t("Click <em>Continue</em> to create the event."),
},
{
waitFor: '#o_scroll .oe_snippet',
title: _t("New Event Created"),
content: _t("This is your new event page. We will edit the event presentation page."),
popover: { next: _t("Continue") },
},
{
snippet: '#snippet_structure .oe_snippet:eq(2)',
placement: 'bottom',
title: _t("Drag & Drop a block"),
content: _t("Drag the 'Image-Text' block and drop it in your page."),
popover: { fixed: true },
},
{
element: 'button[data-action=save]',
placement: 'bottom',
title: _t("Save your modifications"),
content: _t("Once you click on save, your event is updated."),
popover: { fixed: true },
},
{
waitNot: '#web_editor-top-edit',
element: 'button.btn-danger.js_publish_btn',
placement: 'top',
title: _t("Publish your event"),
content: _t("Click to publish your event."),
},
{
waitFor: '.js_publish_management button.js_publish_btn.btn-success:visible',
element: '.js_publish_management button[data-toggle="dropdown"]',
placement: 'left',
title: _t("Customize your event"),
content: _t("Click here to customize your event further."),
},
{
element: '.js_publish_management ul>li>a:last:visible',
},
]
});
tour.register("event", {
url: "/",
}, [{
}, [tour.STEPS.WEBSITE_NEW_PAGE, {
trigger: "a[data-action=new_event]",
content: _t("Click here to create a new event."),
position: "bottom",
@@ -103,9 +24,10 @@ odoo.define("website_event.tour", function (require) {
content: _t("Click <em>Continue</em> to create the event."),
position: "right",
}, {
trigger: "#snippet_structure .oe_snippet:eq(2)",
trigger: "#snippet_structure .oe_snippet:eq(2) .oe_snippet_thumbnail",
content: _t("Drag this block and drop it in your page."),
position: "bottom",
run: "drag_and_drop",
}, {
trigger: "button[data-action=save]",
content: _t("Once you click on save, your event is updated."),
+1 -1
View File
@@ -5,4 +5,4 @@ import odoo.tests
@odoo.tests.common.post_install(True)
class TestUi(odoo.tests.HttpCase):
def test_admin(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('event', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.event", login='admin')
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('event')", "odoo.__DEBUG__.services['web_tour.tour'].tours.event", login='admin')
@@ -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,25 +36,36 @@ 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."),
@@ -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")
@@ -2,122 +2,15 @@ odoo.define("website_sale.tour_shop", 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: 'shop',
mode: 'test',
name: _t("Create a product"),
steps: [
{
title: _t("Welcome to your shop"),
content: _t("You successfully installed the e-commerce. This guide will help you to create your product and promote your sales."),
popover: { next: _t("Start Tutorial"), end: _t("Skip It") },
},
{
element: '#oe_main_menu_navbar a[data-action=new_page]',
placement: 'bottom',
title: _t("Create your first product"),
content: _t("Click here to add a new product."),
popover: { fixed: true },
},
{
element: 'a[data-action=new_product]',
placement: 'left',
title: _t("Create a new product"),
content: _t("Select <em>New Product</em> to create it and manage its properties to boost your sales."),
popover: { fixed: true },
},
{
element: '.modal-dialog #editor_new_product input[type=text]',
sampleText: 'New Product',
placement: 'right',
title: _t("Choose name"),
content: _t("Enter a name for your new product"),
},
{
waitNot: '.modal-dialog #editor_new_product input[type=text]:not([value!=""])',
element: '.modal-dialog button.btn-primary.btn-continue',
placement: 'right',
title: _t("Create Product"),
content: _t("Click on <em>Continue</em> to create the product."),
},
{
waitFor: '#o_scroll .oe_snippet',
title: _t("New product created"),
content: _t("This page contains all the information related to the new product."),
popover: { next: _t("Continue") },
},
{
element: '.product_price .oe_currency_value:visible:first',
sampleText: '20.50',
placement: 'bottom',
title: _t("Change the price"),
content: _t("Edit the price of this product by clicking on the amount."),
},
{
waitNot: '.product_price .oe_currency_value:visible:first:containsExact(1.00)',
element: '#wrap img.product_detail_img',
placement: 'top',
title: _t("Update image"),
content: _t("Click here to set an image describing your product."),
},
{
element: '.modal .o_existing_attachment_cell:nth(2) img',
placement: 'top',
title: _t("Choose an image"),
content: _t("Choose an image from the library."),
popover: { fixed: true },
onload: function () {
$('form[action="/web_editor/attachment/add"] .well > *').hide();
}
},
{
element: '.modal .btn.o_save_button',
placement: 'right',
waitFor: '.o_existing_attachment_cell.o_selected',
title: _t("Save"),
content: _t("Click on <em>Save</em> to add the image to the product description."),
},
{
waitNot: '.modal-content:visible',
snippet: '#snippet_structure .oe_snippet:eq(8)',
placement: 'bottom',
title: _t("Drag & Drop a block"),
content: _t("Drag this website block and drop it in your page."),
popover: { fixed: true },
},
{
element: 'button[data-action=save]',
placement: 'bottom',
title: _t("Save your modifications"),
content: _t("Once you click on <em>Save</em>, your product is updated."),
popover: { fixed: true },
},
{
waitNot: '#web_editor-top-edit',
element: '.js_publish_management button.js_publish_btn.btn-danger',
placement: 'top',
title: _t("Publish your product"),
content: _t("Click on <em>Publish</em> your product so your customers can see it."),
},
{
waitFor: '.js_publish_management button.js_publish_btn.btn-success:visible',
title: _t("Congratulations"),
content: _t("Congratulations! You just created and published your first product."),
popover: { next: _t("Close Tutorial") },
},
]
});
tour.register("shop", {
url: "/",
}, [{
}, [tour.STEPS.WEBSITE_NEW_PAGE, {
trigger: "a[data-action=new_product]",
content: _t("Select <b>New Product</b> to create it and manage its properties to boost your sales."),
position: "bottom",
@@ -127,16 +20,16 @@ odoo.define("website_sale.tour_shop", function (require) {
position: "right",
}, {
trigger: ".modal-dialog button.btn-primary.btn-continue",
extra_trigger: ".modal-dialog #editor_new_product input[type=text][value!=\"\"]",
content: _t("Click on <em>Continue</em> to create the product."),
position: "right",
}, {
trigger: ".product_price .oe_currency_value:visible:first",
trigger: ".product_price .o_is_inline_editable .oe_currency_value",
content: _t("Edit the price of this product by clicking on the amount."),
position: "bottom",
run: "text 1.99",
}, {
trigger: "#wrap img.product_detail_img",
extra_trigger: ".product_price .oe_currency_value:visible:first:not(:containsExact(1.00))",
extra_trigger: ".product_price .o_is_inline_editable .oe_currency_value:not(:containsExact(1.00))",
content: _t("Click here to set an image describing your product."),
position: "top",
}, {
@@ -149,10 +42,11 @@ odoo.define("website_sale.tour_shop", function (require) {
content: _t("Click on <b>Save</b> to add the image to the product description."),
position: "right",
}, {
trigger: "#snippet_structure .oe_snippet:eq(8)",
trigger: "#snippet_structure .oe_snippet:eq(8) .oe_snippet_thumbnail",
extra_trigger: "body:not(.modal-open)",
content: _t("Drag this website block and drop it in your page."),
position: "bottom",
run: "drag_and_drop",
}, {
trigger: "button[data-action=save]",
content: _t("Once you click on <b>Save</b>, your product is updated."),
@@ -7,7 +7,7 @@ import odoo.tests
@odoo.tests.common.post_install(True)
class TestUi(odoo.tests.HttpCase):
def test_01_admin_shop_tour(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('shop', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.shop", login="admin")
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop", login="admin")
def test_02_admin_checkout(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('shop_buy_product', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.shop_buy_product", login="admin")