[FIX] test_event_full: add missing steps

The test was running by luck because the event and all talk pages
contains the needed elements. The favorite was checked randomly on
other pages because those steps are way faster than loading the page.

This test will fail in rare case if the page loads faster and the step
checking if the "favorite is on" occurs when the talk page is finaly
loaded.

This commit adds some step to try to ensure the page are loaded before
doing anything else.

Also enable ticks on freezetime so that we have an idea of the steps
durations in logs for easier investigation.

X-original-commit: 8405104b14624f27df4d95e21738b253d048063f
Part-of: odoo/odoo#101050
This commit is contained in:
Xavier-Do
2022-09-24 10:53:11 +02:00
parent 960a4faa4c
commit e690d812a4
2 changed files with 15 additions and 1 deletions
@@ -22,6 +22,12 @@ var discoverTalkSteps = function (talkName, fromList, reminderOn, toggleReminder
run: 'click',
}];
}
steps = steps.concat([{
content: `Check we are on the "${talkName}" talk page`,
trigger: 'div.o_wesession_track_main',
run: function () {}, // it's a check
}]);
if (reminderOn) {
steps = steps.concat([{
content: "Check Favorite is on",
@@ -132,11 +138,19 @@ var initTourSteps = function (eventName) {
var browseTalksSteps = [{
content: 'Browse Talks',
trigger: 'a:contains("Talks")',
}, {
content: 'Check we are on the talk list page',
trigger: 'h1:contains("Book your talks")',
run: function () {} // check
}];
var browseMeetSteps = [{
content: 'Browse Meet',
trigger: 'a:contains("Community")',
}, {
content: 'Check we are on the community page',
trigger: 'span:contains("Join a room")',
run: function () {} // check
}];
@@ -11,7 +11,7 @@ from odoo.addons.test_event_full.tests.common import TestWEventCommon
class TestWEventRegister(TestWEventCommon):
def test_register(self):
with freeze_time(self.reference_now):
with freeze_time(self.reference_now, tick=True):
self.browser_js(
'/event',
'odoo.__DEBUG__.services["web_tour.tour"].run("wevent_register")',