summaryrefslogtreecommitdiff
path: root/addons/website_slides/static/src/tests/tours/slides_course_member_yt.js
blob: b060384d10a5d0e56d4880c44b4a6c6d45161980 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
odoo.define('website_slides.tour.slide.course.member.youtube', function (require) {
'use strict';

var tour = require('web_tour.tour');
var FullScreen = require('website_slides.fullscreen');

/**
 * Alter this method for test purposes.
 * This will make the video start at 10 minutes.
 * As it lasts 10min24s, it will mark it as completed immediately.
 */
FullScreen.include({
    _renderSlide: function () {

        var slide = this.get('slide');
        slide.embedUrl += '&start=260';
        this.set('slide', slide);

        return this._super.call(this, arguments);
    }
});

/**
 * Global use case:
 * an user (either employee, website publisher or portal) joins a public
    course;
 * he has access to the full course content when he's a member of the
    course;
 * he uses fullscreen player to complete the course;
 * he rates the course;
 */
tour.register('course_member_youtube', {
    url: '/slides',
    test: true
}, [
// eLearning: go on /all, find free course and join it
{
    trigger: 'a.o_wslides_home_all_slides'
}, {
    trigger: 'a:contains("Choose your wood")'
}, {
    trigger: 'a:contains("Join Course")'
}, {
    trigger: '.o_wslides_js_course_join:contains("You\'re enrolled")',
    run: function () {} // check membership
}, {
    trigger: 'a:contains("Comparing Hardness of Wood Species")',
},  {
    trigger: '.o_wslides_progress_percentage:contains("50")',
    run: function () {} // check progression
}, {
    trigger: 'a:contains("Wood Bending With Steam Box")',
}, {
    trigger: '.player',
    run: function () {} // check player loading
}, {
    trigger: '.o_wslides_fs_sidebar_section_slides li:contains("Wood Bending With Steam Box") .o_wslides_slide_completed',
    run: function () {} // check that video slide is marked as 'done'
}, {
    trigger: '.o_wslides_progress_percentage:contains("100")',
    run: function () {} // check progression
}, {
    trigger: 'a:contains("Back to course")'
}
]);

});