It's now deprecated, assets bundles should be used instead.
import openerp.tests
-inject = [
- ("openerp.Tour", os.path.join(os.path.dirname(__file__), '../../web/static/src/js/tour.js')),
-]
-
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_admin(self):
- self.phantom_js("/", "openerp.Tour.run('event_buy_tickets', 'test')", "openerp.Tour.tours.event_buy_tickets", inject=inject)
+ self.phantom_js("/", "openerp.Tour.run('event_buy_tickets', 'test')", "openerp.Tour.tours.event_buy_tickets")
def test_demo(self):
- self.phantom_js("/", "openerp.Tour.run('event_buy_tickets', 'test')", "openerp.Tour.tours.event_buy_tickets", login="demo", password="demo", inject=inject);
+ self.phantom_js("/", "openerp.Tour.run('event_buy_tickets', 'test')", "openerp.Tour.tours.event_buy_tickets", login="demo", password="demo");
def test_public(self):
- self.phantom_js("/", "openerp.Tour.run('event_buy_tickets', 'test')", "openerp.Tour.tours.event_buy_tickets", login=None, inject=inject);
+ self.phantom_js("/", "openerp.Tour.run('event_buy_tickets', 'test')", "openerp.Tour.tours.event_buy_tickets", login=None);
+++ /dev/null
-(function () {
- 'use strict';
-
- openerp.Tour.register({
- id: 'shop_buy_product',
- name: "Try to buy products",
- path: '/shop',
- mode: 'test',
- steps: [
- {
- title: "select ipod",
- element: '.oe_product_cart a:contains("iPod")',
- },
- {
- title: "select ipod 32GB",
- waitFor: '#product_detail',
- element: 'label:contains(32 GB) input',
- },
- {
- title: "click on add to cart",
- waitFor: 'label:contains(32 GB) input[checked]',
- element: 'form[action="/shop/cart/update"] .btn',
- },
- {
- title: "add suggested",
- waitNot: '#cart_products:contains("[A8767] Apple In-Ear Headphones")',
- element: '.oe_cart a:contains("Add to Cart")',
- },
- {
- title: "add one more iPod",
- waitFor: '.my_cart_quantity:contains(2)',
- element: '#cart_products tr:contains("32 GB") a.js_add_cart_json:eq(1)',
- },
- {
- title: "remove Headphones",
- waitFor: '#cart_products tr:contains("32 GB") input.js_quantity[value=2]',
- element: '#cart_products tr:contains("Apple In-Ear Headphones") a.js_add_cart_json:first',
- },
- {
- title: "set one iPod",
- waitNot: '#cart_products tr:contains("Apple In-Ear Headphones")',
- element: '#cart_products input.js_quantity',
- sampleText: '1',
- },
- {
- title: "go to checkout",
- waitFor: '#cart_products input.js_quantity[value=1]',
- element: 'a[href="/shop/checkout"]',
- },
- {
- title: "test with input error",
- element: 'form[action="/shop/confirm_order"] .btn:contains("Confirm")',
- onload: function (tour) {
- $("input[name='phone']").val("");
- },
- },
- {
- title: "test without input error",
- waitFor: 'form[action="/shop/confirm_order"] .has-error',
- element: 'form[action="/shop/confirm_order"] .btn:contains("Confirm")',
- onload: function (tour) {
- if ($("input[name='name']").val() === "")
- $("input[name='name']").val("website_sale-test-shoptest");
- if ($("input[name='email']").val() === "")
- $("input[name='email']").val("website_sale_test_shoptest@websitesaletest.optenerp.com");
- $("input[name='phone']").val("123");
- $("input[name='street']").val("123");
- $("input[name='city']").val("123");
- $("input[name='zip']").val("123");
- $("select[name='country_id']").val("21");
- },
- },
- {
- title: "select payment",
- element: '#payment_method label:has(img[title="Wire Transfer"]) input',
- },
- {
- title: "Pay Now",
- waitFor: '#payment_method label:has(input:checked):has(img[title="Wire Transfer"])',
- element: '.oe_sale_acquirer_button .btn[type="submit"]:visible',
- },
- {
- title: "finish",
- waitFor: '.oe_website_sale:contains("Thank you for your order")',
- }
- ]
- });
-
-}());
+++ /dev/null
-(function () {
- 'use strict';
-
- var _t = openerp._t;
-
- openerp.Tour.register({
- id: 'shop',
- 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: '#content-menu-button',
- placement: 'left',
- 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 'New Product' to create it and manage its properties to boost your sales."),
- popover: { fixed: true },
- },
- {
- element: '.modal #editor_new_product input[type=text]',
- sampleText: 'New Product',
- placement: 'right',
- title: _t("Choose name"),
- content: _t("Enter a name for your new product then click 'Continue'."),
- },
- {
- waitNot: '.modal input[type=text]:not([value!=""])',
- element: '.modal button.btn-primary',
- placement: 'right',
- title: _t("Create Product"),
- content: _t("Click <em>Continue</em> to create the product."),
- },
- {
- waitFor: 'body:has(button[data-action=save]:visible):has(.js_sale)',
- 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',
- sampleText: '20.50',
- placement: 'left',
- 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: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: 'img[alt=ipad]',
- placement: 'top',
- title: _t("Select an Image"),
- content: _t("Let's select an ipad image."),
- },
- {
- waitFor: '.media_selected img[alt=ipad]',
- element: '.modal-content button.save',
- placement: 'top',
- title: _t("Save this Image"),
- content: _t("Click on save to add the image to the product decsription."),
- },
- {
- waitNot: '.modal-content:visible',
- element: 'button[data-action=snippet]',
- placement: 'bottom',
- title: _t("Describe the Product"),
- content: _t("Insert blocks like text-image, or gallery to fully describe the product."),
- popover: { fixed: true },
- },
- {
- snippet: '#snippet_structure .oe_snippet:eq(7)',
- placement: 'bottom',
- title: _t("Drag & Drop a block"),
- content: _t("Drag the 'Big Picture' block and drop it in your page."),
- popover: { fixed: true },
- },
- {
- element: 'button[data-action=save]',
- placement: 'right',
- title: _t("Save your modifications"),
- content: _t("Once you click on save, your product is updated."),
- popover: { fixed: true },
- },
- {
- waitFor: '#website-top-navbar:hidden',
- element: '.js_publish_management button.js_publish_btn.btn-danger',
- placement: 'top',
- title: _t("Publish your product"),
- content: _t("Click to publish 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") },
- },
- ]
- });
-
-}());
--- /dev/null
+(function () {
+ 'use strict';
+
+ openerp.Tour.register({
+ id: 'shop_buy_product',
+ name: "Try to buy products",
+ path: '/shop',
+ mode: 'test',
+ steps: [
+ {
+ title: "select ipod",
+ element: '.oe_product_cart a:contains("iPod")',
+ },
+ {
+ title: "select ipod 32GB",
+ waitFor: '#product_detail',
+ element: 'label:contains(32 GB) input',
+ },
+ {
+ title: "click on add to cart",
+ waitFor: 'label:contains(32 GB) input[checked]',
+ element: 'form[action="/shop/cart/update"] .btn',
+ },
+ {
+ title: "add suggested",
+ waitNot: '#cart_products:contains("[A8767] Apple In-Ear Headphones")',
+ element: '.oe_cart a:contains("Add to Cart")',
+ },
+ {
+ title: "add one more iPod",
+ waitFor: '.my_cart_quantity:contains(2)',
+ element: '#cart_products tr:contains("32 GB") a.js_add_cart_json:eq(1)',
+ },
+ {
+ title: "remove Headphones",
+ waitFor: '#cart_products tr:contains("32 GB") input.js_quantity[value=2]',
+ element: '#cart_products tr:contains("Apple In-Ear Headphones") a.js_add_cart_json:first',
+ },
+ {
+ title: "set one iPod",
+ waitNot: '#cart_products tr:contains("Apple In-Ear Headphones")',
+ element: '#cart_products input.js_quantity',
+ sampleText: '1',
+ },
+ {
+ title: "go to checkout",
+ waitFor: '#cart_products input.js_quantity[value=1]',
+ element: 'a[href="/shop/checkout"]',
+ },
+ {
+ title: "test with input error",
+ element: 'form[action="/shop/confirm_order"] .btn:contains("Confirm")',
+ onload: function (tour) {
+ $("input[name='phone']").val("");
+ },
+ },
+ {
+ title: "test without input error",
+ waitFor: 'form[action="/shop/confirm_order"] .has-error',
+ element: 'form[action="/shop/confirm_order"] .btn:contains("Confirm")',
+ onload: function (tour) {
+ if ($("input[name='name']").val() === "")
+ $("input[name='name']").val("website_sale-test-shoptest");
+ if ($("input[name='email']").val() === "")
+ $("input[name='email']").val("website_sale_test_shoptest@websitesaletest.optenerp.com");
+ $("input[name='phone']").val("123");
+ $("input[name='street']").val("123");
+ $("input[name='city']").val("123");
+ $("input[name='zip']").val("123");
+ $("select[name='country_id']").val("21");
+ },
+ },
+ {
+ title: "select payment",
+ element: '#payment_method label:has(img[title="Wire Transfer"]) input',
+ },
+ {
+ title: "Pay Now",
+ waitFor: '#payment_method label:has(input:checked):has(img[title="Wire Transfer"])',
+ element: '.oe_sale_acquirer_button .btn[type="submit"]:visible',
+ },
+ {
+ title: "finish",
+ waitFor: '.oe_website_sale:contains("Thank you for your order")',
+ }
+ ]
+ });
+
+}());
--- /dev/null
+(function () {
+ 'use strict';
+
+ var _t = openerp._t;
+
+ openerp.Tour.register({
+ id: 'shop',
+ 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: '#content-menu-button',
+ placement: 'left',
+ 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 'New Product' to create it and manage its properties to boost your sales."),
+ popover: { fixed: true },
+ },
+ {
+ element: '.modal #editor_new_product input[type=text]',
+ sampleText: 'New Product',
+ placement: 'right',
+ title: _t("Choose name"),
+ content: _t("Enter a name for your new product then click 'Continue'."),
+ },
+ {
+ waitNot: '.modal input[type=text]:not([value!=""])',
+ element: '.modal button.btn-primary',
+ placement: 'right',
+ title: _t("Create Product"),
+ content: _t("Click <em>Continue</em> to create the product."),
+ },
+ {
+ waitFor: 'body:has(button[data-action=save]:visible):has(.js_sale)',
+ 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',
+ sampleText: '20.50',
+ placement: 'left',
+ 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: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: 'img[alt=ipad]',
+ placement: 'top',
+ title: _t("Select an Image"),
+ content: _t("Let's select an ipad image."),
+ },
+ {
+ waitFor: '.media_selected img[alt=ipad]',
+ element: '.modal-content button.save',
+ placement: 'top',
+ title: _t("Save this Image"),
+ content: _t("Click on save to add the image to the product decsription."),
+ },
+ {
+ waitNot: '.modal-content:visible',
+ element: 'button[data-action=snippet]',
+ placement: 'bottom',
+ title: _t("Describe the Product"),
+ content: _t("Insert blocks like text-image, or gallery to fully describe the product."),
+ popover: { fixed: true },
+ },
+ {
+ snippet: '#snippet_structure .oe_snippet:eq(7)',
+ placement: 'bottom',
+ title: _t("Drag & Drop a block"),
+ content: _t("Drag the 'Big Picture' block and drop it in your page."),
+ popover: { fixed: true },
+ },
+ {
+ element: 'button[data-action=save]',
+ placement: 'right',
+ title: _t("Save your modifications"),
+ content: _t("Once you click on save, your product is updated."),
+ popover: { fixed: true },
+ },
+ {
+ waitFor: '#website-top-navbar:hidden',
+ element: '.js_publish_management button.js_publish_btn.btn-danger',
+ placement: 'top',
+ title: _t("Publish your product"),
+ content: _t("Click to publish 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") },
+ },
+ ]
+ });
+
+}());
import openerp.tests
-inject = [
- ("openerp.Tour", os.path.join(os.path.dirname(__file__), '../../web/static/src/js/tour.js')),
-]
-
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
self.phantom_js("/", "openerp.Tour.run('shop', 'test')", "openerp.Tour.tours.shop", login="admin")
def test_02_admin_checkout(self):
- self.phantom_js("/", "openerp.Tour.run('shop_buy_product', 'test')", "openerp.Tour.tours.shop_buy_product", login="admin", inject=inject)
+ self.phantom_js("/", "openerp.Tour.run('shop_buy_product', 'test')", "openerp.Tour.tours.shop_buy_product", login="admin")
def test_03_demo_checkout(self):
- self.phantom_js("/", "openerp.Tour.run('shop_buy_product', 'test')", "openerp.Tour.tours.shop_buy_product", login="demo", inject=inject)
+ self.phantom_js("/", "openerp.Tour.run('shop_buy_product', 'test')", "openerp.Tour.tours.shop_buy_product", login="demo")
def test_04_public_checkout(self):
- self.phantom_js("/", "openerp.Tour.run('shop_buy_product', 'test')", "openerp.Tour.tours.shop_buy_product", inject=inject)
+ self.phantom_js("/", "openerp.Tour.run('shop_buy_product', 'test')", "openerp.Tour.tours.shop_buy_product")
<!-- Layout and common templates -->
-<template id="assets_editor" inherit_id="website.assets_editor" name="Shop Editor" groups="base.group_sale_manager">
- <xpath expr="." position="inside">
- <script type="text/javascript" src="/website_sale/static/src/js/website_sale.editor.js"></script>
- <script type="text/javascript" src="/website_sale/static/src/js/website.tour.shop.js"></script>
- </xpath>
-</template>
-
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Shop">
<xpath expr="." position="inside">
- <script type="text/javascript" src="/website_sale/static/src/js/website.tour.sale.js"></script>
- <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
<link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
<link rel='stylesheet' href='/website_sale/static/src/css/website_mail.css'/>
+ <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
<script type="text/javascript" src="/website_sale/static/src/js/website_sale_payment.js"></script>
<script type="text/javascript" src="/website_sale/static/src/js/website_sale_validate.js"></script>
+ <script type="text/javascript" src="/website_sale/static/src/js/website_sale_tour_buy.js"></script>
+ </xpath>
+</template>
+
+<template id="assets_editor" inherit_id="website.assets_editor" name="Shop Editor" groups="base.group_sale_manager">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/website_sale/static/src/js/website_sale.editor.js"></script>
+ <script type="text/javascript" src="/website_sale/static/src/js/website_sale_tour_shop.js"></script>
</xpath>
</template>
</li>
</xpath>
</template>
+
<template id="search" name="Search hidden fields">
<t t-if="attrib_values">
<t t-foreach="attrib_values" t-as="a">
import openerp.tests
-inject = [
- ("openerp.Tour", os.path.join(os.path.dirname(__file__), '../../web/static/src/js/tour.js')),
-]
-
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestUi(openerp.tests.HttpCase):
def test_01_admin_shop_tour(self):
- self.phantom_js("/", "openerp.Tour.run('shop_customize', 'test')", "openerp.Tour.tours.shop_customize", login="admin", inject=inject)
+ self.phantom_js("/", "openerp.Tour.run('shop_customize', 'test')", "openerp.Tour.tours.shop_customize", login="admin")