mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-26 16:12:01 +02:00
19.0 vanilla
This commit is contained in:
parent
a1137a1456
commit
e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions
|
|
@ -0,0 +1,81 @@
|
|||
import { registry } from '@web/core/registry';
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
const today = luxon.DateTime.now();
|
||||
const pastDateFrom = today.minus({ days: 3 }).toFormat("MM/dd/yyyy");
|
||||
const pastDateTo = today.minus({ days: 2 }).toFormat("MM/dd/yyyy");
|
||||
const futureDateTo = today.plus({ days: 2 }).toFormat("MM/dd/yyyy");
|
||||
const warningText = "The allocated days cannot be used, because the allocation is set to finish in the past.";
|
||||
|
||||
registry.category("web_tour.tours").add("time_off_allocation_warning_tour", {
|
||||
url: "/odoo",
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
content: "Click Time Off",
|
||||
trigger: ".o_app[data-menu-xmlid='hr_holidays.menu_hr_holidays_root']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Open Management menu",
|
||||
trigger: ".o-dropdown[data-menu-xmlid='hr_holidays.menu_hr_holidays_management']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Go to Allocations",
|
||||
trigger: ".o-dropdown-item[data-menu-xmlid='hr_holidays.hr_holidays_menu_manager_approve_allocations']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Create a new allocation",
|
||||
trigger: ".o-kanban-button-new",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click to select a leave type",
|
||||
trigger: ".o_field_widget[name='holiday_status_id'] input",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: ".o-autocomplete--dropdown-menu > li > a[id=holiday_status_id_0_0_0]",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Open the start date picker",
|
||||
trigger: ".o_field_widget[name='date_from'] button",
|
||||
// Past date to trigger the warning
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Edit the start date picker",
|
||||
trigger: ".o_field_widget[name='date_from'] input",
|
||||
// Past date to trigger the warning
|
||||
run: `click && edit ${pastDateFrom}`,
|
||||
},
|
||||
{
|
||||
content: "Edit the end date picker",
|
||||
trigger: ".o_field_widget[name='date_to'] input",
|
||||
// Past date to trigger the warning
|
||||
run: `click && edit ${pastDateTo} && click body`,
|
||||
},
|
||||
{
|
||||
content: "Error regarding allocation to be visible",
|
||||
trigger: `.o_cell:has(.o_row[name='validity']) + div span:contains(${warningText})`,
|
||||
},
|
||||
{
|
||||
content: "Open the end date picker",
|
||||
trigger: ".o_field_widget[name='date_to'] button",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Edit the end date picker",
|
||||
trigger: ".o_field_widget[name='date_to'] input",
|
||||
run: `click && edit ${futureDateTo} && click body`,
|
||||
},
|
||||
{
|
||||
content: "Error regarding allocation to be visible",
|
||||
trigger: `.o_cell:has(.o_row[name='validity']) + div:not(:has(span:not(:contains(${warningText}))))`,
|
||||
},
|
||||
...stepUtils.saveForm(),
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
registry.category("web_tour.tours").add("time_off_card_tour", {
|
||||
url: "/odoo",
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
content: "Open Time Off app",
|
||||
trigger: '.o_app[data-menu-xmlid="hr_holidays.menu_hr_holidays_root"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the Time Off name",
|
||||
trigger: '.o_timeoff_name:not(:contains("Pending Requests"))',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Ensure the list view for Time Off requests is displayed",
|
||||
trigger: ".o_list_view",
|
||||
},
|
||||
{
|
||||
content: "Navigate back to the previous view",
|
||||
trigger: ".o_back_button",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the time off card to open the detailed popover.",
|
||||
trigger: "span.o_timeoff_details",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Verify that the popover is displayed after clicking on the time off details.",
|
||||
trigger: ".o_popover",
|
||||
},
|
||||
{
|
||||
content: "Click on the link containing 'Allocated'.",
|
||||
trigger: ".o_popover .btn-link:contains('Allocated')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Ensure the list view for Time Off requests is displayed",
|
||||
trigger: ".o_list_view",
|
||||
},
|
||||
{
|
||||
content: "Navigate back to the previous view",
|
||||
trigger: ".o_back_button",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the time off card to open the detailed popover.",
|
||||
trigger: "span.o_timeoff_details",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the link containing 'Approved'",
|
||||
trigger: ".o_popover .btn-link:contains('Approved')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Ensure the list view for Time Off requests is displayed",
|
||||
trigger: ".o_list_view",
|
||||
},
|
||||
{
|
||||
content: "Navigate back to the previous view",
|
||||
trigger: ".o_back_button",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the time off card to open the detailed popover.",
|
||||
trigger: "span.o_timeoff_details",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the link containing 'Planned'",
|
||||
trigger: ".o_popover .btn-link:contains('Planned')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Ensure the list view for Time Off requests is displayed",
|
||||
trigger: ".o_list_view",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
registry.category("web_tour.tours").add("time_off_graph_view_tour", {
|
||||
url: "/odoo",
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
content: "Open Time Off app",
|
||||
trigger: ".o_app[data-menu-xmlid='hr_holidays.menu_hr_holidays_root']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: ".fc-daygrid-day-top",
|
||||
},
|
||||
{
|
||||
content: "Open reporting menu",
|
||||
trigger: ".o-dropdown[data-menu-xmlid='hr_holidays.menu_hr_holidays_report']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Open reporting by type",
|
||||
trigger: ".o-dropdown-item[data-menu-xmlid='hr_holidays.menu_hr_holidays_summary_all']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: ".o_graph_canvas_container",
|
||||
},
|
||||
{
|
||||
content: "Open bar chart view",
|
||||
trigger: "button[data-mode='bar']",
|
||||
run: "click",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -1,47 +1,24 @@
|
|||
odoo.define('hr_holidays.tour_time_off_request_calendar_view', function (require) {
|
||||
'use strict';
|
||||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
var tour = require('web_tour.tour');
|
||||
|
||||
tour.register('time_off_request_calendar_view', {
|
||||
test: true,
|
||||
url: '/web',
|
||||
},
|
||||
[
|
||||
tour.stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
content: "Open Time Off app",
|
||||
trigger: '.o_app[data-menu-xmlid="hr_holidays.menu_hr_holidays_root"]',
|
||||
},
|
||||
{
|
||||
content: "Click on the first Thursday of the year",
|
||||
trigger: '.fc-day-top.fc-thu',
|
||||
run: () => {
|
||||
const el = document.querySelector('.fc-day-top.fc-thu').firstChild;
|
||||
el.scrollIntoView();
|
||||
|
||||
const fromPosition = el.getBoundingClientRect();
|
||||
fromPosition.x += el.offsetWidth / 2;
|
||||
fromPosition.y += el.offsetHeight / 2;
|
||||
|
||||
el.dispatchEvent(new MouseEvent("mousedown", {
|
||||
bubbles: true,
|
||||
which: 1,
|
||||
button: 0,
|
||||
clientX: fromPosition.x,
|
||||
clientY: fromPosition.y}));
|
||||
el.dispatchEvent(new MouseEvent("mouseup", {
|
||||
bubbles: true,
|
||||
which: 1,
|
||||
button: 0,
|
||||
clientX: fromPosition.x,
|
||||
clientY: fromPosition.y }));
|
||||
}
|
||||
},
|
||||
{
|
||||
content: "Save the leave",
|
||||
trigger: '.btn:contains("Save")',
|
||||
run: 'click',
|
||||
}
|
||||
]);
|
||||
registry.category("web_tour.tours").add("time_off_request_calendar_view", {
|
||||
url: "/odoo",
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
content: "Open Time Off app",
|
||||
trigger: '.o_app[data-menu-xmlid="hr_holidays.menu_hr_holidays_root"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the first Thursday of the year",
|
||||
trigger: ".fc-daygrid-day.fc-day-thu:not(.fc-day-disabled)",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Save the leave",
|
||||
trigger: '.o_form_button_save',
|
||||
run: "click",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue