diff options
| author | Romeo Fragomeli <rfr@odoo.com> | 2020-10-22 10:14:51 +0000 |
|---|---|---|
| committer | Romeo Fragomeli <rfr@odoo.com> | 2020-10-30 16:04:59 +0000 |
| commit | dacc1703c486c8affb44df679ab5e8e2ba724867 (patch) | |
| tree | c143c36c04fc0af19f6950f272ec983e4f15f07e | |
| parent | 85384dd0bb8de5e98e585cb8610d58b11e601520 (diff) | |
[FIX] test_main_flows: fix main flow on Mobile (on changing month)
On mobile, when tours are run on changing month, the "Register Payment"
step often fails with the following error:
AssertionError: The test code "odoo.startTour('main_flow_tour')" failed
Tour main_flow_tour failed at step Register Payment (trigger:
.o_statusbar_buttons button:enabled:contains('Register Payment'))
Please note before going further:
* The main flow is a tour. The tour manager waits for the trigger and
the extra trigger to be reachable before executing the step.
* On mobile the status bar buttons are wrapped in a dropdown.
So the stepUtils.statusbarButtonsSteps is composed by two actions:
1 - Open the dropdown if present.
2 - Click on the button.
Before this commit, the extra trigger doesn't look like the best one:
when this tour is executed during month change, the account
module has to perform some heavier (and longer) processes.
When the "Validate" call button is made (previous step), a lot of RPC
are made and, usually, the previous extra trigger works fine.
But for some reasons, the _renderStatusbarButtons is called
between the two steps in the statusbarButtonsSteps.
So this is the flow:
- Running the tour until...
- Click "Validate" button (this generates a bunch of RPC).
- Open the dropdown.
- Some RPC respond, which refresh the "state" and call _renderStatusbarButtons
(dropdown is not open anymore).
- Try to click on "Register Payment" => BUG
(button is present but not visible, so unreachable).
After this commit, the extra trigger is changed to force waiting for
the RPC that change the "state" and call _renderStatusbarButtons
before executing the "Register Payment" step.
closes odoo/odoo#61072
X-original-commit: 1085ec7fca98b309f32a416064a04ca29e879b05
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
| -rw-r--r-- | odoo/addons/test_main_flows/static/tests/tours/main_flow.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/addons/test_main_flows/static/tests/tours/main_flow.js b/odoo/addons/test_main_flows/static/tests/tours/main_flow.js index 5cb4dd71ea2..faf250401ae 100644 --- a/odoo/addons/test_main_flows/static/tests/tours/main_flow.js +++ b/odoo/addons/test_main_flows/static/tests/tours/main_flow.js @@ -941,7 +941,7 @@ tour.stepUtils.mobileModifier(tour.stepUtils.autoExpandMoreButtons('.o_control_p position: "bottom", }, ...tour.stepUtils.statusbarButtonsSteps('Confirm', _t("Validate"), ".breadcrumb-item.active:contains('Draft Invoice')"), -...tour.stepUtils.statusbarButtonsSteps('Register Payment', _t("Register Payment"), ".breadcrumb-item.active:contains('INV/')"), +...tour.stepUtils.statusbarButtonsSteps('Register Payment', _t("Register Payment"), ".o_statusbar_status .btn.dropdown-toggle:contains('Posted')"), { trigger: ".modal-footer .btn-primary", content: _t("Validate"), |
