Debian Codegraph @

addons/website_slides/static/tests/tours/slides_course_member_yt.js

raw symbols SCIP
1 import { registry } from "@web/core/registry";
2
3 function patchFullScreen() {
4 /**
5 * Alter this method for test purposes.
6 * This will make the video start at 10 minutes.
7 * As it lasts 10min24s, it will mark it as completed immediately.
8 */
9 const FullScreen = odoo.loader.modules.get('@website_slides/js/slides_course_fullscreen_player')[Symbol.for("default")];
10 FullScreen.include({
11 _renderSlide: function () {
12
13 const slide = this._slideValue;
14 slide.embedUrl += '&start=260';
15 this._updateSlideValue(slide);
16
17 return this._super.call(this, arguments);
18 }
19 });
20 }
21
22
23 /**
24 * Global use case:
25 * an user (either employee, website restricted editor or portal) joins a public
26 course;
27 * they have access to the full course content when they are a member of the
28 course;
29 * they use fullscreen player to complete the course;
30 * they rate the course;
31 */
32 registry.category("web_tour.tours").add('course_member_youtube', {
33 url: '/slides',
34 steps: () => [
35 {
36 content: "Patching FullScreen",
37 trigger: 'body',
38 run: function() {
39 patchFullScreen()
40 }
41 },
42 // eLearning: go on /all, find free course and join it
43 {
44 trigger: 'a.o_wslides_home_all_slides',
45 run: "click",
46 }, {
47 trigger: 'a:contains("Choose your wood")',
48 run: "click",
49 }, {
50 trigger: 'a:contains("Join this Course")',
51 run: "click",
52 }, {
53 // check membership
54 trigger: '.o_wslides_js_course_join:contains("You\'re enrolled")',
55 }, {
56 trigger: 'a:contains("Comparing Hardness of Wood Species")',
57 run: "click",
58 }, {
59 // check progression
60 trigger: '.o_wslides_progress_percentage:contains("50")',
61 }, {
62 trigger: '.o_wslides_fs_slide_name:contains("Wood Bending With Steam Box")',
63 run: "click",
64 }, {
65 // check player loading
66 trigger: '.player',
67 }, {
68 // check that video slide is marked as 'done'
69 trigger: '.o_wslides_fs_sidebar_section_slides li:contains("Wood Bending With Steam Box") .o_wslides_slide_completed',
70 }, {
71 // check progression
72 trigger: '.o_wslides_channel_completion_completed:contains(Completed)',
73 }, {
74 trigger: 'a:contains("Back to course")',
75 run: "click",
76 }
77 ]});