summaryrefslogtreecommitdiff
path: root/addons/survey/static/src
diff options
context:
space:
mode:
authorAurélien Warnon <awa@odoo.com>2020-03-25 09:35:38 +0000
committerAurélien Warnon <awa@odoo.com>2020-03-31 15:16:02 +0000
commit6405ffd483794db6cf576feb9ad77d0bc78e8f04 (patch)
tree726514e8136c436a37a16efc346aebad7355353c /addons/survey/static/src
parentafd78f12ae99f61323467dc67813cfdb257272b7 (diff)
[IMP] survey: add python tests/tours to test the survey sessions
PURPOSE This commit adds a big flow test/tours to the survey sessions, for the host point of view. This will avoid breaking the feature with future changes, as it contains some tricky and complex mechanics (especially the screens chaining). SPECS The tour tests the whole host point of view. Break down of the testing/tour main points: - Create the survey session - Check our attendees are accounted for - Open the 'session manager' - Display the nickname question, and move to the next one (as answers are not displayed for nickname questions) - Check answers are correctly displayed for the 3 'simple' question types (text, date, datetime) - Move to the choice question and check that answers are displayed - If everything is correctly displayed, move to the next question - On the scored choice question, check that the screens are correctly chained: no results displayed -> results displayed -> correct/incorrect answers -> leaderboard - On the scored + timed multiple choice question, check the same than previous question, except that the results are supposed to be displayed automatically when the question timer runs out - Test the 'back' behavior and check that screens are reversed correctly - Check that our final leaderboard is correct based on attendees answers - Close the survey session LINKS PR #46768 Task 2208574
Diffstat (limited to 'addons/survey/static/src')
-rw-r--r--addons/survey/static/src/js/survey_session_manage.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/survey/static/src/js/survey_session_manage.js b/addons/survey/static/src/js/survey_session_manage.js
index 1a83175e79e..897aab6d7b3 100644
--- a/addons/survey/static/src/js/survey_session_manage.js
+++ b/addons/survey/static/src/js/survey_session_manage.js
@@ -376,7 +376,7 @@ publicWidget.registry.SurveySessionManage = publicWidget.Widget.extend({
_refreshResults: function () {
var self = this;
- this._rpc({
+ return this._rpc({
route: _.str.sprintf('/survey/session/results/%s', self.surveyAccessToken)
}).then(function (questionResults) {
if (questionResults) {
@@ -398,6 +398,8 @@ publicWidget.registry.SurveySessionManage = publicWidget.Widget.extend({
);
}
}
+
+ return Promise.resolve();
}, function () {
// on failure, stop refreshing
clearInterval(self.resultsRefreshInterval);
@@ -412,7 +414,7 @@ publicWidget.registry.SurveySessionManage = publicWidget.Widget.extend({
_refreshAttendeesCount: function () {
var self = this;
- self._rpc({
+ return self._rpc({
model: 'survey.survey',
method: 'read',
args: [[self.surveyId], ['session_answer_count']],