1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
odoo.define('test_website.error_views', function (require) {
'use strict';
var tour = require('web_tour.tour');
tour.register('test_error_website', {
test: true,
url: '/test_error_view',
},
[
// RPC ERROR
{
content: "trigger rpc user error",
trigger: 'a[href="/test_user_error_json"]',
}, {
content: "rpc user error modal has message",
extra_trigger: 'div.toast-body:contains("This is a user rpc test")',
trigger: 'button.o_notification_close',
}, {
content: "trigger rpc access error",
trigger: 'a[href="/test_access_error_json"]',
}, {
content: "rpc access error modal has message",
extra_trigger: 'div.toast-body:contains("This is an access rpc test")',
trigger: 'button.o_notification_close',
}, {
content: "trigger validation rpc error",
trigger: 'a[href="/test_validation_error_json"]',
}, {
content: "rpc validation error modal has message",
extra_trigger: 'div.toast-body:contains("This is a validation rpc test")',
trigger: 'button.o_notification_close',
}, {
content: "trigger rpc missing error",
trigger: 'a[href="/test_missing_error_json"]',
}, {
content: "rpc missing error modal has message",
extra_trigger: 'div.toast-body:contains("This is a missing rpc test")',
trigger: 'button.o_notification_close',
}, {
content: "trigger rpc error 403",
trigger: 'a[href="/test_access_denied_json"]',
}, {
content: "rpc error 403 modal has message",
extra_trigger: 'div.toast-body:contains("This is an access denied rpc test")',
trigger: 'button.o_notification_close',
}, {
content: "trigger rpc error 500",
trigger: 'a[href="/test_internal_error_json"]',
}, {
content: "rpc error 500 modal is an ErrorDialog",
extra_trigger: 'div.o_dialog_error.modal-body div.alert.alert-warning',
trigger: 'button.btn.btn-primary[type="button"]',
},
// HTTP ERROR
{
content: "trigger http user error",
trigger: 'body',
run: function () {
window.location.href = window.location.origin + '/test_user_error_http?debug=0';
},
}, {
content: "http user error page has title and message",
extra_trigger: 'h1:contains("Something went wrong.")',
trigger: 'div.container pre:contains("This is a user http test")',
run: function () {
window.location.href = window.location.origin + '/test_user_error_http?debug=1';
},
}, {
content: "http user error page debug has title and message open",
extra_trigger: 'h1:contains("Something went wrong.")',
trigger: 'div#error_main.collapse.show pre:contains("This is a user http test")',
run: function () {},
}, {
content: "http user error page debug has traceback closed",
trigger: 'body:has(div#error_traceback.collapse:not(.show) pre#exception_traceback)',
run: function () {
window.location.href = window.location.origin + '/test_validation_error_http?debug=0';
},
}, {
content: "http validation error page has title and message",
extra_trigger: 'h1:contains("Something went wrong.")',
trigger: 'div.container pre:contains("This is a validation http test")',
run: function () {
window.location.href = window.location.origin + '/test_validation_error_http?debug=1';
},
}, {
content: "http validation error page debug has title and message open",
extra_trigger: 'h1:contains("Something went wrong.")',
trigger: 'div#error_main.collapse.show pre:contains("This is a validation http test")',
run: function () {},
}, {
content: "http validation error page debug has traceback closed",
trigger: 'body:has(div#error_traceback.collapse:not(.show) pre#exception_traceback)',
run: function () {
window.location.href = window.location.origin + '/test_access_error_http?debug=0';
},
}, {
content: "http access error page has title and message",
extra_trigger: 'h1:contains("403: Forbidden")',
trigger: 'div.container pre:contains("This is an access http test")',
run: function () {
window.location.href = window.location.origin + '/test_access_error_http?debug=1';
},
}, {
content: "http access error page debug has title and message open",
extra_trigger: 'h1:contains("403: Forbidden")',
trigger: 'div#error_main.collapse.show pre:contains("This is an access http test")',
run: function () {},
}, {
content: "http access error page debug has traceback closed",
trigger: 'body:has(div#error_traceback.collapse:not(.show) pre#exception_traceback)',
run: function () {
window.location.href = window.location.origin + '/test_missing_error_http?debug=0';
},
}, {
content: "http missing error page has title and message",
extra_trigger: 'h1:contains("Something went wrong.")',
trigger: 'div.container pre:contains("This is a missing http test")',
run: function () {
window.location.href = window.location.origin + '/test_missing_error_http?debug=1';
},
}, {
content: "http missing error page debug has title and message open",
extra_trigger: 'h1:contains("Something went wrong.")',
trigger: 'div#error_main.collapse.show pre:contains("This is a missing http test")',
run: function () {},
}, {
content: "http missing error page debug has traceback closed",
trigger: 'body:has(div#error_traceback.collapse:not(.show) pre#exception_traceback)',
run: function () {
window.location.href = window.location.origin + '/test_access_denied_http?debug=0';
},
}, {
content: "http error 403 page has title but no message",
extra_trigger: 'h1:contains("403: Forbidden")',
trigger: 'div#wrap:not(:has(pre:contains("This is an access denied http test"))', //See ir_http.py handle_exception, the exception is replaced so there is no message !
run: function () {
window.location.href = window.location.origin + '/test_access_denied_http?debug=1';
},
}, {
content: "http 403 error page debug has title but no message",
extra_trigger: 'h1:contains("403: Forbidden")',
trigger: 'div#debug_infos:not(:has(#error_main))',
run: function () {},
}, {
content: "http 403 error page debug has traceback open",
trigger: 'body:has(div#error_traceback.collapse.show pre#exception_traceback)',
run: function () {},
},
]);
});
|