From bb908979e9e9ce1042d03aa591c86612e285ec5e Mon Sep 17 00:00:00 2001 From: fwi-odoo Date: Thu, 13 Jul 2017 10:46:39 +0200 Subject: [PATCH] [FIX] web: avoid interactions between drag and drop tests The commit 5854bb7d12ebae359dc1bef20c966c9f0e8d983e introduces a new option to drag element without dropping them. But it's not allowed to start a new drag and drop until the first one is completely done. So when the element is removed from the dom (the test is finished), we complete the drag and drop in order to let next tests perform drag and drop. --- addons/web/static/tests/helpers/test_utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/static/tests/helpers/test_utils.js b/addons/web/static/tests/helpers/test_utils.js index 0b47e9d0df8..213d87ef8b0 100644 --- a/addons/web/static/tests/helpers/test_utils.js +++ b/addons/web/static/tests/helpers/test_utils.js @@ -412,6 +412,14 @@ function dragAndDrop($el, $to, options) { pageX: toOffset.left, pageY: toOffset.top })); + } else { + // It's impossible to drag another element when one is already + // being dragged. So it's necessary to finish the drop when the test is + // over otherwise it's impossible for the next tests to drag and + // drop elements. + $el.on("remove", function () { + $el.trigger($.Event("mouseup")); + }); } }