mirror of
https://github.com/bringout/oca-ocb-test.git
synced 2026-04-25 11:42:01 +02:00
19.0 vanilla
This commit is contained in:
parent
38c6088dcc
commit
d9452d2060
243 changed files with 30797 additions and 10815 deletions
|
|
@ -0,0 +1,19 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { contains } from "@web/../tests/utils";
|
||||
|
||||
registry.category("web_tour.tours").add("load_more_tour", {
|
||||
steps: () => [
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Thread .o-mail-Message",
|
||||
run: async function () {
|
||||
await contains(".o-mail-Thread .o-mail-Message", {
|
||||
count: 30,
|
||||
target: document.querySelector("#chatterRoot").shadowRoot,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Thread button:contains(Load More):not(:visible)",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { contains } from "@web/../tests/utils";
|
||||
|
||||
registry.category("web_tour.tours").add("star_message_tour", {
|
||||
steps: () => [
|
||||
{
|
||||
trigger:
|
||||
"#chatterRoot:shadow .o-mail-Message:not([data-starred]):contains(Test Message)",
|
||||
run: "hover && click #chatterRoot:shadow [title='Add Star']",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message[data-starred]:contains(Test Message)",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
registry.category("web_tour.tours").add("message_actions_tour", {
|
||||
steps: () => [
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Thread .o-mail-Message",
|
||||
run: async function () {
|
||||
await contains(".o-mail-Thread .o-mail-Message", {
|
||||
count: 1,
|
||||
target: document.querySelector("#chatterRoot").shadowRoot,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Composer-input",
|
||||
run: "edit New message",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Composer button:contains(Send):enabled",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Thread .o-mail-Message",
|
||||
run: async function () {
|
||||
await contains(".o-mail-Thread .o-mail-Message", {
|
||||
count: 2,
|
||||
target: document.querySelector("#chatterRoot").shadowRoot,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message[data-persistent]:contains(New message)",
|
||||
run: "hover && click #chatterRoot:shadow button[title='Add a Reaction']",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-QuickReactionMenu-emoji span:contains(❤️)",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger:
|
||||
"#chatterRoot:shadow .o-mail-Message:contains(New message) .o-mail-MessageReaction:contains(❤️)",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message:contains(New message)",
|
||||
run: "hover && click #chatterRoot:shadow button[title='Edit']",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message .o-mail-Composer-input",
|
||||
run: "edit Message content changed",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message button:contains(save)",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message:contains(Message content changed)",
|
||||
run: "hover && click #chatterRoot:shadow button[title='Delete']",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow button:contains(Delete)",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Thread .o-mail-Message",
|
||||
run: async function () {
|
||||
await contains(".o-mail-Thread .o-mail-Message", {
|
||||
count: 1,
|
||||
target: document.querySelector("#chatterRoot").shadowRoot,
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
|
||||
const cannedResponseButtonSelector = "button[title='Insert a Canned response']";
|
||||
|
||||
registry.category("web_tour.tours").add("portal_composer_actions_tour_internal_user", {
|
||||
steps: () => [
|
||||
{
|
||||
trigger: `#chatterRoot:shadow .o-mail-Composer ${cannedResponseButtonSelector}`,
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Composer-input",
|
||||
run() {
|
||||
if (this.anchor.value !== "::") {
|
||||
console.error(
|
||||
"Clicking on the canned response button should insert the '::' into the composer."
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
trigger:
|
||||
"#chatterRoot:shadow .o-mail-Composer-suggestion:contains(Hello, how may I help you?)",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
registry.category("web_tour.tours").add("portal_composer_actions_tour_portal_user", {
|
||||
steps: () => [
|
||||
{
|
||||
trigger: `#chatterRoot:shadow .o-mail-Composer:not(:has(${cannedResponseButtonSelector}))`,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import { messageActionsRegistry } from "@mail/core/common/message_actions";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
|
||||
registry.category("web_tour.tours").add("portal_copy_link_tour", {
|
||||
steps: () => [
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message",
|
||||
run: () => {
|
||||
const copyLinkAction = messageActionsRegistry.get("copy-link");
|
||||
patch(copyLinkAction, { sequence: 1 }); // make sure the action is visible without expanding
|
||||
}
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message:contains(Test Message)",
|
||||
run: "hover && click",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message-actions [title='Copy Link']",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
import { messageActionsRegistry } from "@mail/core/common/message_actions";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
|
||||
registry.category("web_tour.tours").add("portal_no_copy_link_tour", {
|
||||
steps: () => [
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message",
|
||||
run: () => {
|
||||
const copyLinkAction = messageActionsRegistry.get("copy-link");
|
||||
patch(copyLinkAction, { sequence: 1 }); // make sure the action is visible without expanding
|
||||
}
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message:contains(Test Message)",
|
||||
run: "hover && click",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message-actions",
|
||||
run: async () => {
|
||||
const copyLinkButton = document.querySelector('#chatterRoot').shadowRoot.querySelector("[title='Copy Link']");
|
||||
if (copyLinkButton) {
|
||||
throw new Error("Users without read access should not be able to copy the link to a message");
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
|
||||
const ratingCardSelector = ".o_website_rating_card_container";
|
||||
|
||||
registry.category("web_tour.tours").add("portal_rating_tour", {
|
||||
steps: () => [
|
||||
{
|
||||
// Ensure that the rating data has been fetched before making a negative assertion for rating cards.
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message-body:text(Message without rating)",
|
||||
},
|
||||
{
|
||||
trigger: `#chatterRoot:shadow .o-mail-Chatter-top:not(:has(${ratingCardSelector}))`,
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Composer-input",
|
||||
run: "edit Excellent service!",
|
||||
},
|
||||
{
|
||||
trigger: "#chatterRoot:shadow .o-mail-Composer-send:enabled",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: `#chatterRoot:shadow .o-mail-Chatter-top ${ratingCardSelector} .o_website_rating_table_row[data-star='4']:has(:text(100%))`,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
registry.category("web_tour.tours").add("portal_display_rating_tour", {
|
||||
steps: () => [
|
||||
{
|
||||
trigger: `#chatterRoot:shadow .o-mail-Chatter-top ${ratingCardSelector}`,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
registry.category("web_tour.tours").add("portal_not_display_rating_tour", {
|
||||
steps: () => [
|
||||
{
|
||||
// Ensure that the rating data has been fetched before making a negative assertion for rating cards.
|
||||
trigger: "#chatterRoot:shadow .o-mail-Message-body:text(Message with rating)",
|
||||
},
|
||||
{
|
||||
trigger: `#chatterRoot:shadow .o-mail-Chatter-top:not(:has(${ratingCardSelector}))`,
|
||||
},
|
||||
],
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue