summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-01-17 07:02:01 +0000
committerXavier Morel <xmo@odoo.com>2020-01-21 06:56:15 +0000
commitd2c7efa9be66beb5d96fdffc3f849ddf136e20c9 (patch)
tree8a0f8f228b2dbab8d5dc44e2b235b44e0975a980
parent9733f6e1ab31abf780a5ad671f700fac883b63ee (diff)
[FIX] website, test_website: problematic tours
Fix various tours which either have transient failures due to logging the entire browser lifecycle or don't deal well with the last step being suppressed if no explicit `run` is provided. * test_website: add a warning final step for the page reset as there's no way to actually run a tour step in the recovery page (because it's asset-less) * website: remove final step's action in reset password tour, it's relatively low-value and adding a proper followup is probably not worth the effort * website: add final check step in dashboard tour, as we want to check that the dashboard gets loaded, but we don't want that to be dangling
-rw-r--r--addons/test_website/static/tests/tours/reset_views.js17
-rw-r--r--addons/website/static/tests/tours/dashboard_tour.js9
-rw-r--r--addons/website/static/tests/tours/reset_password.js17
3 files changed, 19 insertions, 24 deletions
diff --git a/addons/test_website/static/tests/tours/reset_views.js b/addons/test_website/static/tests/tours/reset_views.js
index bc323eaec2f..0c7aa9517ad 100644
--- a/addons/test_website/static/tests/tours/reset_views.js
+++ b/addons/test_website/static/tests/tours/reset_views.js
@@ -3,6 +3,15 @@ odoo.define('test_website.reset_views', function (require) {
var tour = require("web_tour.tour");
+var BROKEN_STEP = {
+ // because saving a broken template opens a recovery page with no assets
+ // there's no way for the tour to resume on the new page, and thus no way
+ // to properly wait for the page to be saved & reloaded in order to fix the
+ // race condition of a tour ending on a side-effect (with the possible
+ // exception of somehow telling the harness / browser to do it)
+ trigger: 'body',
+ run: function () {}
+};
tour.register('test_reset_page_view_complete_flow_part1', {
test: true,
url: '/test_page_view',
@@ -45,9 +54,8 @@ tour.register('test_reset_page_view_complete_flow_part1', {
content: "save the html editor",
extra_trigger: '.ace_content:contains("not.exist")',
trigger: ".o_ace_view_editor button[data-action=save]",
- }
-
- // 3. Reset the broken view
+ },
+ BROKEN_STEP
]
);
@@ -93,7 +101,8 @@ tour.register('test_reset_page_view_complete_flow_part2', {
{
content: "save the html editor",
trigger: ".o_ace_view_editor button[data-action=save]",
- }
+ },
+ BROKEN_STEP
]
);
diff --git a/addons/website/static/tests/tours/dashboard_tour.js b/addons/website/static/tests/tours/dashboard_tour.js
index a8566d63a97..b02747c6caa 100644
--- a/addons/website/static/tests/tours/dashboard_tour.js
+++ b/addons/website/static/tests/tours/dashboard_tour.js
@@ -9,13 +9,14 @@ tour.register("backend_dashboard", {
}, [tour.STEPS.SHOW_APPS_MENU_ITEM,
{
trigger: 'a[data-menu-xmlid="website.menu_website_configuration"]',
- run: 'click',
}, {
trigger: '.dropdown-toggle[data-menu-xmlid="website.menu_dashboard"]',
- run: 'click',
}, {
trigger: '.dropdown-item[data-menu-xmlid="website.menu_website_google_analytics"]',
- content: 'Check if traceback',
- run: 'click',
+}, {
+ // Visits section should always be present even when empty / not hooked to anything
+ trigger: 'h2:contains("Visits")',
+ content: "Check if dashboard loads",
+ run: function () {}
}]);
});
diff --git a/addons/website/static/tests/tours/reset_password.js b/addons/website/static/tests/tours/reset_password.js
index 98ce641373f..2e3d00740d9 100644
--- a/addons/website/static/tests/tours/reset_password.js
+++ b/addons/website/static/tests/tours/reset_password.js
@@ -151,22 +151,7 @@ tour.register('website_reset_password', {
},
{
content: "check logged in, and reset admin website",
- trigger: '.oe_topbar_name:contains("Admin")',
- run: function () {
- return rpc.query({
- model: 'res.partner',
- method: 'name_search',
- kwargs: {'name': 'Admin'},
- }).then(function (res) {
- return rpc.query({
- 'model': 'res.partner',
- 'method': 'write',
- 'args': [[res[0][0]], {
- 'website_id': false,
- }],
- });
- });
- },
+ trigger: '.oe_topbar_name:contains("Admin")'
},
]);
});