summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorRomain Derie <rde@odoo.com>2018-08-14 17:29:41 +0200
committerRomain Derie <rde@odoo.com>2018-08-14 22:09:27 +0200
commitadc41c0ed2580ac5b8f066c2761b218a44f3c45b (patch)
treee48d3030872568a50ce14b326f54461426abd5dc /addons/web/static/src/js/views/basic/basic_controller.js
parent53e6684a8692c95a4823a269135e75ca6fc35efa (diff)
[FIX] webite_sale_coupon: adapt test with new checkout
Since commit 006ce9c88763053de9003b2a197a89258d534865 set the `Promo Code` view active (customize_show), the `shop_sale_coupon` JS tour should not be working anymore. But it was working since this change introduced a race condition that was luckily making the test to succeed (most of the time). (This bug appeared weeks ago on nightly build) Basically, the tour flow was: 1. Activating `Promo Code` in customize option -> Cause a page refresh 2. Waiting for the DOM to contains the promo code input (shown after page refresh performed by step 1.) 3. Typing a promo code and submitting it 4. Waiting for the discount line to appear (after page load performed by step 3 form submit.) This test was working fine as the promo code customize option was disabled. Thus, the promo code input would only be visible after the refresh of step 1. It would always wait for the refresh to occur before continuing. No race condition possible. Since the change of 006ce9c887 that activated that view by default: - The promo code input would already be on the DOM when the tour was executed - Clicking on the customize option would actually disable it. Then, since the input was already in the DOM, the step 2 would instantly continue without waiting for the refresh of step 1 and step 3 would be performed while step 1 would still be refreshing the page. You would then land sometimes on the refresh of step 1, sometimes on the refresh of step 3, depending of the test speed (and so the runbot). In case you landed on refresh of step 1, step 4 would never find the discount line. ---- SOLUTION ---- Click on the customize option only if not already enabled. (The customize step could have simply been removed as it is now activated by default. But this is better to prevent the test to fail in case we change that customize active state in the future or to simply run the test more than once)
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions