[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
This commit is contained in:
Xavier Morel
2020-01-21 06:56:15 +00:00
parent 9733f6e1ab
commit d2c7efa9be
3 changed files with 19 additions and 24 deletions
@@ -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
]
);
@@ -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 () {}
}]);
});
@@ -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")'
},
]);
});