From 992fb00b64b59424c1812e6b1693c4da9060ed22 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 22 Jul 2022 13:29:16 +0000 Subject: [PATCH] [FIX] test_new_api: properly conclude tours - the x2many tour would finish on a click canceling the creation but not wait for that to resolve, leading to the driver catching it in the act (checking before the client had had the time to switch), just need to wait for the list view to be displayed - the constraints tour would just drop in the middle of a creation with an error dialog open, so need to finish the entire thing and go back to the list view Part-of: odoo/odoo#96517 --- .../test_new_api/static/tests/tours/constraint.js | 9 +++++++-- odoo/addons/test_new_api/static/tests/tours/x2many.js | 10 ++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/odoo/addons/test_new_api/static/tests/tours/constraint.js b/odoo/addons/test_new_api/static/tests/tours/constraint.js index 0fac43f89e7..e273d14ae32 100644 --- a/odoo/addons/test_new_api/static/tests/tours/constraint.js +++ b/odoo/addons/test_new_api/static/tests/tours/constraint.js @@ -27,6 +27,11 @@ odoo.define('web.test.constraint', function (require) { }, { // check popup content content: "check notification box", trigger: '.o_dialog_warning:contains(The color code must be positive !)', - run: function () {}, // it's a check - }]); + run() {} + }, { + content: "close notification box", + trigger: '.modal-footer .o-default-button', + }, + ...tour.stepUtils.discardForm(), + ]); }); diff --git a/odoo/addons/test_new_api/static/tests/tours/x2many.js b/odoo/addons/test_new_api/static/tests/tours/x2many.js index dc4025c9473..04d161bb84e 100644 --- a/odoo/addons/test_new_api/static/tests/tours/x2many.js +++ b/odoo/addons/test_new_api/static/tests/tours/x2many.js @@ -472,13 +472,11 @@ odoo.define('web.test.x2many', function (require) { trigger: '.o_field_widget[name=name] input', run: 'text {generate_dummy_message}', }, { - content: "chuck update and new dummy message happened", + content: "check update and new dummy message happened", trigger: '.o_field_widget[name=messages] .o_data_row .o_list_number:containsExact(22)', extra_trigger: '.o_field_widget[name=important_messages] .o_data_row .o_list_number:containsExact(22)', run: function () {}, // it's a check - }, { // cancel - content: "cancel change", - trigger: '.o_cp_buttons .o_form_button_cancel', - run: 'click', - }]); + }, + ...tour.stepUtils.discardForm(), + ]); });