Files
odoo_source/addons/website/static/tests/tours/automatic_editor.js
T
+2 bc0a0cead6 [IMP] web,*: enable owl list & form views
The new list and form views were merged recently [1], but they
weren't activated because they weren't 100% ready yet. This is now
the case. This commit adds those views to the view registry. As a
consequence, a lot of qunit tests and tours needed to be adapted,
mostly for selector changes.

We also add legacy list and form views to the view registry, with
keys 'legacy_list' and 'legacy_form'. This allows to force those
legacy views when necessary. For instance, we did it in views
using complex custom legacy x2many field widgets that haven't been
converted yet (we have a compatibility layer but it isn't complete
and doesn't support every advanced usecases).

[1] odoo/odoo#92475

Part-of: odoo/odoo#78221
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2022-07-22 16:21:45 +02:00

100 lines
3.1 KiB
JavaScript

odoo.define('website.tour.automatic_editor', function (require) {
'use strict';
const wTourUtils = require("website.tour_utils");
wTourUtils.registerEditionTour('automatic_editor_on_new_website', {
test: true,
url: '/',
},
[
{
content: "Select the language dropdown",
trigger: 'iframe .js_language_selector .dropdown-toggle'
},
{
content: "click on Add a language",
trigger: 'iframe a.o_add_language',
},
{
content: "type Parseltongue",
trigger: 'div[name="lang_ids"] .o_input_dropdown input',
run: 'text Parseltongue',
},
{
content: 'select Parseltongue',
trigger: '.dropdown-item:contains(Parseltongue)',
in_modal: false,
},
{
content: "load parseltongue",
extra_trigger: '.modal div[name="lang_ids"] .rounded-pill .o_tag_badge_text:contains(Parseltongue)',
trigger: '.modal-footer button[name=lang_install]',
},
{
content: "Select the language dropdown",
trigger: 'iframe .js_language_selector .dropdown-toggle',
},
{
content: "Select parseltongue",
trigger: 'iframe a.js_change_lang[data-url_code=pa_GB]',
extra_trigger: 'iframe a.js_change_lang .o_lang_flag',
},
{
content: "Check that we're on parseltongue and then go to settings",
trigger: 'iframe html[lang=pa-GB]',
run: () => {
// Now go through the settings for a new website. A frontend_lang
// cookie was set during previous steps. It should not be used when
// redirecting to the frontend in the following steps.
window.location.href = '/web#action=website.action_website_configuration';
}
},
{
content: "create a new website",
trigger: 'button[name="action_website_create_new"]',
},
{
content: "insert website name",
trigger: 'div[name="name"] input',
run: 'text Website EN'
},
{
content: "validate the website creation modal",
trigger: 'button.btn-primary'
},
{
content: "skip configurator",
// This trigger targets the skip button, it doesn't have a more
// explicit class or ID.
trigger: '.o_configurator_container .container-fluid .btn.btn-link'
},
{
content: "make hover button appear",
trigger: '.o_theme_preview',
run: () => {
$('.o_theme_preview .o_button_area').attr('style', 'visibility: visible; opacity: 1;');
},
},
{
content: "Install a theme",
trigger: 'button[data-name="button_choose_theme"]'
},
{
content: "Check that the editor is loaded",
trigger: 'iframe body.editor_enable',
timeout: 30000,
run: () => null, // it's a check
},
{
content: "exit edit mode",
trigger: '.o_we_website_top_actions button.btn-primary:contains("Save")',
},
{
content: "wait for editor to close",
trigger: 'iframe body:not(.editor_enable)',
run: () => null, // It's a check
}
]);
});