[FIX] website_sale_coupon: make test determinist

avoid race condition when refresh of /shop finish after the search click.

Now we start on the search page directly, that make tour faster and that
don't remove any usefull test, since the purpose of this test is to test
coupon and not the search view already tested by others tests.
This commit is contained in:
Jeremy Kersten
2018-08-14 14:02:48 +02:00
parent f7ffbcd1c8
commit 863b86ea9f
+1 -24
View File
@@ -7,32 +7,13 @@ var base = require("web_editor.base");
tour.register('shop_sale_coupon', {
test: true,
url: '/shop',
url: '/shop?search=Large%20Cabinet',
wait_for: base.ready()
},
[
/* 0. Test 'Show # found' customize option works correctly */
{
content: "open customize menu",
trigger: '#customize-menu > a',
},
{
content: "click on 'Show # found'",
trigger: "#customize-menu a:contains(Show # found)",
},
/* 1. Buy 1 Large Cabinet, enable coupon code & insert 10% code */
{
content: "type Large Cabinet in search",
trigger: 'form input[name="search"]',
run: "text Large Cabinet",
},
{
content: "start search",
trigger: 'form:has(input[name="search"]) .oe_search_button',
},
{
content: "select Large Cabinet",
extra_trigger: '.oe_search_found', // Wait to be on search results or it sometimes throws concurent error (sent search form + click on product on /shop)
trigger: '.oe_product_cart a:contains("Large Cabinet")',
},
{
@@ -123,10 +104,6 @@ tour.register('shop_sale_coupon', {
extra_trigger: '.oe_website_sale #products_grid',
trigger: '#customize-menu > a',
},
{
content: "click on 'Show # found'",
trigger: "#customize-menu a:contains(Show # found)",
},
]
);