Initial commit: Core packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:45 +02:00
commit 12c29a983b
9512 changed files with 8379910 additions and 0 deletions

View file

@ -0,0 +1,30 @@
/** @odoo-module **/
import tour from 'web_tour.tour';
tour.register('mail/static/tests/tours/discuss_public_tour.js', {
test: true,
}, [{
trigger: '.o_DiscussPublicView',
extraTrigger: '.o_ThreadView',
}, {
content: "Check that we are on channel page",
trigger: '.o_ThreadView',
run() {
if (!window.location.pathname.startsWith('/discuss/channel')) {
console.error('Did not automatically redirect to channel page');
}
// Wait for modules to be loaded or failed for the next step
odoo.__DEBUG__.didLogInfo.then(() => {
const { missing, failed, unloaded } = odoo.__DEBUG__.jsModules;
if ([missing, failed, unloaded].some(arr => arr.length)) {
console.error("Couldn't load all JS modules.", JSON.stringify({ missing, failed, unloaded }));
}
document.body.classList.add('o_mail_channel_public_modules_loaded');
});
},
extraTrigger: '.o_mail_channel_public_modules_loaded',
}, {
content: "Wait for all modules loaded check in previous step",
trigger: '.o_mail_channel_public_modules_loaded',
}]);

View file

@ -0,0 +1,31 @@
/** @odoo-module **/
import tour from 'web_tour.tour';
tour.register('mail/static/tests/tours/mail_channel_as_guest_tour.js', {
test: true,
}, [{
content: "Click join",
trigger: '.o_WelcomeView_joinButton',
extraTrigger: '.o_ThreadView',
}, {
content: "Check that we are on channel page",
trigger: '.o_ThreadView',
run() {
if (!window.location.pathname.startsWith('/discuss/channel')) {
console.error('Clicking on join button did not redirect to channel page');
}
// Wait for modules to be loaded or failed for the next step
odoo.__DEBUG__.didLogInfo.then(() => {
const { missing, failed, unloaded } = odoo.__DEBUG__.jsModules;
if ([missing, failed, unloaded].some(arr => arr.length)) {
console.error("Couldn't load all JS modules.", JSON.stringify({ missing, failed, unloaded }));
}
document.body.classList.add('o_mail_channel_as_guest_tour_modules_loaded');
});
},
extraTrigger: '.o_mail_channel_as_guest_tour_modules_loaded',
}, {
content: "Wait for all modules loaded check in previous step",
trigger: '.o_mail_channel_as_guest_tour_modules_loaded',
}]);

View file

@ -0,0 +1,97 @@
/** @odoo-module **/
import {
createFile,
inputFiles,
} from 'web.test_utils_file';
import { contains } from '@web/../tests/utils';
import tour from 'web_tour.tour';
/**
* This tour depends on data created by python test in charge of launching it.
* It is not intended to work when launched from interface. It is needed to test
* an action (action manager) which is not possible to test with QUnit.
* @see mail/tests/test_mail_full_composer.py
*/
tour.register('mail/static/tests/tours/mail_full_composer_test_tour.js', {
test: true,
}, [{
content: "Wait for the chatter to be fully loaded",
trigger: ".o_Chatter",
async run() {
await contains(".o_Message", { count: 1 });
document.body.setAttribute("data-found-message", 1);
},
}, {
content: "Click on Send Message",
trigger: '.o_ChatterTopbar_buttonSendMessage',
extra_trigger: 'body[data-found-message=1]',
}, {
content: "Write something in composer",
trigger: '.o_ComposerTextInput_textarea',
run: 'text blahblah',
}, {
content: "Add one file in composer",
trigger: '.o_Composer_buttonAttachment',
async run() {
const file = await createFile({
content: 'hello, world',
contentType: 'text/plain',
name: 'text.txt',
});
const messaging = await odoo.__DEBUG__.messaging;
const uploader = messaging.models['ComposerView'].all()[0].fileUploader;
inputFiles(
uploader.fileInput,
[file]
);
},
}, {
content: "Open full composer",
trigger: '.o_Composer_buttonFullComposer',
extra_trigger: '.o_AttachmentCard:not(.o-isUploading)' // waiting the attachment to be uploaded
}, {
content: "Check the earlier provided attachment is listed",
trigger: '.o_AttachmentCard[title="text.txt"]',
run() {},
}, {
content: "Check subject is autofilled",
trigger: '[name="subject"] input',
run() {
const subjectValue = document.querySelector('[name="subject"] input').value;
if (subjectValue !== "Re: Jane") {
console.error(
`Full composer should have "Re: Jane" in subject input (actual: ${subjectValue})`
);
}
},
}, {
content: "Check composer content is kept",
trigger: '.o_field_html[name="body"]',
run() {
const bodyContent = document.querySelector('.o_field_html[name="body"]').textContent;
if (!bodyContent.includes("blahblah")) {
console.error(
`Full composer should contain text from small composer ("blahblah") in body input (actual: ${bodyContent})`
);
}
},
}, {
content: "Open templates",
trigger: '.o_field_widget[name="template_id"] input',
}, {
content: "Check a template is listed",
in_modal: false,
trigger: '.ui-autocomplete .ui-menu-item a:contains("Test template")',
run() {},
}, {
content: "Send message",
trigger: '.o_mail_send',
}, {
content: "Check message is shown",
trigger: '.o_Message:contains("blahblah")',
}, {
content: "Check message contains the attachment",
trigger: '.o_Message .o_AttachmentCard_filename:contains("text.txt")',
}]);

View file

@ -0,0 +1,26 @@
/** @odoo-module **/
import tour from 'web_tour.tour';
/**
* Verify that a user can modify their own profile information.
*/
tour.register('mail/static/tests/tours/user_modify_own_profile_tour.js', {
test: true,
}, [{
content: 'Open user account menu',
trigger: '.o_user_menu button',
}, {
content: "Open preferences / profile screen",
trigger: '[data-menu=settings]',
}, {
content: "Update the email address",
trigger: 'div[name="email"] input',
run: 'text updatedemail@example.com',
}, {
content: "Save the form",
trigger: 'button[name="preference_save"]',
}, {
content: "Wait until the modal is closed",
trigger: 'body:not(.modal-open)',
}]);