Files
odoo_source/addons/project/static/tests/tours/project_sharing_tour.js
T
Pierre Paridans eef262abf4 [FIX] *: adapt QUnit tests and tours
[FIX] *: selectors in tours

[FIX][TMP] account: CogMenu selector in tours

[FIX][TMP] web*: Breadcrumb targetting in tours

Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).

add classname on last breadcrumb item

[FIX][TMP] project: View buttons selector in tours (moved away from CP)

[FIX][TMP] project: Kanban selectors in tours (quick create)

[FIX][TMP] *: SearchBar selectors in tours (toggle menu)

[FIX][TMP] *: ButtonBox selector in tours

[WIP][IMP] web: add toggleSearchBarMenu in search helpers

adapt and unskip 3 list tests

adapt and unskip calendar tests

unskip web_tour test that actually pass

post rebase fix

allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later

post rebase fixes

fix

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00

101 lines
4.2 KiB
JavaScript

/** @odoo-module **/
import { registry } from "@web/core/registry";
import { stepUtils } from "@web_tour/tour_service/tour_utils";
const projectSharingSteps = [...stepUtils.goToAppSteps("project.menu_main_pm", 'Go to the Project App.'), {
trigger: '.o_kanban_record:contains("Project Sharing") .o_dropdown_kanban .dropdown-toggle',
content: 'Open the project dropdown.'
}, {
trigger: '.o_kanban_record:contains("Project Sharing") .dropdown-menu a:contains("Share")',
content: 'Start editing the project.',
}, {
trigger: 'div.o_field_radio[name="access_mode"] div.o_radio_item > input[data-value="edit"]',
content: 'Select "Edit" as Access mode in the "Share Project" wizard.',
}, {
trigger: '.o_field_many2many_tags_email[name=partner_ids] input',
extra_trigger: 'label[for=partner_ids_0]:contains("Invite People")',
content: 'Select the user portal as collaborator to the "Project Sharing" project.',
run: 'text Georges',
}, {
trigger: '.ui-autocomplete a.dropdown-item:contains("Georges")',
in_modal: false,
}, {
trigger: 'footer > button[name="action_send_mail"]',
content: 'Confirm the project sharing with this portal user.',
}, {
trigger: '.o_web_client',
content: 'Go to project portal view to select the "Project Sharing" project',
run: function () {
window.location.href = window.location.origin + '/my/projects';
},
}, {
id: 'project_sharing_feature',
trigger: 'table > tbody > tr a:has(span:contains(Project Sharing))',
content: 'Select "Project Sharing" project to go to project sharing feature for this project.',
}, {
trigger: 'iframe .o_project_sharing',
content: 'Wait the project sharing feature be loaded',
run: function () {},
}, {
trigger: 'iframe button.o-kanban-button-new',
content: 'Click "Create" button',
run: 'click',
}, {
trigger: 'iframe .o_kanban_quick_create .o_field_widget[name="name"] input',
content: 'Create Task',
run: 'text Test Create Task',
}, {
trigger: 'iframe .o_kanban_quick_create .o_kanban_edit',
content: 'Go to the form view of this new task',
}, {
trigger: 'iframe div[name="stage_id"] div.o_statusbar_status button[aria-checked="false"]:contains(Done)',
content: 'Change the stage of the task.',
}, {
trigger: 'iframe .o_portal_chatter_composer_input .o_portal_chatter_composer_body textarea',
content: 'Write a message in the chatter of the task',
run: 'text I create a new task for testing purpose.',
}, {
trigger: 'iframe .o_portal_chatter_composer_input .o_portal_chatter_composer_body button[name="send_message"]',
content: 'Send the message',
}, {
trigger: 'iframe ol.breadcrumb > li.o_back_button > a:contains(Project Sharing)',
content: 'Go back to the kanban view',
}, {
trigger: 'iframe .o_searchview_dropdown_toggler',
content: 'open the search panel menu',
}, {
trigger: 'iframe .o_filter_menu .dropdown-item:first-child',
content: 'click on the first item in the filter menu',
}, {
trigger: 'iframe .o_group_by_menu .dropdown-item:first-child',
content: 'click on the first item in the group by menu',
}, {
trigger: 'iframe .o_favorite_menu .o_add_favorite > button',
content: 'click to "save current search" button in favorite menu',
}, {
trigger: 'iframe .o_filter_menu .dropdown-item:first-child',
content: 'click on the first item in the filter menu',
}, {
trigger: 'iframe .o_group_by_menu .dropdown-item:first-child',
content: 'click on the first item in the group by menu',
}, {
trigger: 'iframe .o_favorite_menu .o_add_favorite > button',
content: 'click to "save current search" button in favorite menu',
}, {
trigger: 'iframe button.o_switch_view.o_list',
content: 'Go to the list view',
}];
registry.category("web_tour.tours").add('project_sharing_tour', {
test: true,
url: '/web',
steps: projectSharingSteps });
// The begining of the project sharing feature
const projectSharingStepIndex = projectSharingSteps.findIndex(s => s.id && s.id === 'project_sharing_feature');
registry.category("web_tour.tours").add('portal_project_sharing_tour', {
test: true,
url: '/my/projects',
steps: projectSharingSteps.slice(projectSharingStepIndex, projectSharingSteps.length) });