diff --git a/addons/website_slides/data/slide_channel_demo.xml b/addons/website_slides/data/slide_channel_demo.xml index c8f85fe0bea..64fc0c979ab 100644 --- a/addons/website_slides/data/slide_channel_demo.xml +++ b/addons/website_slides/data/slide_channel_demo.xml @@ -1,6 +1,7 @@ + Basics of Gardening @@ -37,6 +38,7 @@ + Trees, Wood and Gardens @@ -65,7 +67,7 @@ latest most_voted If you are looking for technical specifications, have a look at this documentation. + Basics of Furniture Creation @@ -110,7 +113,8 @@ will learn the basics of wood characteristics. - + + DIY Furniture diff --git a/addons/website_slides/data/slide_slide_demo.xml b/addons/website_slides/data/slide_slide_demo.xml index 7944263aca7..233d6b7ddfb 100644 --- a/addons/website_slides/data/slide_slide_demo.xml +++ b/addons/website_slides/data/slide_slide_demo.xml @@ -43,26 +43,12 @@ You won't believe those facts about carrots. - - Mighty Carrots - 3 - - infographic - - - - 2 - 2 - - You won't believe those facts about carrots. - - How to Grow and Harvest The Best Strawberries | Gardening Tips and Tricks + How to Grow and Harvest The Best Strawberries | Basics 4 - https://www.youtube.com/watch?v=l0JZ25VvbwE + - l0JZ25VvbwE - video + document @@ -305,6 +291,21 @@ A summary of know-how: how and what. + + How to Grow and Harvest The Best Strawberries | Gardening Tips and Tricks + 7 + https://www.youtube.com/watch?v=l0JZ25VvbwE + + l0JZ25VvbwE + video + + + + 0 + 1 + + Here is How to get the Sweetest Strawberries you ever tasted! + @@ -477,10 +478,39 @@ - Introduction + Working with Wood - 0 + 1 + + + + + Comparing Hardness of Wood Species + 2 + + infographic + + + + 10 + 12 + + Comparing Hardness of Wood Species + + + Wood Bending With Steam Box + 3 + + https://www.youtube.com/watch?v=PYr1rK8pS30 + PYr1rK8pS30 + video + + + + 10 + 3 + Watching the master(s) at work diff --git a/addons/website_slides/static/src/img/slide_demo_thumb_PYr1rK8pS30.jpg b/addons/website_slides/static/src/img/slide_demo_thumb_PYr1rK8pS30.jpg new file mode 100644 index 00000000000..84370ee350b Binary files /dev/null and b/addons/website_slides/static/src/img/slide_demo_thumb_PYr1rK8pS30.jpg differ diff --git a/addons/website_slides/static/src/img/slide_demo_wood_infographic_1.jpg b/addons/website_slides/static/src/img/slide_demo_wood_infographic_1.jpg new file mode 100644 index 00000000000..71985e2eb32 Binary files /dev/null and b/addons/website_slides/static/src/img/slide_demo_wood_infographic_1.jpg differ diff --git a/addons/website_slides/tests/test_ui_wslides.py b/addons/website_slides/tests/test_ui_wslides.py index be2293a1074..7d7b93bcb78 100644 --- a/addons/website_slides/tests/test_ui_wslides.py +++ b/addons/website_slides/tests/test_ui_wslides.py @@ -50,6 +50,25 @@ class TestUi(tests.HttpCase): 'odoo.__DEBUG__.services["web_tour.tour"].tours.course_member.ready', login=user_portal.login) + +@tests.common.tagged('external', '-standard') +class TestUiYoutube(tests.HttpCase): + + def test_course_member_yt_employee(self): + # remove membership because we need to be able to join the course during the tour + user_demo = self.env.ref('base.user_demo') + user_demo.flush() + user_demo.write({ + 'groups_id': [(5, 0), (4, self.env.ref('base.group_user').id)] + }) + self.env.ref('website_slides.slide_channel_demo_0_gard_0')._remove_membership(self.env.ref('base.partner_demo')) + + self.phantom_js( + '/slides', + 'odoo.__DEBUG__.services["web_tour.tour"].run("course_member_youtube")', + 'odoo.__DEBUG__.services["web_tour.tour"].tours.course_member_youtube.ready', + login=user_demo.login) + def test_course_publisher_website_designer(self): # remove membership because we need to be able to join the course during the tour # group_website_designer diff --git a/addons/website_slides/tests/tours/slides_course_member.js b/addons/website_slides/tests/tours/slides_course_member.js index 778ace3dbff..3f2a6325681 100644 --- a/addons/website_slides/tests/tours/slides_course_member.js +++ b/addons/website_slides/tests/tours/slides_course_member.js @@ -2,23 +2,6 @@ odoo.define('website_slides.tour.slide.course.member', 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=600'; - this.set('slide', slide); - - return this._super.call(this, arguments); - } -}); /** * Global use case: @@ -105,12 +88,9 @@ tour.register('course_member', { extra_trigger: '.o_wslides_progress_percentage:contains("60")', run: function () {} // check that previous step succeeded }, { - trigger: '.o_wslides_fs_sidebar_list_item div:contains("How to Grow and Harvest The Best Strawberries | Gardening Tips and Tricks")' + trigger: '.o_wslides_fs_sidebar_list_item div:contains("How to Grow and Harvest The Best Strawberries | Basics")' }, { - trigger: '.player', - run: function () {} // check player loading -}, { - trigger: '.o_wslides_fs_sidebar_section_slides li:contains("How to Grow and Harvest The Best Strawberries | Gardening Tips and Tricks") .o_wslides_slide_completed', + trigger: '.o_wslides_fs_sidebar_section_slides li:contains("How to Grow and Harvest The Best Strawberries | Basics") .o_wslides_slide_completed', run: function () {} // check that video slide is marked as 'done' }, { trigger: '.o_wslides_progress_percentage:contains("80")', diff --git a/addons/website_slides/tests/tours/slides_course_member_yt.js b/addons/website_slides/tests/tours/slides_course_member_yt.js new file mode 100644 index 00000000000..b060384d10a --- /dev/null +++ b/addons/website_slides/tests/tours/slides_course_member_yt.js @@ -0,0 +1,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")' +} +]); + +}); diff --git a/addons/website_slides/tests/tours/slides_tour_tools.js b/addons/website_slides/tests/tours/slides_tour_tools.js index 3485377fdfb..2290cd4e982 100644 --- a/addons/website_slides/tests/tours/slides_tour_tools.js +++ b/addons/website_slides/tests/tours/slides_tour_tools.js @@ -1,6 +1,10 @@ odoo.define('website_slides.tour.tools', function (require) { 'use strict'; +/* + * PUBLISHER / CONTENT CREATION + */ + var addSection = function (sectionName) { return [ { diff --git a/addons/website_slides/views/assets.xml b/addons/website_slides/views/assets.xml index b310391042a..2d214bfa17c 100644 --- a/addons/website_slides/views/assets.xml +++ b/addons/website_slides/views/assets.xml @@ -36,6 +36,7 @@