[IMP] website tour: add href when time overlaps
[odoo/odoo.git] / addons / website / static / src / js / website.tour.test.admin.js
1 (function () {
2     'use strict';
3
4     var website = openerp.website;
5
6     website.Tour.LoginEdit = website.Tour.extend({
7         id: 'login_edit',
8         name: "Try to log as admin and check editor",
9         path: '/',
10         init: function () {
11             var self = this;
12             self.steps = [
13                 {
14                     title:     "click login",
15                     element:   '#top_menu a[href*="/web/login"]',
16                 },
17                 {
18                     title:     "insert login",
19                     element:   '.oe_login_form input[name="login"]',
20                     sampleText: "admin",
21                 },
22                 {
23                     title:     "insert password",
24                     waitFor:   '.oe_login_form input[name="login"][value!=""]',
25                     element:   '.oe_login_form input[name="password"]',
26                     sampleText: "admin",
27                 },
28                 {
29                     title:     "select 2 Standard tickets",
30                     waitFor:   '.oe_login_form input[name="password"][value!=""]',
31                     element:   '.oe_login_form button',
32                 },
33                 {
34                     title:     "go back to website from backend",
35                     element:   'a[data-action-model="ir.actions.act_url"]:contains("Website")',
36                 },
37                 {
38                     title:     'try to edit',
39                     waitNot:   '#wrap .carousel',
40                     element:   'button[data-action=edit]:visible',
41                 },
42                 {
43                     title:     'check edit mode',
44                     waitFor:   'button[data-action=save]:visible',
45                 },
46                 {
47                     title:     'check branding',
48                     waitFor:   '#wrap[data-oe-model="ir.ui.view"]',
49                 },
50                 {
51                     title:     'check rte',
52                     waitFor:   '#oe_rte_toolbar',
53                 },
54                 {
55                     title:     'check insert block button',
56                     element:   '[data-action="snippet"]:visible',
57                 },
58                 {
59                     title:     'add snippets',
60                     snippet:   '#snippet_structure .oe_snippet:first',
61                 },
62                 {
63                     title:     'try to save',
64                     waitFor:   '.oe_overlay_options .oe_options:visible',
65                     element:   'button[data-action=save]:visible',
66                 },
67                 {
68                     title:     'check saved',
69                     waitFor:   '#wrap div.carousel',
70                     element:   'button[data-action=edit]:visible',
71                 },
72                 {
73                     title:      'try to re-edit',
74                     waitFor:    'button[data-action=save]:visible',
75                     element:    '#wrap .carousel',
76                 },
77                 {
78                     title:      'remove snippet',
79                     element:    '.oe_snippet_remove',
80                 },
81                 {
82                     title:     'try to re-save',
83                     waitNot:   '#wrap .carousel',
84                     element:   'button[data-action=save]:visible',
85                 },
86                 {
87                     title:     "click admin",
88                     waitFor:   'button[data-action=edit]:visible',
89                     element:   'a:contains("Administrator")',
90                 },
91                 {
92                     title:     "click logout",
93                     element:   '#top_menu a[href*="/logout"]',
94                 },
95                 {
96                     title:     "check logout",
97                     waitFor:   '#top_menu a[href*="/web/login"]',
98                 },
99             ];
100             return this._super();
101         },
102     });
103     // for test without editor bar
104     website.Tour.add(website.Tour.LoginEdit);
105
106 }());