[FIX] website_sale: save the company in street and the street in street2.
[odoo/odoo.git] / addons / website_event_sale / static / src / js / website.tour.event_sale.js
1 (function () {
2     'use strict';
3
4     openerp.Tour.register({
5         id:   'event_buy_tickets',
6         name: "Try to buy tickets for event",
7         path: '/event',
8         mode: 'test',
9         steps: [
10             {
11                 title:     "select event",
12                 element:   'a[href*="/event"]:contains("Conference on Business Applications"):first',
13             },
14             {
15                 waitNot:   'a[href*="/event"]:contains("Conference on Business Applications")',
16                 title:     "select 2 Standard tickets",
17                 element:   'select:eq(0)',
18                 sampleText: '2',
19             },
20             {
21                 title:     "select 3 VIP tickets",
22                 waitFor:   'select:eq(0) option:contains(2):selected',
23                 element:   'select:eq(1)',
24                 sampleText: '3',
25             },
26             {
27                 title:     "Order Now",
28                 waitFor:   'select:eq(1) option:contains(3):selected',
29                 element:   '.btn-primary:contains("Order Now")',
30             },
31             {
32                 title:     "Check the cart",
33                 element:   '#top_menu .my_cart_quantity:contains(5)'
34             },
35             {
36                 title:     "Check if the cart have 2 order lines and add one VIP ticket",
37                 waitFor:   "#cart_products:contains(Standard):contains(VIP)",
38                 element:   "#cart_products tr:contains(VIP) .fa-plus",
39             },
40             {
41                 title:     "Process Checkout",
42                 waitFor:   '#top_menu .my_cart_quantity:contains(6)',
43                 element:   '.btn-primary:contains("Process Checkout")'
44             },
45             {
46                 title:     "Complete checkout",
47                 element:   'form[action="/shop/confirm_order"] .btn:contains("Confirm")',
48                 autoComplete: function (tour) {
49                     if ($("input[name='name']").val() === "")
50                         $("input[name='name']").val("website_sale-test-shoptest");
51                     if ($("input[name='email']").val() === "")
52                         $("input[name='email']").val("website_event_sale_test_shoptest@websiteeventsaletest.odoo.com");
53                     $("input[name='phone']").val("123");
54                     $("input[name='street2']").val("123");
55                     $("input[name='city']").val("123");
56                     $("input[name='zip']").val("123");
57                     $("select[name='country_id']").val("21");
58                 },
59             },
60             {
61                 title:     "select payment",
62                 element:   '#payment_method label:has(img[title="Wire Transfer"]) input',
63             },
64             {
65                 title:     "Pay Now",
66                 waitFor:   '#payment_method label:has(input:checked):has(img[title="Wire Transfer"])',
67                 element:   '.oe_sale_acquirer_button .btn[type="submit"]:visible',
68             },
69             {
70                 title:     "finish",
71                 waitFor:   '.oe_website_sale:contains("Thank you for your order")',
72             }
73         ]
74     });
75
76 }());