From 070bd40f64da3b16fbfce42de867aaf9e149d64a Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 10 Jan 2019 09:35:46 +0000 Subject: [PATCH] [FIX] website_sale(_wishlist): adapt tours to delay removal After the delay removal, those two tours failed for the same reason. They made a research on the /shop page with a specific product name, and then opened that product. With the delay, the page was reloaded with the new search, and we clicked on the product after the reload. Without the delay, we directly click on the product (which is in both case already displayed even before searching), and then the page is reloaded, so the product is never opened and the tours fail. This rev. adapts those tours to either wait for the page to be reloaded before clicking on the product, or simply remove the searching step when the requested product is actually the first one. --- .../static/src/js/website_sale_tour_buy.js | 2 +- .../static/src/js/website_sale_tour_wishlist.js | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/addons/website_sale/static/src/js/website_sale_tour_buy.js b/addons/website_sale/static/src/js/website_sale_tour_buy.js index 1797a59ea9b..87ae9564b65 100644 --- a/addons/website_sale/static/src/js/website_sale_tour_buy.js +++ b/addons/website_sale/static/src/js/website_sale_tour_buy.js @@ -21,7 +21,7 @@ tour.register('shop_buy_product', { }, { content: "select conference chair", - trigger: '.oe_product_cart a:contains("Conference Chair")', + trigger: '.oe_product_cart:first a:contains("Conference Chair")', }, { content: "select Conference Chair Aluminium", diff --git a/addons/website_sale_wishlist/static/src/js/website_sale_tour_wishlist.js b/addons/website_sale_wishlist/static/src/js/website_sale_tour_wishlist.js index b03e0108fb2..8089d8fb3e7 100644 --- a/addons/website_sale_wishlist/static/src/js/website_sale_tour_wishlist.js +++ b/addons/website_sale_wishlist/static/src/js/website_sale_tour_wishlist.js @@ -47,14 +47,9 @@ tour.register('shop_wishlist', { }, }, { - content: "check that logged in and search for Customizable Desk", - extra_trigger: "li span:contains('Mitchell Admin')", - trigger: 'form input[name="search"]', - run: "text Customizable Desk", - }, - { - content: "submit search", - trigger: 'form:has(input[name="search"]) .oe_search_button', + content: "check that logged in", + trigger: "li span:contains('Mitchell Admin')", + run: function () {}, }, { content: "click on Customizable Desk",