4 var website = openerp.website;
6 website.Tour.register({
8 name: "Customize the page and search a product",
13 title: "open customize menu",
14 element: '#customize-menu-button',
17 title: "click on 'Product Attribute's Filters'",
18 element: "#customize-menu a:contains(Product Attribute's Filters)",
21 title: "select product attribute memory 16 GB",
22 element: 'form.js_attributes label:contains(16 GB) input:not(:checked)',
25 title: "check the selection",
26 waitFor: 'form.js_attributes label:contains(16 GB) input:checked',
30 waitNot: '.oe_website_sale .oe_product_cart:eq(2)',
31 element: '.oe_product_cart a:contains("iPod")',
35 waitFor: 'form[action="/shop/cart/update"] label:contains(32 Go) input',
40 website.Tour.register({
41 id: 'shop_buy_product',
42 name: "Try to buy products",
48 element: '.oe_product_cart a:contains("iPod")',
51 title: "select ipod 32GB",
52 waitFor: '#product_detail',
53 element: 'label:contains(32 GB) input',
56 title: "click on add to cart",
57 waitFor: 'label:contains(32 GB) input[checked]',
58 element: 'form[action="/shop/cart/update"] .btn',
61 title: "add suggested",
62 waitNot: '#cart_products:contains("[A8767] Apple In-Ear Headphones")',
63 element: 'form[action="/shop/cart/update"] .btn-link:contains("Add to Cart")',
66 title: "add one more iPod",
67 waitFor: '.my_cart_quantity:contains(2)',
68 element: '#cart_products tr:contains("32 GB") a.js_add_cart_json:eq(1)',
71 title: "remove Headphones",
72 waitFor: '#cart_products tr:contains("32 GB") input.js_quantity[value=2]',
73 element: '#cart_products tr:contains("Apple In-Ear Headphones") a.js_add_cart_json:first',
76 title: "set one iPod",
77 waitNot: '#cart_products tr:contains("Apple In-Ear Headphones")',
78 element: '#cart_products input.js_quantity',
82 title: "go to checkout",
83 waitFor: '#cart_products input.js_quantity[value=1]',
84 element: 'a[href="/shop/checkout"]',
87 title: "test with input error",
88 element: 'form[action="/shop/confirm_order"] .btn:contains("Confirm")',
89 onload: function (tour) {
90 $("input[name='phone']").val("");
94 title: "test without input error",
95 waitFor: 'form[action="/shop/confirm_order"] .has-error',
96 element: 'form[action="/shop/confirm_order"] .btn:contains("Confirm")',
97 onload: function (tour) {
98 if ($("input[name='name']").val() === "")
99 $("input[name='name']").val("website_sale-test-shoptest");
100 if ($("input[name='email']").val() === "")
101 $("input[name='email']").val("website_sale_test_shoptest@websitesaletest.optenerp.com");
102 $("input[name='phone']").val("123");
103 $("input[name='street']").val("123");
104 $("input[name='city']").val("123");
105 $("input[name='zip']").val("123");
106 $("select[name='country_id']").val("21");
110 title: "select payment",
111 element: '#payment_method label:has(img[title="Wire Transfer"]) input',
115 waitFor: '#payment_method label:has(input:checked):has(img[title="Wire Transfer"])',
116 element: '.oe_sale_acquirer_button .btn[type="submit"]:visible',
120 waitFor: '.oe_website_sale:contains("Thank you for your order")',