summaryrefslogtreecommitdiff
path: root/addons/website_sale_coupon
diff options
context:
space:
mode:
authorRomain Derie <rde@odoo.com>2020-02-11 13:28:43 +0000
committerRomain Derie <rde@odoo.com>2020-02-14 12:45:57 +0000
commit028774fd355e324405ce8b83a6481bee5753b740 (patch)
tree418b9a5ce8b65d2e53009e91f4573ec9b2f84e81 /addons/website_sale_coupon
parent49140ca8344b2baedd1676719121f16b58d1cf1b (diff)
[FIX] website_sale_coupon: prevent race condition
2 lasts steps are: - Click on go to checkout - Ensure checkout total is correct But the last condition was already true before landing to the checkout, thus the last step would succeed while the page is transitionning to the checkout. The following would happen every time: - Click on go to checkout - Last step succeed directly after the previous step click on Go to checkout Then, the following would happen rarely: - The tour is considered successful - The checkout page is loaded - Some GET requests are performed - The tour is killed (cookies & local storage) - Some other GET requests are crashing, such as: `Error loading file http://127.0.0.1:8069/web/webclient/locale/en_US` The fix simply wait for the checkout page to be loaded as it was supposed to at first, before checking the last step. Forward-port of https://github.com/odoo/enterprise/pull/8322 X-original-commit: https://github.com/odoo/enterprise/commit/67686b697c866a5e5ad141a85b3589f1f1598d73 (coupon was moved from enterprise to community in Odoo saas-12.3) Closes #45097 closes odoo/odoo#45395 X-original-commit: 6768d87969f30e40b2e13a32c15330832afb780e Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Diffstat (limited to 'addons/website_sale_coupon')
-rw-r--r--addons/website_sale_coupon/static/tests/tours/website_sale_coupon.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/website_sale_coupon/static/tests/tours/website_sale_coupon.js b/addons/website_sale_coupon/static/tests/tours/website_sale_coupon.js
index 2d141ee497b..9cf1926a3af 100644
--- a/addons/website_sale_coupon/static/tests/tours/website_sale_coupon.js
+++ b/addons/website_sale_coupon/static/tests/tours/website_sale_coupon.js
@@ -162,7 +162,8 @@ tour.register('shop_sale_coupon', {
trigger: 'a[href="/shop/checkout?express=1"]',
},
{
- content: "check total is unchanged",
+ content: "check total is unchanged once we land on payment page",
+ extra_trigger: '#payment_method h3:contains("Pay with")',
trigger: 'tr#order_total .oe_currency_value:contains("967.50")',
run: function () {}, // it's a check
},