mirror of
https://github.com/bringout/oca-ocb-test.git
synced 2026-04-25 02:42:02 +02:00
19.0 vanilla
This commit is contained in:
parent
38c6088dcc
commit
d9452d2060
243 changed files with 30797 additions and 10815 deletions
|
|
@ -1,7 +1,4 @@
|
|||
odoo.define('test_website.custom_snippets', function (require) {
|
||||
'use strict';
|
||||
|
||||
const wTourUtils = require('website.tour_utils');
|
||||
import { insertSnippet, registerWebsitePreviewTour } from "@website/js/tours/tour_utils";
|
||||
|
||||
/**
|
||||
* The purpose of this tour is to check the custom snippets flow:
|
||||
|
|
@ -11,8 +8,8 @@ const wTourUtils = require('website.tour_utils');
|
|||
* -> customize banner (set text)
|
||||
* -> save banner as custom snippet
|
||||
* -> confirm save
|
||||
* -> ensure custom snippet is available
|
||||
* -> drag custom snippet
|
||||
* -> ensure custom snippet is available in the "add snippet" dialog
|
||||
* -> add custom snippet into the page
|
||||
* -> ensure block appears as banner
|
||||
* -> ensure block appears as custom banner
|
||||
* -> rename custom banner
|
||||
|
|
@ -22,87 +19,89 @@ const wTourUtils = require('website.tour_utils');
|
|||
* -> ensure it was deleted
|
||||
*/
|
||||
|
||||
wTourUtils.registerWebsitePreviewTour('test_custom_snippet', {
|
||||
registerWebsitePreviewTour('test_custom_snippet', {
|
||||
url: '/',
|
||||
edition: true,
|
||||
test: true,
|
||||
}, [
|
||||
}, () => [
|
||||
...insertSnippet({
|
||||
id: 's_banner',
|
||||
name: 'Banner',
|
||||
groupName: "Intro",
|
||||
}),
|
||||
{
|
||||
content: "drop a snippet",
|
||||
trigger: ".oe_snippet[name='Banner'] .oe_snippet_thumbnail:not(.o_we_already_dragging)",
|
||||
moveTrigger: ".oe_drop_zone",
|
||||
run: "drag_and_drop iframe #wrap",
|
||||
content: "Customize snippet",
|
||||
trigger: ":iframe #wrapwrap .s_banner h1",
|
||||
run: "editor Test",
|
||||
},
|
||||
{
|
||||
content: "customize snippet",
|
||||
trigger: "iframe #wrapwrap .s_banner h1",
|
||||
run: "text",
|
||||
consumeEvent: "input",
|
||||
content: "Save custom snippet",
|
||||
trigger: "div[data-container-title='Banner'] .oe_snippet_save",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "save custom snippet",
|
||||
trigger: ".snippet-option-SnippetSave we-button",
|
||||
content: "Confirm reload",
|
||||
trigger: ".modal-dialog button:contains('Save')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "confirm reload",
|
||||
trigger: ".modal-dialog button span:contains('Save and Reload')",
|
||||
content: "Click on the block tab",
|
||||
trigger: ".o-snippets-tabs button[data-name='blocks']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "ensure custom snippet appeared",
|
||||
trigger: "#oe_snippets.o_loaded .oe_snippet[name='Custom Banner']",
|
||||
run: function () {
|
||||
$("#oe_snippets .oe_snippet[name='Custom Banner'] .o_rename_btn").attr("style", "display: block;");
|
||||
// hover is needed for rename button to appear
|
||||
},
|
||||
content: "Click on the Custom category block",
|
||||
trigger: ".o_block_tab:not(.o_we_ongoing_insertion) #snippet_groups .o_snippet[name='Custom'].o_draggable .o_snippet_thumbnail .o_snippet_thumbnail_area",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "rename custom snippet",
|
||||
trigger: ".oe_snippet[name='Custom Banner'] we-button.o_rename_btn",
|
||||
extra_trigger: ".oe_snippet[name='Custom Banner'] .oe_snippet_thumbnail:not(.o_we_already_dragging)",
|
||||
content: "Ensure custom snippet preview appeared in the dialog",
|
||||
trigger: ":iframe .o_snippet_preview_wrap[data-snippet-id^='s_banner_'] section[data-name='Custom Banner']",
|
||||
},
|
||||
{
|
||||
content: "set name",
|
||||
trigger: ".oe_snippet[name='Custom Banner'] input",
|
||||
run: "text Bruce Banner",
|
||||
content: "Rename custom snippet",
|
||||
trigger: ":iframe .o_custom_snippet_edit > button",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "confirm rename",
|
||||
trigger: ".oe_snippet[name='Custom Banner'] we-button.o_we_confirm_btn",
|
||||
content: "Set name",
|
||||
trigger: ".modal-dialog:not(.o_inactive_modal body) input[id='inputConfirmation']",
|
||||
run: "edit Bruce Banner",
|
||||
},
|
||||
{
|
||||
content: "drop custom snippet",
|
||||
trigger: ".oe_snippet[name='Bruce Banner'] .oe_snippet_thumbnail:not(.o_we_already_dragging)",
|
||||
extra_trigger: "iframe body.editor_enable",
|
||||
moveTrigger: ".oe_drop_zone",
|
||||
run: "drag_and_drop iframe #wrap",
|
||||
content: "Confirm rename",
|
||||
trigger: ".modal-dialog:not(.o_inactive_modal body) footer .btn-primary",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "ensure banner section exists",
|
||||
trigger: "iframe #wrap section[data-name='Banner']",
|
||||
run: function () {}, // check
|
||||
content: "Click on the 'Bruce Banner' snippet",
|
||||
trigger: ":iframe .o_snippet_preview_wrap[data-snippet-id^='s_banner_']:has(section[data-name='Bruce Banner'])",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "ensure custom banner section exists",
|
||||
trigger: "iframe #wrap section[data-name='Bruce Banner']",
|
||||
run: function () {
|
||||
$("#oe_snippets .oe_snippet[name='Bruce Banner'] .o_delete_btn").attr("style", "display: block;");
|
||||
// hover is needed for delete button to appear
|
||||
},
|
||||
content: "Ensure banner section exists",
|
||||
trigger: ":iframe #wrap section[data-name='Banner']",
|
||||
},
|
||||
{
|
||||
content: "delete custom snippet",
|
||||
trigger: ".oe_snippet[name='Bruce Banner'] we-button.o_delete_btn",
|
||||
extra_trigger: ".oe_snippet[name='Bruce Banner'] .oe_snippet_thumbnail:not(.o_we_already_dragging)",
|
||||
content: "Ensure custom banner section exists",
|
||||
trigger: ":iframe #wrap section[data-name='Bruce Banner']",
|
||||
},
|
||||
{
|
||||
content: "confirm delete",
|
||||
trigger: ".modal-dialog button:has(span:contains('Yes'))",
|
||||
content: "Click on the Custom category block",
|
||||
trigger: ".o_block_tab:not(.o_we_ongoing_insertion) #snippet_groups .o_snippet[name='Custom'].o_draggable .o_snippet_thumbnail .o_snippet_thumbnail_area",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "ensure custom snippet disappeared",
|
||||
trigger: "#oe_snippets:not(:has(.oe_snippet[name='Bruce Banner']))",
|
||||
run: function () {}, // check
|
||||
content: "Delete custom snippet",
|
||||
trigger: ":iframe .o_custom_snippet_edit > button + button",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirm delete",
|
||||
trigger: ".modal-dialog button:contains('Yes')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Ensure custom snippet disappeared",
|
||||
trigger: ":iframe .o_add_snippets_preview:not(:has(section[data-name='Bruce Banner']))",
|
||||
},
|
||||
]);
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue