diff --git a/.gherkin-lintrc b/.gherkin-lintrc new file mode 100644 index 00000000000..9439956f027 --- /dev/null +++ b/.gherkin-lintrc @@ -0,0 +1,20 @@ +{ + "indentation": ["on",{ + "Feature": 0, + "Background": 2, + "Scenario": 2, + "Step": 4, + "given": 4, + "and": 4 + }], + "no-dupe-feature-names": "on", + "no-dupe-scenario-names": "off", + "no-empty-file": "on", + "no-files-without-scenarios": "on", + "no-multiple-empty-lines": "on", + "no-partially-commented-tag-lines": "on", + "no-trailing-spaces": "on", + "no-unamed-features": "on", + "no-unamed-scenarios": "on", + "no-scenario-outlines-without-examples": "on" +} diff --git a/Gruntfile.js b/Gruntfile.js index 5852cc46b74..4cb9e9ebbd9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -106,7 +106,6 @@ module.exports = function(grunt) { return libs; }; - // Project configuration. grunt.initConfig({ eslint: { @@ -171,6 +170,10 @@ module.exports = function(grunt) { files: ['**/yui/src/**/*.js'], tasks: ['yui'] }, + gherkinlint: { + files: ['**/tests/behat/*.feature'], + tasks: ['gherkinlint'] + } }, shifter: { options: { @@ -178,6 +181,11 @@ module.exports = function(grunt) { paths: [cwd] } }, + gherkinlint: { + options: { + files: ['**/tests/behat/*.feature'], + } + }, stylelint: { less: { options: { @@ -318,6 +326,22 @@ module.exports = function(grunt) { }, done); }; + tasks.gherkinlint = function() { + var done = this.async(), + options = grunt.config('gherkinlint.options'); + + var args = grunt.file.expand(options.files); + args.unshift(path.normalize(__dirname + '/node_modules/.bin/gherkin-lint')); + grunt.util.spawn({ + cmd: 'node', + args: args, + opts: {stdio: 'inherit', env: process.env} + }, function(error, result, code) { + // Propagate the exit code. + done(code); + }); + }; + tasks.startup = function() { // Are we in a YUI directory? if (path.basename(path.resolve(cwd, '../../')) == 'yui') { @@ -329,6 +353,7 @@ module.exports = function(grunt) { // Run them all!. grunt.task.run('css'); grunt.task.run('js'); + grunt.task.run('gherkinlint'); } }; @@ -343,6 +368,7 @@ module.exports = function(grunt) { grunt.config('uglify.amd.files', [{expand: true, src: files, rename: uglifyRename}]); grunt.config('shifter.options.paths', files); grunt.config('stylelint.less.src', files); + grunt.config('gherkinlint.options.files', files); changedFiles = Object.create(null); }, 200); @@ -360,6 +386,7 @@ module.exports = function(grunt) { // Register JS tasks. grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter); + grunt.registerTask('gherkinlint', 'Run gherkinlint against the current directory', tasks.gherkinlint); grunt.registerTask('ignorefiles', 'Generate ignore files for linters', tasks.ignorefiles); grunt.registerTask('yui', ['eslint:yui', 'shifter']); grunt.registerTask('amd', ['eslint:amd', 'uglify']); diff --git a/admin/tool/behat/tests/behat/get_and_set_fields.feature b/admin/tool/behat/tests/behat/get_and_set_fields.feature index f9ac3a15070..4b467bc1529 100644 --- a/admin/tool/behat/tests/behat/get_and_set_fields.feature +++ b/admin/tool/behat/tests/behat/get_and_set_fields.feature @@ -125,7 +125,6 @@ Feature: Verify that all form fields values can be get and set And I navigate to "Edit settings" node in "Course administration" And the field "Course ID number" matches value "Course id number" - Scenario: with JS disabled all form fields getters and setters works as expected @javascript diff --git a/admin/tool/behat/tests/behat/list_steps.feature b/admin/tool/behat/tests/behat/list_steps.feature index 3e4d31e2434..708a0e71cee 100644 --- a/admin/tool/behat/tests/behat/list_steps.feature +++ b/admin/tool/behat/tests/behat/list_steps.feature @@ -26,4 +26,3 @@ Feature: List the system steps definitions Given I set the field "Contains" to "homepage" When I press "Filter" Then I should see "Opens Moodle homepage." - diff --git a/admin/tool/langimport/tests/behat/manage_langpacks.feature b/admin/tool/langimport/tests/behat/manage_langpacks.feature index 6d6f0f0e394..e1b91707f08 100644 --- a/admin/tool/langimport/tests/behat/manage_langpacks.feature +++ b/admin/tool/langimport/tests/behat/manage_langpacks.feature @@ -4,7 +4,6 @@ Feature: Manage language packs As an administrator I need to be able to add, update and remove language packs - Background: Given remote langimport tests are enabled diff --git a/admin/tool/lp/tests/behat/framework_crud.feature b/admin/tool/lp/tests/behat/framework_crud.feature index bccf5f76722..998a950fc02 100644 --- a/admin/tool/lp/tests/behat/framework_crud.feature +++ b/admin/tool/lp/tests/behat/framework_crud.feature @@ -68,7 +68,7 @@ Feature: Manage competency frameworks Then I should not see "Science Year-4" And I should not see "sc-y-4" -Scenario: Edit a framework with competencies in user competency + Scenario: Edit a framework with competencies in user competency Given the following lp "frameworks" exist: | shortname | idnumber | | Science Year-5 | sc-y-5 | @@ -98,7 +98,7 @@ Scenario: Edit a framework with competencies in user competency And I should see "Science Year-5 Edited" And I should see "sc-y-5" -Scenario: Edit a framework with competencies in user competency plan + Scenario: Edit a framework with competencies in user competency plan Given the following lp "frameworks" exist: | shortname | idnumber | | Science Year-6 | sc-y-6 | diff --git a/admin/tool/lp/tests/behat/plan_workflow.feature b/admin/tool/lp/tests/behat/plan_workflow.feature index bfaf1e0307a..c98314e0566 100644 --- a/admin/tool/lp/tests/behat/plan_workflow.feature +++ b/admin/tool/lp/tests/behat/plan_workflow.feature @@ -179,7 +179,7 @@ Feature: Manage plan workflow And I should not see "Active" And I log out -Scenario: Manager reopen a complete learning plan + Scenario: Manager reopen a complete learning plan Given the following lp "plans" exist: | name | user | description | status | reviewer | | Test-Plan3 | user1 | Description of plan 3 for user 1 | complete | manager1 | diff --git a/admin/tool/lp/tests/behat/user_evidence_crud.feature b/admin/tool/lp/tests/behat/user_evidence_crud.feature index 6a46e199afa..35dbd2bfae6 100644 --- a/admin/tool/lp/tests/behat/user_evidence_crud.feature +++ b/admin/tool/lp/tests/behat/user_evidence_crud.feature @@ -78,4 +78,3 @@ Feature: Manage evidence of prior learning Then I should see "List of evidence" And I should see "Evidence-6" And I should not see "Evidence-5" - diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature index 92cc5ad6b8e..e2f504e2cee 100644 --- a/badges/tests/behat/award_badge.feature +++ b/badges/tests/behat/award_badge.feature @@ -357,4 +357,3 @@ Feature: Award badges When I press "Revoke badge" And I follow "Course Badge" Then I should see "Recipients (0)" - diff --git a/blocks/activity_results/tests/behat/addblockinactivity.feature b/blocks/activity_results/tests/behat/addblockinactivity.feature index 7af21b1a1c1..de4a14926fd 100644 --- a/blocks/activity_results/tests/behat/addblockinactivity.feature +++ b/blocks/activity_results/tests/behat/addblockinactivity.feature @@ -60,7 +60,7 @@ Feature: The activity results block displays student scores And I press "Save changes" And I follow "Course 1" -Scenario: Configure the block on a non-graded activity to show 3 high scores + Scenario: Configure the block on a non-graded activity to show 3 high scores Given I follow "Test page name" And I add the "Activity results" block When I configure the "Activity results" block @@ -78,7 +78,7 @@ Scenario: Configure the block on a non-graded activity to show 3 high scores And I should see "Student 3" in the "Activity results" "block" And I should see "70.00" in the "Activity results" "block" -Scenario: Block should select current activity by default + Scenario: Block should select current activity by default Given I follow "Test assignment 1" When I add the "Activity results" block And I configure the "Activity results" block diff --git a/blocks/activity_results/tests/behat/addunconfiguredblock.feature b/blocks/activity_results/tests/behat/addunconfiguredblock.feature index def045bc50b..f53d8eae84e 100644 --- a/blocks/activity_results/tests/behat/addunconfiguredblock.feature +++ b/blocks/activity_results/tests/behat/addunconfiguredblock.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores +Feature: The activity results block doesn't displays student scores for unconfigured block In order to be display student scores As a user I need to see the activity results block diff --git a/blocks/activity_results/tests/behat/addunsupportedactivity.feature b/blocks/activity_results/tests/behat/addunsupportedactivity.feature index 3aa10b9f65d..d3f5c991ef8 100644 --- a/blocks/activity_results/tests/behat/addunsupportedactivity.feature +++ b/blocks/activity_results/tests/behat/addunsupportedactivity.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores +Feature: The activity results block doesn't display student scores for unsupported activity In order to be display student scores As a user I need to properly configure the activity results block diff --git a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature index 4a2a8bc5826..620aac1cead 100644 --- a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores +Feature: The activity results block displays student high scores In order to be display student scores As a user I need to see the activity results block diff --git a/blocks/activity_results/tests/behat/highscoreswithscales.feature b/blocks/activity_results/tests/behat/highscoreswithscales.feature index 86dee32ce06..d121c97b9da 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscales.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores as scales +Feature: The activity results block displays students high scores in group as scales In order to be display student scores as scales As a user I need to see the activity results block diff --git a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature index 536a00ecec7..6b9c9727594 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores as scales +Feature: The activity results block displays student in group high scores as scales In order to be display student scores as scales As a user I need to see the activity results block diff --git a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature index c764e806222..0c1ccdd077d 100644 --- a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores +Feature: The activity results block displays student in separate groups scores In order to be display student scores As a user I need to see the activity results block diff --git a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature index bf10d7943b0..0e64d0544fe 100644 --- a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores +Feature: The activity results block displays student in visible groups scores In order to be display student scores As a user I need to see the activity results block diff --git a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature index a1496c6e29e..e2c8729b985 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores +Feature: The activity results block displays student low scores In order to be display student scores As a user I need to see the activity results block diff --git a/blocks/activity_results/tests/behat/lowscoreswithscales.feature b/blocks/activity_results/tests/behat/lowscoreswithscales.feature index 587f863a53d..5068a7b3642 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscales.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores as scales +Feature: The activity results block displays student low scores as scales In order to be display student scores as scales As a user I need to see the activity results block diff --git a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature index f43348e814a..30602ff0746 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores as scales +Feature: The activity results block displays students in groups low scores as scales In order to be display student scores as scales As a user I need to see the activity results block @@ -146,4 +146,3 @@ Feature: The activity results block displays student scores as scales And I should see "User" in the "Activity results" "block" And I should see "Good" in the "Activity results" "block" And I should see "Average" in the "Activity results" "block" - diff --git a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature index 640517edb93..5d73692b9da 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores +Feature: The activity results block displays students in separate groups scores In order to be display student scores As a user I need to see the activity results block diff --git a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature index 2010dcddcf9..e137f929104 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature @@ -1,5 +1,5 @@ @block @block_activity_results -Feature: The activity results block displays student scores +Feature: The activity results block displays student in visible groups low scores In order to be display student scores As a user I need to see the activity results block diff --git a/blocks/blog_menu/tests/behat/block_blog_menu_course.feature b/blocks/blog_menu/tests/behat/block_blog_menu_course.feature index f45f62f9b3e..76ceb37c78c 100644 --- a/blocks/blog_menu/tests/behat/block_blog_menu_course.feature +++ b/blocks/blog_menu/tests/behat/block_blog_menu_course.feature @@ -1,8 +1,8 @@ @block @block_blog_menu -Feature: Enable Block blog menu in a course - In order to enable the blog menu in a course - As a teacher - I can add blog menu block to a course +Feature: Students can use block blog menu in a course + In order students to use the blog menu in a course + As a student + I view blog menu block in a course Background: Given the following "users" exist: diff --git a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature index ea2bcd1f94d..ceb1898850e 100644 --- a/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature +++ b/blocks/calendar_upcoming/tests/behat/block_calendar_upcoming_dashboard.feature @@ -1,5 +1,5 @@ @block @block_calendar_upcoming -Feature: View a site event on the dashboard +Feature: View a upcoming site event on the dashboard In order to view a site event As a student I can view the event in the upcoming events block diff --git a/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature b/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature index 532950d6b14..7d4c3f6c0f0 100644 --- a/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature +++ b/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature @@ -52,7 +52,6 @@ Feature: Enable Block Completion in a course using manual completion by others And I follow "More details" And I should see "Yes" in the "Marked complete by Teacher" "table_row" - Scenario: Add the block to a the course and require multiple roles to mark a student complete. Given I log in as "teacher1" And I follow "Course 1" diff --git a/blocks/course_overview/tests/behat/quiz_overview.feature b/blocks/course_overview/tests/behat/quiz_overview.feature index 238591fdf35..c91c551fcf1 100644 --- a/blocks/course_overview/tests/behat/quiz_overview.feature +++ b/blocks/course_overview/tests/behat/quiz_overview.feature @@ -91,4 +91,3 @@ Feature: View the quiz being due And I should not see "Quiz 1B Past deadline" in the "Course overview" "block" And I should not see "Quiz 1D Future deadline" in the "Course overview" "block" And I should not see "Quiz 2A Future deadline" in the "Course overview" "block" - diff --git a/blocks/glossary_random/tests/behat/glossary_random_frontpage.feature b/blocks/glossary_random/tests/behat/glossary_random_frontpage.feature index fc6f19caa9d..db31b919ea9 100644 --- a/blocks/glossary_random/tests/behat/glossary_random_frontpage.feature +++ b/blocks/glossary_random/tests/behat/glossary_random_frontpage.feature @@ -4,24 +4,24 @@ Feature: Random glossary entry block can be added to the frontpage As a teacher I can add the random glossary entry to the frontpage -Scenario: Admin can add random glossary block to the frontpage - Given the following "activities" exist: - | activity | name | intro | course | idnumber | - | glossary | Tips and Tricks | Frontpage glossary description | Acceptance test site | glossary0 | - And I log in as "admin" - And I am on site homepage - And I turn editing mode on - And I add the "Random glossary entry" block - And I configure the "block_glossary_random" block - And I set the following fields to these values: - | Title | Tip of the day | - | Take entries from this glossary | Tips and Tricks | - And I press "Save changes" - And I click on "Add a new entry" "link" in the "Tip of the day" "block" - And I set the following fields to these values: - | Concept | Never come late | - | Definition | Come in time for your classes | - And I press "Save changes" - When I log out - Then I should see "Never come late" in the "Tip of the day" "block" - And I should see "Come in time for your classes" in the "Tip of the day" "block" + Scenario: Admin can add random glossary block to the frontpage + Given the following "activities" exist: + | activity | name | intro | course | idnumber | + | glossary | Tips and Tricks | Frontpage glossary description | Acceptance test site | glossary0 | + And I log in as "admin" + And I am on site homepage + And I turn editing mode on + And I add the "Random glossary entry" block + And I configure the "block_glossary_random" block + And I set the following fields to these values: + | Title | Tip of the day | + | Take entries from this glossary | Tips and Tricks | + And I press "Save changes" + And I click on "Add a new entry" "link" in the "Tip of the day" "block" + And I set the following fields to these values: + | Concept | Never come late | + | Definition | Come in time for your classes | + And I press "Save changes" + When I log out + Then I should see "Never come late" in the "Tip of the day" "block" + And I should see "Come in time for your classes" in the "Tip of the day" "block" diff --git a/blocks/html/tests/behat/multiple_instances.feature b/blocks/html/tests/behat/multiple_instances.feature index 93b58de8fd9..a6cad0b34ca 100644 --- a/blocks/html/tests/behat/multiple_instances.feature +++ b/blocks/html/tests/behat/multiple_instances.feature @@ -1,5 +1,5 @@ @block @block_html -Feature: Adding and configuring HTML blocks +Feature: Adding and configuring multiple HTML blocks In order to have one or multiple HTML blocks on a page As admin I need to be able to create, configure and change HTML blocks diff --git a/blocks/online_users/tests/behat/block_online_users_dashboard.feature b/blocks/online_users/tests/behat/block_online_users_dashboard.feature index ecde2a0ad4b..7f88d76bf6a 100644 --- a/blocks/online_users/tests/behat/block_online_users_dashboard.feature +++ b/blocks/online_users/tests/behat/block_online_users_dashboard.feature @@ -1,5 +1,5 @@ @block @block_online_users -Feature: The online users block allow you to see who is currently online +Feature: The online users block allow you to see who is currently online on dashboard In order to use the online users block on the dashboard As a user I can view the online users block on my dashboard diff --git a/blocks/online_users/tests/behat/block_online_users_frontpage.feature b/blocks/online_users/tests/behat/block_online_users_frontpage.feature index 3e4b56d6c24..5909b1c0478 100644 --- a/blocks/online_users/tests/behat/block_online_users_frontpage.feature +++ b/blocks/online_users/tests/behat/block_online_users_frontpage.feature @@ -1,5 +1,5 @@ @block @block_online_users -Feature: The online users block allow you to see who is currently online +Feature: The online users block allow you to see who is currently online on frontpage In order to enable the online users block on the front page page As an admin I can add the online users block to the front page page diff --git a/blocks/private_files/tests/behat/block_private_files_activity.feature b/blocks/private_files/tests/behat/block_private_files_activity.feature index aaf59ff18f2..d8578719882 100644 --- a/blocks/private_files/tests/behat/block_private_files_activity.feature +++ b/blocks/private_files/tests/behat/block_private_files_activity.feature @@ -1,5 +1,5 @@ @block @block_private_files @_file_upload @javascript -Feature: The private files block allows users to store files privately in moodle +Feature: The private files block allows users to store files privately in moodle on activity page In order to store a private file in moodle As a teacher I can upload the file to my private files area using the private files block in an activity diff --git a/blocks/private_files/tests/behat/block_private_files_course.feature b/blocks/private_files/tests/behat/block_private_files_course.feature index 43e7b8cf682..b56c15b522b 100644 --- a/blocks/private_files/tests/behat/block_private_files_course.feature +++ b/blocks/private_files/tests/behat/block_private_files_course.feature @@ -1,5 +1,5 @@ @block @block_private_files @_file_upload @javascript -Feature: The private files block allows users to store files privately in moodle +Feature: The private files block allows users to store files privately in moodle on course page In order to store a private file in moodle As a teacher I can upload the file to my private files area using the private files block in a course diff --git a/blocks/private_files/tests/behat/block_private_files_dashboard.feature b/blocks/private_files/tests/behat/block_private_files_dashboard.feature index 990cd9641b1..3b6eb5c2d40 100644 --- a/blocks/private_files/tests/behat/block_private_files_dashboard.feature +++ b/blocks/private_files/tests/behat/block_private_files_dashboard.feature @@ -1,5 +1,5 @@ @block @block_private_files @_file_upload @javascript -Feature: The private files block allows users to store files privately in moodle +Feature: The private files block allows users to store files privately in moodle on dashboard In order to store a private file in moodle As a user I can upload the file to my private files area using the private files block on the dashboard diff --git a/blocks/private_files/tests/behat/block_private_files_frontpage.feature b/blocks/private_files/tests/behat/block_private_files_frontpage.feature index ec611bbd8ce..7816060b0cb 100644 --- a/blocks/private_files/tests/behat/block_private_files_frontpage.feature +++ b/blocks/private_files/tests/behat/block_private_files_frontpage.feature @@ -1,5 +1,5 @@ @block @block_private_files @_file_upload -Feature: The private files block allows users to store files privately in moodle +Feature: The private files block allows users to store files privately in moodle on front page. In order to store a private file in moodle As a teacher I can upload the file to my private files area using the private files block from the front page diff --git a/blocks/search_forums/tests/behat/block_search_forums_course.feature b/blocks/search_forums/tests/behat/block_search_forums_course.feature index a52b9ad5690..dedc8bcd1b4 100644 --- a/blocks/search_forums/tests/behat/block_search_forums_course.feature +++ b/blocks/search_forums/tests/behat/block_search_forums_course.feature @@ -1,5 +1,5 @@ @block @block_search_forums @mod_forum -Feature: The search forums block allows users to search for forum posts +Feature: The search forums block allows users to search for forum posts on course page In order to search for a forum post As a user I can use the search forums block diff --git a/blocks/search_forums/tests/behat/block_search_forums_frontpage.feature b/blocks/search_forums/tests/behat/block_search_forums_frontpage.feature index 4d2aa52e6b6..1f76d15c458 100644 --- a/blocks/search_forums/tests/behat/block_search_forums_frontpage.feature +++ b/blocks/search_forums/tests/behat/block_search_forums_frontpage.feature @@ -1,5 +1,5 @@ @block @block_search_forums @mod_forum -Feature: The search forums block allows users to search for forum posts +Feature: The search forums block allows users to search for forum posts on frontpage In order to search for a forum post As an administrator I can add the search forums block diff --git a/blocks/section_links/tests/behat/block_section_links_course.feature b/blocks/section_links/tests/behat/block_section_links_course.feature index 038a966d245..f43f6fd9287 100644 --- a/blocks/section_links/tests/behat/block_section_links_course.feature +++ b/blocks/section_links/tests/behat/block_section_links_course.feature @@ -27,7 +27,6 @@ Feature: The section links block allows users to quickly navigate around a moodl | id_coursedisplay | Show one section per page | And I press "Save and display" - Scenario: Add the section links block to a course. Given I add the "Section links" block And I turn editing mode off diff --git a/blog/tests/behat/delete.feature b/blog/tests/behat/delete.feature index d41e9decb0a..950577ba8a9 100644 --- a/blog/tests/behat/delete.feature +++ b/blog/tests/behat/delete.feature @@ -48,4 +48,3 @@ Feature: Delete a blog entry And I press "Cancel" And I should see "Blog post one" And I should see "Blog post two" - diff --git a/calendar/tests/behat/calendar.feature b/calendar/tests/behat/calendar.feature index d18eae3ef8a..c026cfe4360 100644 --- a/calendar/tests/behat/calendar.feature +++ b/calendar/tests/behat/calendar.feature @@ -111,4 +111,3 @@ Feature: Perform basic calendar functionality | Description | Wait, this event isn't that great. | And I press "Save changes" And I should see "Mediocre event" - diff --git a/cohort/tests/behat/access_visible_cohorts.feature b/cohort/tests/behat/access_visible_cohorts.feature index 899ec2c4f4d..e9131933857 100644 --- a/cohort/tests/behat/access_visible_cohorts.feature +++ b/cohort/tests/behat/access_visible_cohorts.feature @@ -125,4 +125,3 @@ Feature: Access visible and hidden cohorts And the "Select members from cohort" select box should not contain "Cohort in category 2" And the "Select members from cohort" select box should not contain "Cohort empty in category 1" And the "Select members from cohort" select box should not contain "System empty cohort" - diff --git a/course/format/social/tests/behat/social_adjust_discussion_count.feature b/course/format/social/tests/behat/social_adjust_discussion_count.feature index 2f474b2f6a1..4c83c5a320c 100644 --- a/course/format/social/tests/behat/social_adjust_discussion_count.feature +++ b/course/format/social/tests/behat/social_adjust_discussion_count.feature @@ -4,7 +4,7 @@ Feature: Change number of discussions displayed As a teacher I need to edit the course and change the number of sections displayed. -Background: + Background: Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | @@ -96,28 +96,28 @@ Background: And I wait to be redirected And I follow "Course 1" -Scenario: When number of discussions is decreased fewer discussions appear + Scenario: When number of discussions is decreased fewer discussions appear Given I navigate to "Edit settings" in current page administration And I set the following fields to these values: - | numdiscussions | 5 | + | numdiscussions | 5 | When I press "Save and display" Then I should see "This is forum post one" And I should see "This is forum post five" And I should not see "This is forum post six" -Scenario: When number of discussions is decreased to less than 1 only 1 discussion should appear + Scenario: When number of discussions is decreased to less than 1 only 1 discussion should appear Given I navigate to "Edit settings" in current page administration And I set the following fields to these values: - | numdiscussions | -1 | + | numdiscussions | -1 | When I press "Save and display" Then I should see "This is forum post one" And I should not see "This is forum post two" And I should not see "This is forum post ten" -Scenario: When number of discussions is increased more discussions appear + Scenario: When number of discussions is increased more discussions appear Given I navigate to "Edit settings" in current page administration And I set the following fields to these values: - | numdiscussions | 9 | + | numdiscussions | 9 | When I press "Save and display" Then I should see "This is forum post one" And I should see "This is forum post five" diff --git a/course/tests/behat/category_change_visibility.feature b/course/tests/behat/category_change_visibility.feature index 1bb7129b396..042094cf609 100644 --- a/course/tests/behat/category_change_visibility.feature +++ b/course/tests/behat/category_change_visibility.feature @@ -255,64 +255,64 @@ Feature: We can change the visibility of categories in the management interface. And course in management listing should be dimmed "C2" And course in management listing should be visible "C3" - @javascript @_cross_browser - Scenario: Test courses are hidden when selected category parent is hidden. - Given the following "categories" exist: - | name | category | idnumber | - | Cat 1 | 0 | CAT1 | - | Cat 2 | CAT1 | CAT2 | - | Cat 3 | CAT2 | CAT3 | - And the following "courses" exist: - | category | fullname | shortname | idnumber | - | CAT3 | Course 1 | Course 1 | C1 | + @javascript @_cross_browser + Scenario: Test courses are hidden when selected category parent is hidden. + Given the following "categories" exist: + | name | category | idnumber | + | Cat 1 | 0 | CAT1 | + | Cat 2 | CAT1 | CAT2 | + | Cat 3 | CAT2 | CAT3 | + And the following "courses" exist: + | category | fullname | shortname | idnumber | + | CAT3 | Course 1 | Course 1 | C1 | - And I log in as "admin" - And I go to the courses management page - And I start watching to see if a new page loads - And I should see the "Course categories and courses" management page - And I click on category "Cat 1" in the management interface - And a new page should have loaded since I started watching - And I start watching to see if a new page loads - And I should see the "Course categories and courses" management page - And I click on category "Cat 2" in the management interface - And a new page should have loaded since I started watching - And I start watching to see if a new page loads - And I should see the "Course categories and courses" management page - And I click on category "Cat 3" in the management interface - And a new page should have loaded since I started watching - And I start watching to see if a new page loads - And I should see the "Course categories and courses" management page - And category in management listing should be visible "CAT1" - And category in management listing should be visible "CAT2" - And category in management listing should be visible "CAT3" - And course in management listing should be visible "C1" - And I toggle visibility of category "CAT1" in management listing - And a new page should not have loaded since I started watching - And category in management listing should be dimmed "CAT1" - And category in management listing should be dimmed "CAT2" - And category in management listing should be dimmed "CAT3" - And course in management listing should be dimmed "C1" - And I toggle visibility of category "CAT1" in management listing - And a new page should not have loaded since I started watching - And category in management listing should be visible "CAT1" - And category in management listing should be visible "CAT2" - And category in management listing should be visible "CAT3" - And course in management listing should be visible "C1" - And I toggle visibility of course "C1" in management listing - And a new page should not have loaded since I started watching - And category in management listing should be visible "CAT1" - And category in management listing should be visible "CAT2" - And category in management listing should be visible "CAT3" - And course in management listing should be dimmed "C1" - And I toggle visibility of category "CAT1" in management listing - And a new page should not have loaded since I started watching - And category in management listing should be dimmed "CAT1" - And category in management listing should be dimmed "CAT2" - And category in management listing should be dimmed "CAT3" - And course in management listing should be dimmed "C1" - And I toggle visibility of category "CAT1" in management listing - And a new page should not have loaded since I started watching - And category in management listing should be visible "CAT1" - And category in management listing should be visible "CAT2" - And category in management listing should be visible "CAT3" - And course in management listing should be dimmed "C1" + And I log in as "admin" + And I go to the courses management page + And I start watching to see if a new page loads + And I should see the "Course categories and courses" management page + And I click on category "Cat 1" in the management interface + And a new page should have loaded since I started watching + And I start watching to see if a new page loads + And I should see the "Course categories and courses" management page + And I click on category "Cat 2" in the management interface + And a new page should have loaded since I started watching + And I start watching to see if a new page loads + And I should see the "Course categories and courses" management page + And I click on category "Cat 3" in the management interface + And a new page should have loaded since I started watching + And I start watching to see if a new page loads + And I should see the "Course categories and courses" management page + And category in management listing should be visible "CAT1" + And category in management listing should be visible "CAT2" + And category in management listing should be visible "CAT3" + And course in management listing should be visible "C1" + And I toggle visibility of category "CAT1" in management listing + And a new page should not have loaded since I started watching + And category in management listing should be dimmed "CAT1" + And category in management listing should be dimmed "CAT2" + And category in management listing should be dimmed "CAT3" + And course in management listing should be dimmed "C1" + And I toggle visibility of category "CAT1" in management listing + And a new page should not have loaded since I started watching + And category in management listing should be visible "CAT1" + And category in management listing should be visible "CAT2" + And category in management listing should be visible "CAT3" + And course in management listing should be visible "C1" + And I toggle visibility of course "C1" in management listing + And a new page should not have loaded since I started watching + And category in management listing should be visible "CAT1" + And category in management listing should be visible "CAT2" + And category in management listing should be visible "CAT3" + And course in management listing should be dimmed "C1" + And I toggle visibility of category "CAT1" in management listing + And a new page should not have loaded since I started watching + And category in management listing should be dimmed "CAT1" + And category in management listing should be dimmed "CAT2" + And category in management listing should be dimmed "CAT3" + And course in management listing should be dimmed "C1" + And I toggle visibility of category "CAT1" in management listing + And a new page should not have loaded since I started watching + And category in management listing should be visible "CAT1" + And category in management listing should be visible "CAT2" + And category in management listing should be visible "CAT3" + And course in management listing should be dimmed "C1" diff --git a/course/tests/behat/course_search.feature b/course/tests/behat/course_search.feature index 24bfaaddef5..5dfda56372c 100644 --- a/course/tests/behat/course_search.feature +++ b/course/tests/behat/course_search.feature @@ -5,12 +5,11 @@ Feature: Courses can be searched for and moved in bulk. I need to be able to search courses in bulk and move them around Background: - Given the following "categories" exist: + Given the following "categories" exist: | name | category | idnumber | | Science | 0 | SCI | | English | 0 | ENG | | Miscellaneous | 0 | MISC | - And the following "courses" exist: | fullname | shortname | category | | Biology Y1 | BIO1 | MISC | diff --git a/course/tests/behat/force_group_mode.feature b/course/tests/behat/force_group_mode.feature index 07333d132f2..284a59dd171 100644 --- a/course/tests/behat/force_group_mode.feature +++ b/course/tests/behat/force_group_mode.feature @@ -48,4 +48,3 @@ Feature: Force group mode in a course And I press "Save and display" Then "//a/child::img[contains(@alt, 'No groups (forced mode)')]" "xpath_element" should not exist And "//img[contains(@alt, 'No groups (forced mode)')]" "xpath_element" should not exist - diff --git a/course/tests/behat/view_subfolders_inline.feature b/course/tests/behat/view_subfolders_inline.feature index 9730e539c18..14194c068b3 100644 --- a/course/tests/behat/view_subfolders_inline.feature +++ b/course/tests/behat/view_subfolders_inline.feature @@ -28,40 +28,40 @@ Feature: View subfolders in a course in-line And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element" And I press "Save changes" - @javascript - Scenario: Add a folder with two subfolders - view on separate page - Given I follow "Course 1" - And I should not see "Test subfolder 1" - And I follow "Test folder" - And I should see "Test subfolder 1" - And I press "Edit" - And I press "Create folder" - And I set the field "New folder name" to "Test subfolder 2" - And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element" - And I press "Save changes" - When I follow "Course 1" - Then I should not see "Test subfolder 2" - And I follow "Test folder" - And I should see "Test subfolder 2" + @javascript + Scenario: Add a folder with two subfolders - view on separate page + Given I follow "Course 1" + And I should not see "Test subfolder 1" + And I follow "Test folder" + And I should see "Test subfolder 1" + And I press "Edit" + And I press "Create folder" + And I set the field "New folder name" to "Test subfolder 2" + And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element" + And I press "Save changes" + When I follow "Course 1" + Then I should not see "Test subfolder 2" + And I follow "Test folder" + And I should see "Test subfolder 2" - @javascript - Scenario: Make the subfolders viewable inline on the course page - Given I press "Edit" - And I click on "div.fp-filename" "css_element" in the "div.fp-filename-field" "css_element" - And I press "Create folder" - And I set the field "New folder name" to "Test sub subfolder" - And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element" - And I press "Save changes" - And I should see "Test sub subfolder" - And I navigate to "Edit settings" in current page administration - And I set the field "Display folder contents" to "Inline on a course page" - And I set the field "Show subfolders expanded" to "" - And I press "Save and return to course" - And I should see "Test subfolder 1" - And I should not see "Test sub subfolder" - And I open "Test folder" actions menu - When I click on "Edit settings" "link" in the "Test folder" activity - And I set the field "Show subfolders expanded" to "1" - And I press "Save and return to course" - Then I should see "Test subfolder 1" - And I should see "Test sub subfolder" + @javascript + Scenario: Make the subfolders viewable inline on the course page + Given I press "Edit" + And I click on "div.fp-filename" "css_element" in the "div.fp-filename-field" "css_element" + And I press "Create folder" + And I set the field "New folder name" to "Test sub subfolder" + And I click on "button.fp-dlg-butcreate" "css_element" in the "div.fp-mkdir-dlg" "css_element" + And I press "Save changes" + And I should see "Test sub subfolder" + And I navigate to "Edit settings" in current page administration + And I set the field "Display folder contents" to "Inline on a course page" + And I set the field "Show subfolders expanded" to "" + And I press "Save and return to course" + And I should see "Test subfolder 1" + And I should not see "Test sub subfolder" + And I open "Test folder" actions menu + When I click on "Edit settings" "link" in the "Test folder" activity + And I set the field "Show subfolders expanded" to "1" + And I press "Save and return to course" + Then I should see "Test subfolder 1" + And I should see "Test sub subfolder" diff --git a/files/tests/behat/add_custom_file_type.feature b/files/tests/behat/add_custom_file_type.feature index 03e2e381122..0ed9a61ced7 100644 --- a/files/tests/behat/add_custom_file_type.feature +++ b/files/tests/behat/add_custom_file_type.feature @@ -4,7 +4,6 @@ Feature: Add a new custom file type As an admin I need to add a new custom file type - @javascript Scenario: Add custom file type Given the following "courses" exist: diff --git a/grade/report/grader/tests/behat/ajax_grader.feature b/grade/report/grader/tests/behat/ajax_grader.feature index e274a36ef94..dddab82eb22 100644 --- a/grade/report/grader/tests/behat/ajax_grader.feature +++ b/grade/report/grader/tests/behat/ajax_grader.feature @@ -4,7 +4,6 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe As a teacher I need to be able to update and verify grades - Background: Given the following "courses" exist: | fullname | shortname | category | groupmode | diff --git a/grade/report/user/tests/behat/view_usereport.feature b/grade/report/user/tests/behat/view_usereport.feature index c0bebe61d35..3fc9563afe5 100644 --- a/grade/report/user/tests/behat/view_usereport.feature +++ b/grade/report/user/tests/behat/view_usereport.feature @@ -8,10 +8,10 @@ Feature: We can use the user report | fullname | shortname | category | | Course 1 | C1 | 0 | - Scenario: Verify we can view a user grade report with no users enrolled. - Given I log in as "admin" - And I am on site homepage - And I follow "Course 1" - And I navigate to "View > User report" in the course gradebook - And I select "All users (0)" from the "Select all or one user" singleselect - Then I should see "No students enrolled in this course yet" + Scenario: Verify we can view a user grade report with no users enrolled. + Given I log in as "admin" + And I am on site homepage + And I follow "Course 1" + And I navigate to "View > User report" in the course gradebook + And I select "All users (0)" from the "Select all or one user" singleselect + Then I should see "No students enrolled in this course yet" diff --git a/grade/tests/behat/grade_calculated_grade_items.feature b/grade/tests/behat/grade_calculated_grade_items.feature index a8ecfae18cc..57046899f7b 100644 --- a/grade/tests/behat/grade_calculated_grade_items.feature +++ b/grade/tests/behat/grade_calculated_grade_items.feature @@ -52,7 +52,7 @@ Feature: Calculated grade items can be used in the gradebook @javascript Scenario: Changing max grade for a category item with a calculation that has existing grades will display the same points with the new max grade values immediately. - Given I press "Add category" + Given I press "Add category" And I set the following fields to these values: | Category name | Calc cat | And I press "Save changes" diff --git a/grade/tests/behat/grade_item_validation.feature b/grade/tests/behat/grade_item_validation.feature index fa38d4a30aa..ef381aad6ae 100644 --- a/grade/tests/behat/grade_item_validation.feature +++ b/grade/tests/behat/grade_item_validation.feature @@ -1,5 +1,5 @@ @core_grades -Feature: Editing a grade item +Feature: Grade item validation In order to ensure validation is provided to the teacher As a teacher I need to know why I can not add/edit values on the grade item form diff --git a/grade/tests/behat/grade_letter_boundary_20160518.feature b/grade/tests/behat/grade_letter_boundary_20160518.feature index 072c32df802..8ec6dafd571 100644 --- a/grade/tests/behat/grade_letter_boundary_20160518.feature +++ b/grade/tests/behat/grade_letter_boundary_20160518.feature @@ -1,5 +1,5 @@ @core @core_grades -Feature: We can customise the letter boundary of a course. +Feature: We can customise the letter boundary of a course in gradebook version 20160518. In order to change the letter boundary of a course As a teacher I need to add assessments to the gradebook. diff --git a/grade/tests/behat/grade_natural_normalisation.feature b/grade/tests/behat/grade_natural_normalisation.feature index 1f10b75dff2..82dbd8d05b7 100644 --- a/grade/tests/behat/grade_natural_normalisation.feature +++ b/grade/tests/behat/grade_natural_normalisation.feature @@ -229,39 +229,37 @@ Feature: We can use natural aggregation and weights will be normalised to a tota @javascript Scenario: With one grade item set as extra credit, when I reset the weights for a category they return to the natural weights. - - When I set the following settings for grade item "Test assignment five": - | Extra credit | 1 | - And I set the field "Override weight of Test assignment six" to "1" - And I set the field "Override weight of Test assignment seven" to "1" - And I set the field "Weight of Test assignment six" to "55" - And I set the field "Weight of Test assignment seven" to "40" - And I press "Save changes" - And I reset weights for grade category "Sub category 1" - Then the field "Weight of Test assignment five" matches value "80.0" - And the field "Weight of Test assignment six" matches value "40.0" - And the field "Weight of Test assignment seven" matches value "60.0" + When I set the following settings for grade item "Test assignment five": + | Extra credit | 1 | + And I set the field "Override weight of Test assignment six" to "1" + And I set the field "Override weight of Test assignment seven" to "1" + And I set the field "Weight of Test assignment six" to "55" + And I set the field "Weight of Test assignment seven" to "40" + And I press "Save changes" + And I reset weights for grade category "Sub category 1" + Then the field "Weight of Test assignment five" matches value "80.0" + And the field "Weight of Test assignment six" matches value "40.0" + And the field "Weight of Test assignment seven" matches value "60.0" @javascript Scenario: Overriding a grade item with a negative value results in the value being changed to zero. - - When I set the field "Override weight of Test assignment five" to "1" - And I set the field "Weight of Test assignment five" to "-15" - And I press "Save changes" - Then the field "Weight of Test assignment five" matches value "0.0" - And the field "Weight of Test assignment six" matches value "40.0" - And the field "Weight of Test assignment seven" matches value "60.0" - And I set the field "Override weight of Test assignment six" to "1" - And I set the field "Weight of Test assignment six" to "-25" - And I press "Save changes" - And the field "Weight of Test assignment six" matches value "0.0" - And the field "Weight of Test assignment seven" matches value "100.0" - And I reset weights for grade category "Sub category 1" - And I set the field "Override weight of Test assignment five" to "1" - And I set the field "Override weight of Test assignment six" to "1" - And I set the field "Weight of Test assignment five" to "-10" - And I set the field "Weight of Test assignment six" to "120" - And I press "Save changes" - And the field "Weight of Test assignment five" matches value "0.0" - And the field "Weight of Test assignment six" matches value "100.0" - And the field "Weight of Test assignment seven" matches value "0.0" + When I set the field "Override weight of Test assignment five" to "1" + And I set the field "Weight of Test assignment five" to "-15" + And I press "Save changes" + Then the field "Weight of Test assignment five" matches value "0.0" + And the field "Weight of Test assignment six" matches value "40.0" + And the field "Weight of Test assignment seven" matches value "60.0" + And I set the field "Override weight of Test assignment six" to "1" + And I set the field "Weight of Test assignment six" to "-25" + And I press "Save changes" + And the field "Weight of Test assignment six" matches value "0.0" + And the field "Weight of Test assignment seven" matches value "100.0" + And I reset weights for grade category "Sub category 1" + And I set the field "Override weight of Test assignment five" to "1" + And I set the field "Override weight of Test assignment six" to "1" + And I set the field "Weight of Test assignment five" to "-10" + And I set the field "Weight of Test assignment six" to "120" + And I press "Save changes" + And the field "Weight of Test assignment five" matches value "0.0" + And the field "Weight of Test assignment six" matches value "100.0" + And the field "Weight of Test assignment seven" matches value "0.0" diff --git a/lib/editor/atto/plugins/accessibilityhelper/tests/behat/accessibilityhelper.feature b/lib/editor/atto/plugins/accessibilityhelper/tests/behat/accessibilityhelper.feature index 810f999b75f..8d256d378c0 100644 --- a/lib/editor/atto/plugins/accessibilityhelper/tests/behat/accessibilityhelper.feature +++ b/lib/editor/atto/plugins/accessibilityhelper/tests/behat/accessibilityhelper.feature @@ -32,4 +32,3 @@ Feature: Atto accessibility helper # This shows the current HTML tags applied to the selected text. # This is required because they are not always read by a screen reader. Then I should see "UL, LI" - diff --git a/lib/editor/atto/plugins/align/tests/behat/align.feature b/lib/editor/atto/plugins/align/tests/behat/align.feature index 130389088a8..e6af81b5e89 100644 --- a/lib/editor/atto/plugins/align/tests/behat/align.feature +++ b/lib/editor/atto/plugins/align/tests/behat/align.feature @@ -53,4 +53,3 @@ Feature: Atto align text And I press "Save changes" And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "style=\"text-align:center;\"" - diff --git a/lib/editor/atto/plugins/clear/tests/behat/clear.feature b/lib/editor/atto/plugins/clear/tests/behat/clear.feature index c458ee6f2d3..0e63a89fe6a 100644 --- a/lib/editor/atto/plugins/clear/tests/behat/clear.feature +++ b/lib/editor/atto/plugins/clear/tests/behat/clear.feature @@ -20,4 +20,3 @@ Feature: Atto clear button And I press "Save changes" And I click on "Edit profile" "link" in the "region-main" "region" Then I should not see "Pisa" - diff --git a/lib/editor/atto/plugins/collapse/tests/behat/collapse.feature b/lib/editor/atto/plugins/collapse/tests/behat/collapse.feature index 88f1aab15b6..f6ff8925ca5 100644 --- a/lib/editor/atto/plugins/collapse/tests/behat/collapse.feature +++ b/lib/editor/atto/plugins/collapse/tests/behat/collapse.feature @@ -11,4 +11,3 @@ Feature: Atto collapse button Then "Equation editor" "button" should be visible And I click on "Show fewer buttons" "button" Then "Equation editor" "button" should not be visible - diff --git a/lib/editor/atto/plugins/html/tests/behat/html.feature b/lib/editor/atto/plugins/html/tests/behat/html.feature index 1357cfcb0df..f4a747203e1 100644 --- a/lib/editor/atto/plugins/html/tests/behat/html.feature +++ b/lib/editor/atto/plugins/html/tests/behat/html.feature @@ -11,4 +11,3 @@ Feature: Atto edit HTML And I click on "Show more buttons" "button" And I click on "HTML" "button" Then the field "Description" matches value "

