summaryrefslogtreecommitdiff
path: root/addons/survey/static/tests/tours/survey_tour_session_start.js
blob: 309ce0afaebffccb8f708e4301ff1c693b9915ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
odoo.define('survey.test_survey_session_start_tour', function (require) {
"use strict";

var tour = require('web_tour.tour');
var surveySessionTools = require('survey.session_tour_tools');

/**
 * Small tour that will open the session manager and check
 * that the attendees are accounted for, then start the session
 * by going to the first question.
 */
tour.register('test_survey_session_start_tour', {
    url: "/web",
    test: true,
}, [].concat(surveySessionTools.accessSurveySteps, [{
    trigger: 'button[name="action_open_session_manager"]',
}, {
    trigger: '.o_survey_session_attendees_count:contains("3")',
    run: function () {} // check attendees count
}, {
    trigger: 'h1',
    run: function () {
        var e = $.Event('keydown');
        e.keyCode = 39; // arrow-right
        $(document).trigger(e); // start session
    }
}, {
    trigger: 'h1:contains("Nickname")',
    run: function () {} // check first question is displayed
}]));

});