145 lines
4.5 KiB
JavaScript
145 lines
4.5 KiB
JavaScript
import { registry } from "@web/core/registry";
|
|
import { stepUtils } from "@web_tour/tour_utils";
|
|
|
|
registry.category("web_tour.tours").add("test_sign_flow_tour", {
|
|
url: "/odoo",
|
|
steps: () => [
|
|
stepUtils.showAppsMenuItem(),
|
|
{
|
|
content: "Open Sign APP",
|
|
trigger: '.o_app[data-menu-xmlid="sign.menu_document"]',
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "Click on Template Menu",
|
|
trigger: 'a[data-menu-xmlid="sign.sign_template_menu"]',
|
|
tooltipPosition: "bottom",
|
|
run: "click",
|
|
},
|
|
{
|
|
trigger: ".o_last_breadcrumb_item > span:contains('Templates')",
|
|
},
|
|
{
|
|
content: "Remove My Favorites filter",
|
|
trigger: ".o_cp_searchview .o_facet_remove",
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "list view",
|
|
trigger: "button.o_list",
|
|
run: "click",
|
|
},
|
|
{
|
|
trigger: '.o_list_button button:contains("Sign Now")',
|
|
},
|
|
{
|
|
content: "Click Sign Now",
|
|
trigger: "button:contains('Sign Now')",
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "Click sign",
|
|
trigger: "button[name='sign_directly']",
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "Click to start",
|
|
trigger: ':iframe .o_sign_sign_item_navigator:contains("Click to start")',
|
|
tooltipPosition: "bottom",
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "Fill the sign item",
|
|
trigger: ":iframe input.o_sign_sign_item",
|
|
run: "edit Laurie Poiret",
|
|
},
|
|
{
|
|
content: "Click next 1",
|
|
trigger: ':iframe .o_sign_sign_item_navigator:contains("next")',
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "Click it",
|
|
trigger: ":iframe .o_sign_sign_item_navigator",
|
|
run: "click",
|
|
},
|
|
{
|
|
trigger: ":iframe :not(:has(.o_sign_sign_item_navigator))",
|
|
},
|
|
{
|
|
isActive: ["auto"],
|
|
trigger: ":iframe button.o_sign_sign_item:has(img)",
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "Click on auto button",
|
|
trigger: ".o_web_sign_auto_button",
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "Click on style button",
|
|
trigger: ".o_web_sign_auto_select_style .dropdown-toggle",
|
|
async run({ click, waitUntil }) {
|
|
// Select a style but wait before the response of rpc get_fonts/
|
|
for (let i = 0; i < 50; i++) {
|
|
await click();
|
|
const items = document.querySelectorAll(".dropdown-menu .dropdown-item");
|
|
if (items.length >= 3) {
|
|
await click(".dropdown-menu .dropdown-item:nth-child(3)");
|
|
break;
|
|
}
|
|
await new Promise((r) => setTimeout(r, 200));
|
|
}
|
|
},
|
|
},
|
|
{
|
|
content: "Click on style button",
|
|
trigger: ".o_web_sign_auto_select_style > button",
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "Select a style",
|
|
trigger: ".dropdown-menu .dropdown-item:nth-child(2)",
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "Click on style button",
|
|
trigger: ".o_web_sign_auto_select_style > button",
|
|
run: "click",
|
|
},
|
|
{
|
|
content: "Select a style",
|
|
trigger: ".dropdown-menu .dropdown-item:nth-child(3)",
|
|
run: "click",
|
|
},
|
|
{
|
|
trigger: "canvas.o_web_sign_signature",
|
|
},
|
|
{
|
|
content: "Sign",
|
|
trigger: 'button.btn-primary:contains("Sign all")',
|
|
run: "click",
|
|
},
|
|
{
|
|
trigger: ".o_sign_validate_banner",
|
|
},
|
|
{
|
|
trigger: ":iframe input.o_sign_sign_item_constant[disabled]",
|
|
},
|
|
{
|
|
content: "Validate & Send Completed Document",
|
|
trigger: "button:contains('Validate & Send Completed Document')",
|
|
run: "click",
|
|
},
|
|
{
|
|
trigger:
|
|
".modal-dialog .modal-body:contains(You will get the signed document by email.)",
|
|
},
|
|
{
|
|
content: "view",
|
|
trigger: "h4:contains('It's signed') + button:btn-close",
|
|
run: "click",
|
|
},
|
|
],
|
|
});
|