| 1 | import { registry } from "@web/core/registry"; |
| 2 | import { stepUtils } from "@web_tour/tour_utils"; |
| 3 | |
| 4 | registry.category("web_tour.tours").add("hr_skills_tour", { |
| 5 | url: "/odoo", |
| 6 | steps: () => [ |
| 7 | stepUtils.showAppsMenuItem(), |
| 8 | { |
| 9 | content: "Open Employees app", |
| 10 | trigger: ".o_app[data-menu-xmlid='hr.menu_hr_root']", |
| 11 | run: "click", |
| 12 | }, |
| 13 | { |
| 14 | content: "Create a new employee", |
| 15 | trigger: ".o-kanban-button-new", |
| 16 | run: "click", |
| 17 | }, |
| 18 | { |
| 19 | content: "Pick a name", |
| 20 | trigger: ".o_field_widget[name='name'] input", |
| 21 | run: "edit Jony McHallyFace", |
| 22 | }, |
| 23 | { |
| 24 | content: "Save", |
| 25 | trigger: ".o_form_button_save", |
| 26 | run: "click", |
| 27 | }, |
| 28 | { |
| 29 | content: "Add Experience", |
| 30 | trigger: ".nav-link:contains('Resume')", |
| 31 | run: "click", |
| 32 | }, |
| 33 | { |
| 34 | content: "Add a new Resume experience", |
| 35 | trigger: ".o_field_resume_one2many button.btn-secondary", |
| 36 | run: "click", |
| 37 | }, |
| 38 | { |
| 39 | content: "Enter some company name", |
| 40 | trigger: |
| 41 | ".modal:contains(new resume line) .modal-body .o_field_widget[name='name'] input", |
| 42 | run: "edit Mamie Rock", |
| 43 | }, |
| 44 | { |
| 45 | trigger: ".modal:contains(new resume line) .o_field_widget[name='date_start'] button", |
| 46 | content: "open date picker", |
| 47 | run: "click", |
| 48 | }, |
| 49 | { |
| 50 | content: "Set start date", |
| 51 | trigger: ".modal:contains(new resume line) .o_field_widget[name='date_start'] input", |
| 52 | run: "edit 12/05/2017", |
| 53 | }, |
| 54 | { |
| 55 | content: "Give some description", |
| 56 | trigger: `.modal:contains(new resume line) .o_field_html[name='description'] div.o-paragraph`, |
| 57 | run: "editor Sang some songs and played some music", |
| 58 | }, |
| 59 | { |
| 60 | content: "Save it", |
| 61 | trigger: ".modal:contains(new resume line) .o_form_button_save:contains(save)", |
| 62 | run: "click", |
| 63 | }, |
| 64 | { |
| 65 | trigger: "body:not(:has(.modal:contains(new resume line)))", |
| 66 | }, |
| 67 | { |
| 68 | content: "Edit newly created experience", |
| 69 | trigger: ".o_resume_line_title:contains(Mamie Rock)", |
| 70 | run: "click", |
| 71 | }, |
| 72 | { |
| 73 | content: "Change type", |
| 74 | trigger: ".modal:contains(new resume line) .o_field_widget[name='line_type_id'] .o_selection_badge:contains(Other Experience)", |
| 75 | run: "click", |
| 76 | }, |
| 77 | { |
| 78 | content: "Save experience change", |
| 79 | trigger: ".modal:contains(new resume line) .o_form_button_save:contains(save)", |
| 80 | run: "click", |
| 81 | }, |
| 82 | { |
| 83 | trigger: "body:not(:has(.modal:contains(new resume line)))", |
| 84 | }, |
| 85 | { |
| 86 | content: "Add a new Skill", |
| 87 | trigger: ".o_field_skills_one2many button:contains('Pick a skill from the list')", |
| 88 | run: "click", |
| 89 | }, |
| 90 | { |
| 91 | content: "Select Music", |
| 92 | trigger: ".o_field_widget[name='skill_type_id'] span:contains('Best Music')", |
| 93 | run: "click", |
| 94 | }, |
| 95 | { |
| 96 | content: "Choose the song", |
| 97 | trigger: ".o_field_widget[name='skill_id'] span:contains('Fortunate Son')", |
| 98 | run: "click", |
| 99 | }, |
| 100 | { |
| 101 | content: "Choose the level", |
| 102 | trigger: ".o_field_widget[name='skill_level_id'] span:contains('Level 2')", |
| 103 | run: "click", |
| 104 | }, |
| 105 | { |
| 106 | content: "Save new skill", |
| 107 | trigger: ".modal:contains(update skills) .o_form_button_save:contains(save & close)", |
| 108 | run: "click", |
| 109 | }, |
| 110 | { |
| 111 | content: |
| 112 | "Wait the new skill is completely saved. Ensure also the modal is closed before open a new one.", |
| 113 | trigger: "body:not(:has(.modal))", |
| 114 | }, |
| 115 | { |
| 116 | content: "Check if item is added", |
| 117 | trigger: ".o_data_row td.o_data_cell:contains('Fortunate Son')", |
| 118 | }, |
| 119 | { |
| 120 | content: "Add a new Skill", |
| 121 | trigger: ".o_field_skills_one2many button:contains('ADD')", |
| 122 | run: "click", |
| 123 | }, |
| 124 | { |
| 125 | content: "Select Certification", |
| 126 | trigger: ".o_field_widget[name='skill_type_id'] span:contains('Music Certification')", |
| 127 | run: "click", |
| 128 | }, |
| 129 | { |
| 130 | content: "Choose the instrument", |
| 131 | trigger: ".o_field_widget[name='skill_id'] span:contains('Piano')", |
| 132 | run: "click", |
| 133 | }, |
| 134 | { |
| 135 | content: "Choose the level", |
| 136 | trigger: "div[name='valid_from'] button", |
| 137 | run: "click", |
| 138 | }, |
| 139 | { |
| 140 | content: "Choose the level", |
| 141 | trigger: ".o_field_widget[name='valid_from'] input", |
| 142 | run: "edit 02/03/2025", |
| 143 | }, |
| 144 | { |
| 145 | content: "Choose the level", |
| 146 | trigger: ".o_field_widget[name='valid_to']", |
| 147 | run: "click", |
| 148 | }, |
| 149 | { |
| 150 | content: "Choose the level", |
| 151 | trigger: ".o_field_widget[name='valid_to'] input", |
| 152 | run: "edit 03/04/2025", |
| 153 | }, |
| 154 | { |
| 155 | content: "Save new skill", |
| 156 | trigger: ".modal:contains(update skills) .o_form_button_save:contains(save & close)", |
| 157 | run: "click", |
| 158 | }, |
| 159 | { |
| 160 | content: "Wait the new skill is completely saved", |
| 161 | trigger: "body:not(:has(.modal))", |
| 162 | }, |
| 163 | { |
| 164 | content: "Check if item is added", |
| 165 | trigger: ".o_data_row td.o_data_cell:contains('Piano')", |
| 166 | }, |
| 167 | ...stepUtils.saveForm(), |
| 168 | ], |
| 169 | }); |