Daily updates from Odoo
Friday, March 29, 2024
1 change · master
Code cleanup and technical improvements
Automated product tours and tests now use event behavior that more closely matches real user interactions, such as typing and key presses. This makes the tours easier to understand and reduces hidden automatic behavior, improving reliability across many business flows.
Original PR description
In this commit, events in addons/web_tour/static/src/tour_service/tour_utils.js writed with native dispatchEvents has been refactored to use Hoot events. These events are much closer to the behavior…
In this commit, events in
addons/web_tour/static/src/tour_service/tour_utils.js writed with native dispatchEvents has been refactored to use Hoot events. These events are much closer to the behavior of a user (e.g. instead of overwriting the value of an input, it simulates the encoding using keydowns).
The motivation of these changes is to make the tours more understandable and significantly less implicit. As a result, “automatic” behaviors have been removed.
Here below are the main modifications made in RunningTourActionHelper class :
- The auto method has been removed.
- remove_text() has been replaced by clear().
- text() has been splitted in edit(), fill(), select(), selectByIndex(), selectByLabel() and editor().
- Default "Test" string has been removed. No text => No text (Then, note that `run edit` will just clear the input)
- New events has been added like range(), press() and blur().
A New feature has been added in tour_compiler.js :
You can now chain events in run attribute of a step with `&&` :
e.g. :
```
{
extra_trigger: ".o_web_studio_sidebar .o_web_studio_properties.active",
trigger: "input[name='string']",
run: "edit new name && press Enter",
},
```
Still to do in a next PR :
- refactor click()
- refactor drag_and_drop_native()
task~3820046
https://github.com/odoo/odoo/pull/158055