Smurf

" - diff --git a/lib/editor/atto/plugins/link/tests/behat/link.feature b/lib/editor/atto/plugins/link/tests/behat/link.feature index 4d02eb6d73a..f9487330ee2 100644 --- a/lib/editor/atto/plugins/link/tests/behat/link.feature +++ b/lib/editor/atto/plugins/link/tests/behat/link.feature @@ -24,4 +24,3 @@ Feature: Add links to Atto And I press "Save changes" And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Super cool" - diff --git a/lib/editor/atto/plugins/media/tests/behat/media.feature b/lib/editor/atto/plugins/media/tests/behat/media.feature index 60ec2c7351f..03cc0de6997 100644 --- a/lib/editor/atto/plugins/media/tests/behat/media.feature +++ b/lib/editor/atto/plugins/media/tests/behat/media.feature @@ -3,164 +3,164 @@ Feature: Add media to Atto To write rich text - I need to add media. Background: - Given I log in as "admin" - And I follow "Manage private files..." - And I upload "lib/editor/atto/tests/fixtures/moodle-logo.webm" file to "Files" filemanager - And I upload "lib/editor/atto/tests/fixtures/moodle-logo.mp4" file to "Files" filemanager - And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager - And I upload "lib/editor/atto/tests/fixtures/pretty-good-en.vtt" file to "Files" filemanager - And I upload "lib/editor/atto/tests/fixtures/pretty-good-sv.vtt" file to "Files" filemanager - And I click on "Save changes" "button" - And I follow "Profile" in the user menu - And I follow "Blog entries" - And I follow "Add a new entry" - And I set the field "Blog entry body" to "

Media test

" - And I select the text in the "Blog entry body" Atto editor - And I set the field "Entry title" to "The best video in the entire world (not really)" - And I click on "Media" "button" + Given I log in as "admin" + And I follow "Manage private files..." + And I upload "lib/editor/atto/tests/fixtures/moodle-logo.webm" file to "Files" filemanager + And I upload "lib/editor/atto/tests/fixtures/moodle-logo.mp4" file to "Files" filemanager + And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager + And I upload "lib/editor/atto/tests/fixtures/pretty-good-en.vtt" file to "Files" filemanager + And I upload "lib/editor/atto/tests/fixtures/pretty-good-sv.vtt" file to "Files" filemanager + And I click on "Save changes" "button" + And I follow "Profile" in the user menu + And I follow "Blog entries" + And I follow "Add a new entry" + And I set the field "Blog entry body" to "

Media test

" + And I select the text in the "Blog entry body" Atto editor + And I set the field "Entry title" to "The best video in the entire world (not really)" + And I click on "Media" "button" @javascript Scenario: Insert some media as a link - Given I click on "Browse repositories..." "button" in the "#id_summary_editor_link .atto_media_source.atto_media_link_source" "css_element" - And I click on "Private files" "link" in the ".fp-repo-area" "css_element" - And I click on "moodle-logo.webm" "link" - And I click on "Select this file" "button" - And the field "Enter name" matches value "moodle-logo.webm" - And I wait until the page is ready - And I click on "Insert media" "button" - When I click on "Save changes" "button" - Then "//a[. = 'moodle-logo.webm']" "xpath_element" should exist + Given I click on "Browse repositories..." "button" in the "#id_summary_editor_link .atto_media_source.atto_media_link_source" "css_element" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" + And I click on "moodle-logo.webm" "link" + And I click on "Select this file" "button" + And the field "Enter name" matches value "moodle-logo.webm" + And I wait until the page is ready + And I click on "Insert media" "button" + When I click on "Save changes" "button" + Then "//a[. = 'moodle-logo.webm']" "xpath_element" should exist @javascript Scenario: Insert some media as a plain video - Given I click on "Video" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" - And I click on "Private files" "link" in the ".fp-repo-area" "css_element" - And I click on "moodle-logo.webm" "link" - And I click on "Select this file" "button" - And I click on "Add alternative source" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source:nth-of-type(2)" "css_element" - And I click on "Private files" "link" in the ".fp-repo-area" "css_element" - And I click on "moodle-logo.mp4" "link" - And I click on "Select this file" "button" - When I click on "Insert media" "button" - Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][descendant::source[contains(@src, 'moodle-logo.mp4')]]" "xpath_element" should exist + Given I click on "Video" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" + And I click on "moodle-logo.webm" "link" + And I click on "Select this file" "button" + And I click on "Add alternative source" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source:nth-of-type(2)" "css_element" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" + And I click on "moodle-logo.mp4" "link" + And I click on "Select this file" "button" + When I click on "Insert media" "button" + Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][descendant::source[contains(@src, 'moodle-logo.mp4')]]" "xpath_element" should exist @javascript Scenario: Insert some media as a video with display settings - Given I click on "Video" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" - And I click on "Private files" "link" in the ".fp-repo-area" "css_element" - And I click on "moodle-logo.webm" "link" - And I click on "Select this file" "button" - And I click on "Display options" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_poster_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "moodle-logo.png" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And I change window size to "large" - And I set the field with xpath "//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_width_entry ')]" to "420" - And I set the field with xpath "//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_height_entry ')]" to "69" - And I click on "Display options" "link" - When I click on "Insert media" "button" - Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][contains(@poster, 'moodle-logo.png')][@width=420][@height=69]" "xpath_element" should exist + Given I click on "Video" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" + And I click on "moodle-logo.webm" "link" + And I click on "Select this file" "button" + And I click on "Display options" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_poster_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "moodle-logo.png" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And I change window size to "large" + And I set the field with xpath "//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_width_entry ')]" to "420" + And I set the field with xpath "//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_height_entry ')]" to "69" + And I click on "Display options" "link" + When I click on "Insert media" "button" + Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][contains(@poster, 'moodle-logo.png')][@width=420][@height=69]" "xpath_element" should exist @javascript Scenario: Insert some media as a video with advanced settings - Given I click on "Video" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" - And I click on "Private files" "link" in the ".fp-repo-area" "css_element" - And I click on "moodle-logo.webm" "link" - And I click on "Select this file" "button" - And I click on "Advanced settings" "link" - And the field "Show controls" matches value "1" - And I set the field "Play automatically" to "1" - And I set the field "Muted" to "1" - And I set the field "Loop" to "1" - When I click on "Insert media" "button" - Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][@controls='true'][@loop='true'][@autoplay='true'][@autoplay='true']" "xpath_element" should exist + Given I click on "Video" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" + And I click on "moodle-logo.webm" "link" + And I click on "Select this file" "button" + And I click on "Advanced settings" "link" + And the field "Show controls" matches value "1" + And I set the field "Play automatically" to "1" + And I set the field "Muted" to "1" + And I set the field "Loop" to "1" + When I click on "Insert media" "button" + Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][@controls='true'][@loop='true'][@autoplay='true'][@autoplay='true']" "xpath_element" should exist @javascript Scenario: Insert some media as a video with tracks - Given I click on "Video" "link" - And I change window size to "large" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" - And I click on "Private files" "link" in the ".fp-repo-area" "css_element" - And I click on "moodle-logo.webm" "link" - And I click on "Select this file" "button" - And I click on "Subtitles and captions" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_subtitles .atto_media_track_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "pretty-good-sv.vtt" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And the field "Label" matches value "Swedish" - And the field "Language" matches value "sv" - And I click on "Add subtitle track" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_subtitles .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "pretty-good-en.vtt" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[2]" matches value "English" - And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[1]" to "1" - And I click on "Captions" "link" in the ".nav-item[data-track-kind='captions']" "css_element" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_captions .atto_media_track_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "pretty-good-sv.vtt" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And I click on "Overwrite" "button" - And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[3]" matches value "Swedish" - And I click on "Add caption track" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_captions .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "pretty-good-en.vtt" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And I click on "Overwrite" "button" - And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[4]" matches value "English" - And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[4]" to "1" - And I click on "Descriptions" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_descriptions .atto_media_track_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "pretty-good-sv.vtt" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And I click on "Overwrite" "button" - And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[5]" matches value "Swedish" - And I click on "Add description track" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_descriptions .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "pretty-good-en.vtt" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And I click on "Overwrite" "button" - And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[6]" matches value "English" - And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[5]" to "1" - And I click on "Chapters" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_chapters .atto_media_track_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "pretty-good-sv.vtt" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And I click on "Overwrite" "button" - And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[7]" matches value "Swedish" - And I click on "Add chapter track" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_chapters .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "pretty-good-en.vtt" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And I click on "Overwrite" "button" - And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[8]" matches value "English" - And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[8]" to "1" - And I click on "Metadata" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_metadata .atto_media_track_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "pretty-good-sv.vtt" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And I click on "Overwrite" "button" - And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[9]" matches value "Swedish" - And I click on "Add metadata track" "link" - And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_metadata .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element" - And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" - And I click on "pretty-good-en.vtt" "link" - And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" - And I click on "Overwrite" "button" - And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[10]" matches value "English" - And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[9]" to "1" - When I click on "Insert media" "button" - Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='subtitles'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='subtitles'][@label='English'][@srclang='en'][not(@default)]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='captions'][@label='Swedish'][@srclang='sv'][not(@default)]][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='captions'][@label='English'][@srclang='en'][@default='true']][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='descriptions'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='descriptions'][@label='English'][@srclang='en'][not(@default)]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='chapters'][@label='Swedish'][@srclang='sv'][not(@default)]][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='chapters'][@label='English'][@srclang='en'][@default='true']][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='metadata'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='metadata'][@label='English'][@srclang='en'][not(@default)]]" "xpath_element" should exist + Given I click on "Video" "link" + And I change window size to "large" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" + And I click on "moodle-logo.webm" "link" + And I click on "Select this file" "button" + And I click on "Subtitles and captions" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_subtitles .atto_media_track_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "pretty-good-sv.vtt" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And the field "Label" matches value "Swedish" + And the field "Language" matches value "sv" + And I click on "Add subtitle track" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_subtitles .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "pretty-good-en.vtt" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[2]" matches value "English" + And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[1]" to "1" + And I click on "Captions" "link" in the ".nav-item[data-track-kind='captions']" "css_element" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_captions .atto_media_track_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "pretty-good-sv.vtt" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And I click on "Overwrite" "button" + And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[3]" matches value "Swedish" + And I click on "Add caption track" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_captions .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "pretty-good-en.vtt" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And I click on "Overwrite" "button" + And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[4]" matches value "English" + And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[4]" to "1" + And I click on "Descriptions" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_descriptions .atto_media_track_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "pretty-good-sv.vtt" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And I click on "Overwrite" "button" + And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[5]" matches value "Swedish" + And I click on "Add description track" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_descriptions .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "pretty-good-en.vtt" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And I click on "Overwrite" "button" + And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[6]" matches value "English" + And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[5]" to "1" + And I click on "Chapters" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_chapters .atto_media_track_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "pretty-good-sv.vtt" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And I click on "Overwrite" "button" + And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[7]" matches value "Swedish" + And I click on "Add chapter track" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_chapters .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "pretty-good-en.vtt" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And I click on "Overwrite" "button" + And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[8]" matches value "English" + And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[8]" to "1" + And I click on "Metadata" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_metadata .atto_media_track_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "pretty-good-sv.vtt" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And I click on "Overwrite" "button" + And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[9]" matches value "Swedish" + And I click on "Add metadata track" "link" + And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_metadata .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element" + And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element" + And I click on "pretty-good-en.vtt" "link" + And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element" + And I click on "Overwrite" "button" + And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[10]" matches value "English" + And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[9]" to "1" + When I click on "Insert media" "button" + Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='subtitles'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='subtitles'][@label='English'][@srclang='en'][not(@default)]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='captions'][@label='Swedish'][@srclang='sv'][not(@default)]][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='captions'][@label='English'][@srclang='en'][@default='true']][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='descriptions'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='descriptions'][@label='English'][@srclang='en'][not(@default)]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='chapters'][@label='Swedish'][@srclang='sv'][not(@default)]][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='chapters'][@label='English'][@srclang='en'][@default='true']][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='metadata'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='metadata'][@label='English'][@srclang='en'][not(@default)]]" "xpath_element" should exist diff --git a/lib/editor/atto/plugins/strike/tests/behat/strike.feature b/lib/editor/atto/plugins/strike/tests/behat/strike.feature index 5c38924b921..26ad2bf221d 100644 --- a/lib/editor/atto/plugins/strike/tests/behat/strike.feature +++ b/lib/editor/atto/plugins/strike/tests/behat/strike.feature @@ -18,4 +18,3 @@ Feature: Atto strike button And I press "Save changes" And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "MUA" - diff --git a/lib/editor/atto/plugins/subscript/tests/behat/subscript.feature b/lib/editor/atto/plugins/subscript/tests/behat/subscript.feature index 8581a8bfc9b..ac629cebdeb 100644 --- a/lib/editor/atto/plugins/subscript/tests/behat/subscript.feature +++ b/lib/editor/atto/plugins/subscript/tests/behat/subscript.feature @@ -35,4 +35,3 @@ Feature: Atto subscript button And I press "Save changes" And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Submarine" - diff --git a/lib/editor/atto/plugins/superscript/tests/behat/superscript.feature b/lib/editor/atto/plugins/superscript/tests/behat/superscript.feature index 2e3ed49cfff..44dd8715ec8 100644 --- a/lib/editor/atto/plugins/superscript/tests/behat/superscript.feature +++ b/lib/editor/atto/plugins/superscript/tests/behat/superscript.feature @@ -35,4 +35,3 @@ Feature: Atto superscript button And I press "Save changes" And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Helicopter" - diff --git a/lib/editor/atto/plugins/title/tests/behat/title.feature b/lib/editor/atto/plugins/title/tests/behat/title.feature index 527f28456d9..f145be3f628 100644 --- a/lib/editor/atto/plugins/title/tests/behat/title.feature +++ b/lib/editor/atto/plugins/title/tests/behat/title.feature @@ -18,4 +18,3 @@ Feature: Atto title And I press "Save changes" And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "

How The Rock" - diff --git a/lib/editor/atto/plugins/underline/tests/behat/underline.feature b/lib/editor/atto/plugins/underline/tests/behat/underline.feature index c30716cecb1..5733155c0b6 100644 --- a/lib/editor/atto/plugins/underline/tests/behat/underline.feature +++ b/lib/editor/atto/plugins/underline/tests/behat/underline.feature @@ -18,4 +18,3 @@ Feature: Atto underline button And I press "Save changes" And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Deprecated HTML Tag" - diff --git a/message/tests/behat/manage_contacts.feature b/message/tests/behat/manage_contacts.feature index 3a3efed137c..062ed018ca8 100644 --- a/message/tests/behat/manage_contacts.feature +++ b/message/tests/behat/manage_contacts.feature @@ -1,5 +1,5 @@ @core @message @javascript -Feature: Search users +Feature: Manage contacts In order to communicate with fellow users As a user I need to be able to add and remove them from my contacts diff --git a/mod/assign/feedback/editpdf/tests/behat/view_previous_annotations.feature b/mod/assign/feedback/editpdf/tests/behat/view_previous_annotations.feature index b93403e3fd0..f404c237f8a 100644 --- a/mod/assign/feedback/editpdf/tests/behat/view_previous_annotations.feature +++ b/mod/assign/feedback/editpdf/tests/behat/view_previous_annotations.feature @@ -63,4 +63,3 @@ Feature: In an assignment, teacher can view the feedback for a previous attempt. And I wait until the page is ready And I should see "You are editing the feedback for a previous attempt. This is attempt 1 out of 2." And I should see "Page 1 of 3" - diff --git a/mod/assign/tests/behat/display_error_message_onbadformat.feature b/mod/assign/tests/behat/display_error_message_onbadformat.feature index 3bc9106ac9c..c7d374f9fc8 100644 --- a/mod/assign/tests/behat/display_error_message_onbadformat.feature +++ b/mod/assign/tests/behat/display_error_message_onbadformat.feature @@ -63,4 +63,3 @@ Feature: Check that the assignment grade can not be input in a wrong format. And I set the field "Grade out of 100" to "50..6" And I press "Save changes" And I should see "The grade provided could not be understood: 50..6" - diff --git a/mod/book/tests/behat/show_hide_chapters.feature b/mod/book/tests/behat/show_hide_chapters.feature index 47e45faa563..61e97bfdaa0 100644 --- a/mod/book/tests/behat/show_hide_chapters.feature +++ b/mod/book/tests/behat/show_hide_chapters.feature @@ -74,4 +74,3 @@ Feature: Book activity chapter visibility management And I follow "Next" And I should see "Fourth chapter" in the ".book_content" "css_element" And I follow "Exit book" - diff --git a/mod/choice/tests/behat/block_editing.feature b/mod/choice/tests/behat/block_editing.feature index 178215726ef..ea6577baab8 100644 --- a/mod/choice/tests/behat/block_editing.feature +++ b/mod/choice/tests/behat/block_editing.feature @@ -1,5 +1,5 @@ @mod @mod_choice -Feature: Add choice activity +Feature: Editing choice block In order to customise choice page As a teacher or admin I need to add remove block from the choice page diff --git a/mod/data/tests/behat/required_entries.feature b/mod/data/tests/behat/required_entries.feature index f10f83dd92c..8ae18dd8588 100644 --- a/mod/data/tests/behat/required_entries.feature +++ b/mod/data/tests/behat/required_entries.feature @@ -224,24 +224,24 @@ Feature: Users can be required to specify certain fields when adding entries to Then ".alert" "css_element" should exist in the "Required Latlong" "table_row" And ".alert" "css_element" should exist in the "Not required Latlong" "table_row" - Scenario: A student filling in number and text fields with zero will not see an error. - Given I log in as "student1" - And I follow "Course 1" - When I add an entry to "Test database name" database with: - | Base Text input | Some input to allow us to submit the otherwise empty form | - | Required Checkbox Option 1 | 1 | - | RTOC Option 1 | 1 | - | Latitude | 0 | - | Longitude | 0 | - | Required Menu | 1 | - | Required Number | 0 | - | Required Radio Option 1 | 1 | - | Required Text input | 0 | - | Required Text area | 0 | - | Required URL | http://example.com/ | - | Required Multimenu | 1 | - | Required Two-Option Multimenu | 1 | - And I press "Save and view" - And I follow "View list" - Then I should not see "No entries in database" - And I should see "Some input to allow us to submit the otherwise empty form" + Scenario: A student filling in number and text fields with zero will not see an error. + Given I log in as "student1" + And I follow "Course 1" + When I add an entry to "Test database name" database with: + | Base Text input | Some input to allow us to submit the otherwise empty form | + | Required Checkbox Option 1 | 1 | + | RTOC Option 1 | 1 | + | Latitude | 0 | + | Longitude | 0 | + | Required Menu | 1 | + | Required Number | 0 | + | Required Radio Option 1 | 1 | + | Required Text input | 0 | + | Required Text area | 0 | + | Required URL | http://example.com/ | + | Required Multimenu | 1 | + | Required Two-Option Multimenu | 1 | + And I press "Save and view" + And I follow "View list" + Then I should not see "No entries in database" + And I should see "Some input to allow us to submit the otherwise empty form" diff --git a/mod/forum/tests/behat/discussion_subscriptions.feature b/mod/forum/tests/behat/discussion_subscriptions.feature index aa8b6d5c115..540d3b9c0b4 100644 --- a/mod/forum/tests/behat/discussion_subscriptions.feature +++ b/mod/forum/tests/behat/discussion_subscriptions.feature @@ -273,40 +273,40 @@ Feature: A user can control their own subscription preferences for a discussion And I follow "Reply" And the field "Discussion subscription" matches value "I don't want to be notified of new posts in this discussion" - Scenario: A guest should not be able to subscribe to a discussion - Given I am on site homepage - And I add a "Forum" to section "1" and I fill the form with: + Scenario: A guest should not be able to subscribe to a discussion + Given I am on site homepage + And I add a "Forum" to section "1" and I fill the form with: | Forum name | Test forum name | | Forum type | Standard forum for general use | | Description | Test forum description | - And I add a new discussion to "Test forum name" forum with: + And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject one | | Message | Test post message one | - And I log out - When I log in as "guest" - And I follow "Test forum name" - Then "You are not subscribed to this discussion. Click to subscribe." "link" should not exist in the "Test post subject one" "table_row" - And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist in the "Test post subject one" "table_row" - And I follow "Test post subject one" - And "You are not subscribed to this discussion. Click to subscribe." "link" should not exist - And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist + And I log out + When I log in as "guest" + And I follow "Test forum name" + Then "You are not subscribed to this discussion. Click to subscribe." "link" should not exist in the "Test post subject one" "table_row" + And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist in the "Test post subject one" "table_row" + And I follow "Test post subject one" + And "You are not subscribed to this discussion. Click to subscribe." "link" should not exist + And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist - Scenario: A user who is not logged in should not be able to subscribe to a discussion - Given I am on site homepage - And I add a "Forum" to section "1" and I fill the form with: + Scenario: A user who is not logged in should not be able to subscribe to a discussion + Given I am on site homepage + And I add a "Forum" to section "1" and I fill the form with: | Forum name | Test forum name | | Forum type | Standard forum for general use | | Description | Test forum description | - And I add a new discussion to "Test forum name" forum with: + And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject one | | Message | Test post message one | - And I log out - When I follow "Test forum name" - Then "You are not subscribed to this discussion. Click to subscribe." "link" should not exist in the "Test post subject one" "table_row" - And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist in the "Test post subject one" "table_row" - And I follow "Test post subject one" - And "You are not subscribed to this discussion. Click to subscribe." "link" should not exist - And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist + And I log out + When I follow "Test forum name" + Then "You are not subscribed to this discussion. Click to subscribe." "link" should not exist in the "Test post subject one" "table_row" + And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist in the "Test post subject one" "table_row" + And I follow "Test post subject one" + And "You are not subscribed to this discussion. Click to subscribe." "link" should not exist + And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist Scenario: A user can toggle their subscription preferences when viewing a discussion Given I add a "Forum" to section "1" and I fill the form with: diff --git a/mod/forum/tests/behat/post_to_multiple_groups.feature b/mod/forum/tests/behat/post_to_multiple_groups.feature index cfbe9e9eeae..5e3a95840c5 100644 --- a/mod/forum/tests/behat/post_to_multiple_groups.feature +++ b/mod/forum/tests/behat/post_to_multiple_groups.feature @@ -4,7 +4,7 @@ Feature: A user with access to multiple groups should be able to post a copy of As a user I need to have the option to post a copy of a message to all groups -Background: + Background: Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | diff --git a/mod/glossary/tests/behat/prevent_duplicate_entries.feature b/mod/glossary/tests/behat/prevent_duplicate_entries.feature index 3009725faf8..ade10bfdb8b 100644 --- a/mod/glossary/tests/behat/prevent_duplicate_entries.feature +++ b/mod/glossary/tests/behat/prevent_duplicate_entries.feature @@ -33,4 +33,3 @@ Feature: A teacher can choose whether to allow duplicate entries in a glossary And I press "Save changes" Then I should see "This concept already exists. No duplicates allowed in this glossary." And I press "Cancel" - diff --git a/mod/lesson/tests/behat/import_images.feature b/mod/lesson/tests/behat/import_images.feature index 9eaf606cdf5..723cfd74e9a 100644 --- a/mod/lesson/tests/behat/import_images.feature +++ b/mod/lesson/tests/behat/import_images.feature @@ -36,4 +36,3 @@ Feature: In a lesson activity, teacher can import embedded images in questions a And "//audio[contains(@title, 'Listen to this greeting:')]/source[contains(@src, 'bonjour.mp3')]" "xpath_element" should exist And "//*[contains(@class, 'answeroption')]//img[contains(@src, 'pluginfile.php')]" "xpath_element" should exist And "//*[contains(@class, 'answeroption')]//img[contains(@src, 'flag-france.jpg')]" "xpath_element" should exist - diff --git a/mod/lesson/tests/behat/lesson_edit_cluster.feature b/mod/lesson/tests/behat/lesson_edit_cluster.feature index 156d3dc3906..ec7e1391aa1 100644 --- a/mod/lesson/tests/behat/lesson_edit_cluster.feature +++ b/mod/lesson/tests/behat/lesson_edit_cluster.feature @@ -64,7 +64,7 @@ Feature: In a lesson activity, teacher can edit a cluster page And I press "Save page" And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][5]" "xpath_element" And I click on "Add a content page" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][6]" "xpath_element" - And I set the following fields to these values: + And I set the following fields to these values: | Page title | Second page name | | Page contents | Content page after cluster | | id_answer_editor_0 | Next page | diff --git a/mod/lesson/tests/behat/lesson_group_override.feature b/mod/lesson/tests/behat/lesson_group_override.feature index 3bf4ddc2b76..8da82f257db 100644 --- a/mod/lesson/tests/behat/lesson_group_override.feature +++ b/mod/lesson/tests/behat/lesson_group_override.feature @@ -1,5 +1,5 @@ @mod @mod_lesson -Feature: Lesson user override +Feature: Lesson group override In order to grant a student special access to a lesson As a teacher I need to create an override for that user. diff --git a/mod/lesson/tests/behat/lesson_practice.feature b/mod/lesson/tests/behat/lesson_practice.feature index 6b7f4c9812e..14895968bb7 100644 --- a/mod/lesson/tests/behat/lesson_practice.feature +++ b/mod/lesson/tests/behat/lesson_practice.feature @@ -1,96 +1,96 @@ @mod @mod_lesson Feature: Practice mode in a lesson activity - In order to improve my students understanding of a subject - As a teacher - I need to be able to set ungraded practice lesson activites + In order to improve my students understanding of a subject + As a teacher + I need to be able to set ungraded practice lesson activites - Background: - Given the following "users" exist: - | username | firstname | lastname | email | - | teacher1 | Teacher | 1 | teacher1@example.com | - | student1 | Student | 1 | student1@example.com | - And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student1 | C1 | student | - And I log in as "teacher1" - And I follow "Course 1" - And I turn editing mode on - # Setup a basic lesson, we'll adjust it in the scenarios later. - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Lesson description | - And I follow "Test lesson name" - And I follow "Add a question page" - And I set the field "Select a question type" to "True/false" - And I press "Add a question page" - And I set the following fields to these values: - | Page title | True or False | - | Page contents | Paper is made from trees. | - | id_answer_editor_0 | True | - | id_answer_editor_1 | False | - And I press "Save page" + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + | student1 | Student | 1 | student1@example.com | + And the following "courses" exist: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + And I log in as "teacher1" + And I follow "Course 1" + And I turn editing mode on + # Setup a basic lesson, we'll adjust it in the scenarios later. + And I add a "Lesson" to section "1" and I fill the form with: + | Name | Test lesson name | + | Description | Lesson description | + And I follow "Test lesson name" + And I follow "Add a question page" + And I set the field "Select a question type" to "True/false" + And I press "Add a question page" + And I set the following fields to these values: + | Page title | True or False | + | Page contents | Paper is made from trees. | + | id_answer_editor_0 | True | + | id_answer_editor_1 | False | + And I press "Save page" - Scenario: Non-practice lesson records grades in the gradebook - Given I follow "Test lesson name" - And I navigate to "Edit settings" in current page administration - And I set the following fields to these values: - | Name | Non-practice lesson | - | Description | This lesson will affect your course grade | - | Practice lesson | No | - And I press "Save and display" - And I log out - When I log in as "student1" - And I follow "Course 1" - And I follow "Non-practice lesson" - And I set the following fields to these values: - | True | 1 | - And I press "Submit" - Then I should see "View grades" - And I follow "Grades" in the user menu - And I follow "Course 1" - And I should see "Non-practice lesson" + Scenario: Non-practice lesson records grades in the gradebook + Given I follow "Test lesson name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | Name | Non-practice lesson | + | Description | This lesson will affect your course grade | + | Practice lesson | No | + And I press "Save and display" + And I log out + When I log in as "student1" + And I follow "Course 1" + And I follow "Non-practice lesson" + And I set the following fields to these values: + | True | 1 | + And I press "Submit" + Then I should see "View grades" + And I follow "Grades" in the user menu + And I follow "Course 1" + And I should see "Non-practice lesson" - Scenario: Practice lesson doesn't record grades in the gradebook - Given I follow "Test lesson name" - And I navigate to "Edit settings" in current page administration - And I set the following fields to these values: - | Name | Practice lesson | - | Description | This lesson will NOT affect your course grade | - | Practice lesson | Yes | - And I press "Save and display" - And I log out - When I log in as "student1" - And I follow "Course 1" - And I follow "Practice lesson" - And I set the following fields to these values: - | True | 1 | - And I press "Submit" - Then I should not see "View grades" - And I follow "Grades" in the user menu - And I click on "Course 1" "link" in the "Course 1" "table_row" - And I should not see "Practice lesson" + Scenario: Practice lesson doesn't record grades in the gradebook + Given I follow "Test lesson name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | Name | Practice lesson | + | Description | This lesson will NOT affect your course grade | + | Practice lesson | Yes | + And I press "Save and display" + And I log out + When I log in as "student1" + And I follow "Course 1" + And I follow "Practice lesson" + And I set the following fields to these values: + | True | 1 | + And I press "Submit" + Then I should not see "View grades" + And I follow "Grades" in the user menu + And I click on "Course 1" "link" in the "Course 1" "table_row" + And I should not see "Practice lesson" - Scenario: Practice lesson with scale doesn't record grades in the gradebook - Given I follow "Test lesson name" - And I navigate to "Edit settings" in current page administration - And I set the following fields to these values: - | Name | Practice lesson with scale | - | Description | This lesson will NOT affect your course grade | - | Practice lesson | Yes | - | Type | Scale | - And I press "Save and display" - And I log out - When I log in as "student1" - And I follow "Course 1" - And I follow "Practice lesson with scale" - And I set the following fields to these values: - | True | 1 | - And I press "Submit" - Then I should not see "View grades" - And I follow "Grades" in the user menu - And I click on "Course 1" "link" in the "Course 1" "table_row" - And I should not see "Practice lesson with scale" + Scenario: Practice lesson with scale doesn't record grades in the gradebook + Given I follow "Test lesson name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | Name | Practice lesson with scale | + | Description | This lesson will NOT affect your course grade | + | Practice lesson | Yes | + | Type | Scale | + And I press "Save and display" + And I log out + When I log in as "student1" + And I follow "Course 1" + And I follow "Practice lesson with scale" + And I set the following fields to these values: + | True | 1 | + And I press "Submit" + Then I should not see "View grades" + And I follow "Grades" in the user menu + And I click on "Course 1" "link" in the "Course 1" "table_row" + And I should not see "Practice lesson with scale" diff --git a/mod/lesson/tests/behat/lesson_with_clusters.feature b/mod/lesson/tests/behat/lesson_with_clusters.feature index 41038589432..e2bad1a9b8c 100644 --- a/mod/lesson/tests/behat/lesson_with_clusters.feature +++ b/mod/lesson/tests/behat/lesson_with_clusters.feature @@ -75,7 +75,7 @@ Feature: In a lesson activity, students can see questions in random order And I press "Save page" And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][6]" "xpath_element" And I click on "Add a content page" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][7]" "xpath_element" - And I set the following fields to these values: + And I set the following fields to these values: | Page title | Third page name | | Page contents | Content page after cluster 1 | | id_answer_editor_0 | Next page | @@ -114,7 +114,7 @@ Feature: In a lesson activity, students can see questions in random order And I press "Save page" And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][11]" "xpath_element" And I click on "Add a content page" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][12]" "xpath_element" - And I set the following fields to these values: + And I set the following fields to these values: | Page title | Fourth page name | | Page contents | Content page after cluster 2 | | id_answer_editor_0 | Next page | diff --git a/mod/lesson/tests/behat/lesson_with_subcluster.feature b/mod/lesson/tests/behat/lesson_with_subcluster.feature index 5c3580e9168..fc04c53307f 100644 --- a/mod/lesson/tests/behat/lesson_with_subcluster.feature +++ b/mod/lesson/tests/behat/lesson_with_subcluster.feature @@ -65,7 +65,7 @@ Feature: In a lesson activity, students can see questions in random order and a | id_score_1 | 0 | And I press "Save page" And I click on "Add a content page" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][5]" "xpath_element" - And I set the following fields to these values: + And I set the following fields to these values: | Page title | Second page name | | Page contents | This page mark the the beginning of the subcluster it should not be seen by students | | id_answer_editor_0 | Next page | @@ -134,7 +134,7 @@ Feature: In a lesson activity, students can see questions in random order and a And I press "Save page" And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][11]" "xpath_element" And I click on "Add a content page" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][12]" "xpath_element" - And I set the following fields to these values: + And I set the following fields to these values: | Page title | Third page name | | Page contents | Content page after cluster | | id_answer_editor_0 | Next page | diff --git a/mod/lti/tests/behat/contentitemregistration.feature b/mod/lti/tests/behat/contentitemregistration.feature index f3d1237e746..17bd36b4de5 100644 --- a/mod/lti/tests/behat/contentitemregistration.feature +++ b/mod/lti/tests/behat/contentitemregistration.feature @@ -1,5 +1,5 @@ @mod @mod_lti -Feature: Content-Item support +Feature: Create/edit tool configuration that has Content-Item support In order to provide external tools that support the Content-Item Message type for teachers and learners As an admin I need to be able to configure external tool registrations that support the Content-Item Message type. diff --git a/mod/quiz/tests/behat/attempt_basic.feature b/mod/quiz/tests/behat/attempt_basic.feature index cd1fcc9e7ad..18bd5bf897b 100644 --- a/mod/quiz/tests/behat/attempt_basic.feature +++ b/mod/quiz/tests/behat/attempt_basic.feature @@ -1,5 +1,5 @@ @mod @mod_quiz -Feature: Attemp a quiz where some questions require that the previous question has been answered. +Feature: Attempt a quiz As a student In order to demonstrate what I know I need to be able to attempt quizzes diff --git a/mod/quiz/tests/behat/attempt_require_previous.feature b/mod/quiz/tests/behat/attempt_require_previous.feature index e5b37f13d91..4353d9f98df 100644 --- a/mod/quiz/tests/behat/attempt_require_previous.feature +++ b/mod/quiz/tests/behat/attempt_require_previous.feature @@ -1,5 +1,5 @@ @mod @mod_quiz -Feature: Attemp a quiz where some questions require that the previous question has been answered. +Feature: Attempt a quiz where some questions require that the previous question has been answered. In order to complete a quiz where questions require previous ones to be complete As a student I need later questions to appear once earlier ones have been answered. diff --git a/mod/quiz/tests/behat/editing_set_marks_no_attempts.feature b/mod/quiz/tests/behat/editing_set_marks_no_attempts.feature index a25a765eb85..26d7f1ba10a 100644 --- a/mod/quiz/tests/behat/editing_set_marks_no_attempts.feature +++ b/mod/quiz/tests/behat/editing_set_marks_no_attempts.feature @@ -1,5 +1,6 @@ @mod @mod_quiz -Feature: In order to create a quiz that awards marks the way I want +Feature: Edit quiz marks with no attempts + In order to create a quiz that awards marks the way I want As a teacher I must be able to set the marks I want on the Edit quiz page. diff --git a/mod/quiz/tests/behat/editing_set_marks_with_attempts.feature b/mod/quiz/tests/behat/editing_set_marks_with_attempts.feature index f92b3700595..2349c9336be 100644 --- a/mod/quiz/tests/behat/editing_set_marks_with_attempts.feature +++ b/mod/quiz/tests/behat/editing_set_marks_with_attempts.feature @@ -1,5 +1,6 @@ @mod @mod_quiz -Feature: In order to create a quiz that awards marks the way I want +Feature: Edit quiz marks with attempts + In order to create a quiz that awards marks the way I want As a teacher I must be able to set the marks I want on the Edit quiz page (even after the quiz has been attempted). diff --git a/mod/quiz/tests/behat/quiz_reset.feature b/mod/quiz/tests/behat/quiz_reset.feature index 6e7434a9edf..e8e073dc321 100644 --- a/mod/quiz/tests/behat/quiz_reset.feature +++ b/mod/quiz/tests/behat/quiz_reset.feature @@ -76,7 +76,7 @@ Feature: Quiz reset And I navigate to "User overrides" in current page administration Then I should not see "Sam1 Student1" -Scenario: Use course reset to remove group overrides. + Scenario: Use course reset to remove group overrides. When I log in as "teacher1" And I follow "Course 1" And I follow "Test quiz name" diff --git a/mod/wiki/tests/behat/collaborative_individual.feature b/mod/wiki/tests/behat/collaborative_individual.feature index f800f9c8ed9..f42e9b15290 100644 --- a/mod/wiki/tests/behat/collaborative_individual.feature +++ b/mod/wiki/tests/behat/collaborative_individual.feature @@ -86,5 +86,3 @@ Feature: A teacher can set a wiki to be collaborative or individual And I set the field "uid" to "Student 2" And I should see "Individual student2 edition" And I should not see "Individual teacher1 edition" - - diff --git a/mod/wiki/tests/behat/wiki_search.feature b/mod/wiki/tests/behat/wiki_search.feature index ef9a5dbd7b6..059c2cc94b7 100644 --- a/mod/wiki/tests/behat/wiki_search.feature +++ b/mod/wiki/tests/behat/wiki_search.feature @@ -58,7 +58,6 @@ Feature: Users can search wikis And I should see "Collaborative teacher1 page" And I log out - @javascript Scenario: Searching individual wiki Given I log in as "teacher1" diff --git a/mod/workshop/tests/behat/workshop_assessment.feature b/mod/workshop/tests/behat/workshop_assessment.feature index 81637af23dc..c41fb4dc03a 100644 --- a/mod/workshop/tests/behat/workshop_assessment.feature +++ b/mod/workshop/tests/behat/workshop_assessment.feature @@ -152,4 +152,3 @@ Feature: Workshop submission and assessment @javascript Scenario: Add and assess submissions in workshop with javascript enabled - diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index affc9f5c5ae..1fd46483b19 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -915,6 +915,16 @@ } } }, + "gherkin": { + "version": "4.0.0", + "from": "gherkin@4.0.0", + "resolved": "https://registry.npmjs.org/gherkin/-/gherkin-4.0.0.tgz" + }, + "gherkin-lint": { + "version": "1.1.3", + "from": "gherkin-lint@>=1.1.3 <2.0.0", + "resolved": "https://registry.npmjs.org/gherkin-lint/-/gherkin-lint-1.1.3.tgz" + }, "glob": { "version": "7.0.5", "from": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz", diff --git a/package.json b/package.json index 01dc1dcba4f..2a7d142ca14 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "devDependencies": { "async": "1.5.2", "eslint": "3.7.1", + "gherkin-lint": "1.1.3", "grunt": "1.0.1", "grunt-contrib-less": "1.3.0", "grunt-contrib-uglify": "1.0.1", diff --git a/question/tests/behat/copy_questions.feature b/question/tests/behat/copy_questions.feature index d6a267c9ac6..65fb58ab455 100644 --- a/question/tests/behat/copy_questions.feature +++ b/question/tests/behat/copy_questions.feature @@ -47,4 +47,3 @@ Feature: A teacher can duplicate questions in the question bank And I press "Cancel" Then I should see "Test question to be copied" And the field "Select a category" matches value "Test questions (1)" - diff --git a/question/type/ddmarker/tests/behat/preview.feature b/question/type/ddmarker/tests/behat/preview.feature index dc785357187..89425f53f8b 100644 --- a/question/type/ddmarker/tests/behat/preview.feature +++ b/question/type/ddmarker/tests/behat/preview.feature @@ -1,7 +1,7 @@ @qtype @qtype_ddmarker @_switch_window -Feature: Preview a drag-drop onto image question +Feature: Preview a drag-drop marker question As a teacher - In order to check my drag-drop onto image questions will work for students + In order to check my drag-drop marker questions will work for students I need to preview them Background: diff --git a/question/type/description/tests/behat/add.feature b/question/type/description/tests/behat/add.feature index ce3f32f9f6b..50cccc600a2 100644 --- a/question/type/description/tests/behat/add.feature +++ b/question/type/description/tests/behat/add.feature @@ -23,4 +23,4 @@ Feature: Test creating a Description question | Question name | description-001 | | Question text | Instructions about the following questions. | | General feedback | Why actually the field 'General feedback' used in this qytype? | - Then I should see "description-001" + Then I should see "description-001" diff --git a/question/type/essay/tests/behat/export.feature b/question/type/essay/tests/behat/export.feature index 1c56f1968b7..3adfca648ef 100644 --- a/question/type/essay/tests/behat/export.feature +++ b/question/type/essay/tests/behat/export.feature @@ -22,8 +22,8 @@ Feature: Test exporting Essay questions | Test questions | essay | essay-001 | editor | | Test questions | essay | essay-002 | editorfilepicker | | Test questions | essay | essay-003 | plain | - And I log in as "teacher1" - And I follow "Course 1" + And I log in as "teacher1" + And I follow "Course 1" Scenario: Export 3 Essay questions When I navigate to "Export" node in "Course administration > Question bank" diff --git a/question/type/gapselect/tests/behat/import_test.feature b/question/type/gapselect/tests/behat/import_test.feature index 97a3fd86243..83cc4d74582 100644 --- a/question/type/gapselect/tests/behat/import_test.feature +++ b/question/type/gapselect/tests/behat/import_test.feature @@ -5,7 +5,7 @@ Feature: Import and export select missing words questions I need to be able to import and export them Background: - Given the following "users" exist: + Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | T1 | Teacher1 | teacher1@moodle.com | And the following "courses" exist: diff --git a/question/type/shortanswer/tests/behat/preview.feature b/question/type/shortanswer/tests/behat/preview.feature index b41bdf174e0..30441075720 100644 --- a/question/type/shortanswer/tests/behat/preview.feature +++ b/question/type/shortanswer/tests/behat/preview.feature @@ -24,7 +24,6 @@ Feature: Preview a Short answer question And I follow "Course 1" And I navigate to "Question bank" node in "Course administration" - @javascript @_switch_window Scenario: Preview a Short answer question with correct answer When I click on "Preview" "link" in the "shortanswer-001" "table_row" diff --git a/question/type/truefalse/tests/behat/add.feature b/question/type/truefalse/tests/behat/add.feature index 4c09263e5f0..ea36b1da2e5 100644 --- a/question/type/truefalse/tests/behat/add.feature +++ b/question/type/truefalse/tests/behat/add.feature @@ -27,7 +27,7 @@ Feature: Test creating a True/False question | Correct answer | False | | Feedback for the response 'True'. | Well done! | | Feedback for the response 'False'. | Read more about England. | - Then I should see "true-false-001" + Then I should see "true-false-001" Scenario: Create a True/False question with Correct answer as True When I add a "True/False" question filling the form with: @@ -38,4 +38,4 @@ Feature: Test creating a True/False question | Correct answer | True | | Feedback for the response 'True'. | Well done! | | Feedback for the response 'False'. | Read more about England. | - Then I should see "true-false-002" + Then I should see "true-false-002" diff --git a/report/loglive/tests/behat/loglive_report.feature b/report/loglive/tests/behat/loglive_report.feature index 44daf7b3205..7820c1ea016 100644 --- a/report/loglive/tests/behat/loglive_report.feature +++ b/report/loglive/tests/behat/loglive_report.feature @@ -76,4 +76,3 @@ Feature: In a report, admin can see loglive data And I wait "8" seconds And I should see "Test name2" And I log out - diff --git a/user/tests/behat/view_preferences_page.feature b/user/tests/behat/view_preferences_page.feature index 3c67d27c098..2271953c582 100644 --- a/user/tests/behat/view_preferences_page.feature +++ b/user/tests/behat/view_preferences_page.feature @@ -21,7 +21,7 @@ Feature: Access to preferences page | student1 | C1 | student | | student2 | C1 | student | | teacher1 | C1 | editingteacher | - And the following "system role assigns" exist: + And the following "system role assigns" exist: | user | course | role | | manager1 | Acceptance test site | manager |