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
|
odoo.define("website_mass_mailing.tour.newsletter_popup_edition", function (require) {
"use strict";
const tour = require('web_tour.tour');
const wTourUtils = require('website.tour_utils');
tour.register('newsletter_popup_edition', {
test: true,
url: '/?enable_editor=1',
}, [
wTourUtils.dragNDrop({
id: 's_newsletter_subscribe_popup',
name: 'Newsletter Popup',
}),
{
content: "Confirm newsletter choice",
trigger: '.modal-footer .btn-primary',
},
{
content: "Check the modal is opened for edition",
trigger: '.o_newsletter_popup .modal:visible',
in_modal: false,
run: () => null,
},
wTourUtils.clickOnSave(),
{
content: "Check the modal has been saved, closed",
trigger: '.o_newsletter_popup',
extra_trigger: 'body:not(.editor_enable)',
run: function (actions) {
const $modal = this.$anchor.find('.modal');
if ($modal.is(':visible')) {
console.error('Modal is still opened...');
}
},
},
]);
});
odoo.define("website_mass_mailing.tour.newsletter_popup_use", function (require) {
"use strict";
const tour = require('web_tour.tour');
tour.register('newsletter_popup_use', {
test: true,
url: '/',
}, [
{
content: "Check the modal is not yet opened and force it opened",
trigger: '.o_newsletter_popup',
run: function (actions) {
const $modal = this.$anchor.find('.modal');
if ($modal.is(':visible')) {
console.error('Modal is already opened...');
}
$(document).trigger('mouseleave');
},
},
{
content: "Check the modal is now opened and enter text in the subscribe input",
trigger: '.o_newsletter_popup .modal input',
in_modal: false,
run: 'text hello@world.com',
},
{
content: "Subscribe",
trigger: '.modal-dialog .btn-primary',
},
{
content: "Check the modal is now closed",
trigger: '.o_newsletter_popup',
run: function (actions) {
const $modal = this.$anchor.find('.modal');
if ($modal.is(':visible')) {
console.error('Modal is still opened...');
}
},
}
]);
});
|