diff --git a/admin/tool/behat/tests/behat/edit_permissions.feature b/admin/tool/behat/tests/behat/edit_permissions.feature index 7394512c5ce..34c3997c98f 100644 --- a/admin/tool/behat/tests/behat/edit_permissions.feature +++ b/admin/tool/behat/tests/behat/edit_permissions.feature @@ -49,10 +49,14 @@ Feature: Edit capabilities Scenario: Module capabilities overrides Given I log in as "teacher1" + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | I'm the name | + | intro | I'm the introduction | + | section | 1 | And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | I'm the name | - | Description | I'm the introduction | And I follow "I'm the name" And I navigate to "Permissions" in current page administration And I override the system permissions of "Student" role with: 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 3f1d88e0751..3e37c589c2e 100644 --- a/admin/tool/behat/tests/behat/get_and_set_fields.feature +++ b/admin/tool/behat/tests/behat/get_and_set_fields.feature @@ -115,15 +115,24 @@ Feature: Verify that all form fields values can be get and set | Wiki name | Test this one baby | | Default format | HTML | And I press "Cancel" - And I am on "Course 1" course homepage # Radio - Checking "I set the field" and "the field matches value". - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Test choice name | - | Description | Test choice description | - | Allow choice to be updated | Yes | - | Option 1 | one | - | Option 2 | two | - | Option 3 | three | + And the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | intro | Test choice description | + | name | Test choice name | + | choice1 | Option 1, Option 2, Option 3 | + | section | 1 | + | allowupdate | 1 | + And I am on "Course 1" course homepage + And I follow "Test choice name" + And I navigate to "Edit settings" in current page administration + And I set the field "Option 1" to "one" + And I set the field "Option 2" to "two" + And I set the field "Option 3" to "three" + And I press "Save and return to course" + And I am on "Course 1" course homepage And I follow "Test choice name" And I set the field "one" to "1" And I press "Save my choice" diff --git a/admin/tool/recyclebin/tests/behat/basic_functionality.feature b/admin/tool/recyclebin/tests/behat/basic_functionality.feature index ce2d8fd53f8..74c4e41fa01 100644 --- a/admin/tool/recyclebin/tests/behat/basic_functionality.feature +++ b/admin/tool/recyclebin/tests/behat/basic_functionality.feature @@ -43,10 +43,14 @@ Feature: Basic recycle bin functionality Scenario: Restore a deleted assignment Given I log in as "teacher1" + And the following "activity" exists: + | activity | assign | + | name | Test assign | + | intro | Test | + | course | C1 | + | idnumber | 0001 | + | section | 1 | And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assign | - | Description | Test | And I delete "Test assign" activity When I navigate to "Recycle bin" in current page administration Then I should see "Test assign" diff --git a/availability/tests/behat/edit_availability.feature b/availability/tests/behat/edit_availability.feature index 3c352278d60..a22b3d81aee 100644 --- a/availability/tests/behat/edit_availability.feature +++ b/availability/tests/behat/edit_availability.feature @@ -32,8 +32,16 @@ Feature: edit_availability Given the following config values are set as admin: | enableavailability | 0 | When I log in as "teacher1" + And the following "activity" exists: + | activity | page | + | course | C1 | + | idnumber | 0001 | + | section | 1 | + | name | Page1 | + | intro | pageintro | And I am on "Course 1" course homepage with editing mode on - And I add a "Page" to section "1" + And I follow "Page1" + And I navigate to "Edit settings" in current page administration Then "Restrict access" "fieldset" should not exist Given I am on "Course 1" course homepage @@ -43,8 +51,16 @@ Feature: edit_availability And the following config values are set as admin: | enableavailability | 1 | + And the following "activity" exists: + | activity | page | + | course | C1 | + | idnumber | 0002 | + | section | 1 | + | name | Page2 | + | intro | pageintro | And I am on "Course 1" course homepage - And I add a "Page" to section "1" + And I follow "Page2" + And I navigate to "Edit settings" in current page administration Then "Restrict access" "fieldset" should exist Given I am on "Course 1" course homepage diff --git a/backup/util/ui/tests/behat/duplicate_activities.feature b/backup/util/ui/tests/behat/duplicate_activities.feature index 9b1b9afd392..01a9e330f34 100644 --- a/backup/util/ui/tests/behat/duplicate_activities.feature +++ b/backup/util/ui/tests/behat/duplicate_activities.feature @@ -14,15 +14,15 @@ Feature: Duplicate activities And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | data | Test database name | Test database description | C1 | database1 | 1 | And I log in as "admin" And I set the following administration settings values: | backup_import_activities | 0 | And I log out And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Database" to section "1" and I fill the form with: - | Name | Test database name | - | Description | Test database description | And I duplicate "Test database name" activity And I should see "Test database name (copy)" And I wait until section "1" is available diff --git a/backup/util/ui/tests/behat/import_course.feature b/backup/util/ui/tests/behat/import_course.feature index 52c1452106d..55d3271efa3 100644 --- a/backup/util/ui/tests/behat/import_course.feature +++ b/backup/util/ui/tests/behat/import_course.feature @@ -19,13 +19,11 @@ Feature: Import course's contents into another course Scenario: Import course's contents to another course Given I log in as "teacher1" + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | data | Test database name | Test database description | C1 | database1 | 2 | + | forum | Test forum name | Test forum name description | C1 | forum1 | 1 | And I am on "Course 1" course homepage with editing mode on - And I add a "Database" to section "1" and I fill the form with: - | Name | Test database name | - | Description | Test database description | - And I add a "Forum" to section "2" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | And I add the "Comments" block And I add the "Recent blog entries" block And I turn editing mode off diff --git a/blocks/activity_results/tests/behat/addblockinactivity.feature b/blocks/activity_results/tests/behat/addblockinactivity.feature index 3191e13411d..3a4b42d432d 100644 --- a/blocks/activity_results/tests/behat/addblockinactivity.feature +++ b/blocks/activity_results/tests/behat/addblockinactivity.feature @@ -24,30 +24,16 @@ Feature: The activity results block displays student scores | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | + | assign | Test assignment 1 | Offline text | C1 | 1 | assign1 | 0 | + | assign | Test assignment 2 | Offline text | C1 | 1 | assign2 | 0 | + | assign | Test assignment 3 | Offline text | C1 | 1 | assign3 | 0 | + And the following "activities" exist: + | activity | name | content | course | section | idnumber | + | page | Test page name | This is a page | C1 | 1 | page1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 1 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 2 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 3 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage - And I add a "Page" to section "1" - And I set the following fields to these values: - | Name | Test page name | - | Description | Test page description | - | Page content | This is a page | - And I press "Save and return to course" - And I am on "Course 1" course homepage And I should see "Test page name" And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on diff --git a/blocks/activity_results/tests/behat/addunconfiguredblock.feature b/blocks/activity_results/tests/behat/addunconfiguredblock.feature index 0570dbddfea..c2e5b140a32 100644 --- a/blocks/activity_results/tests/behat/addunconfiguredblock.feature +++ b/blocks/activity_results/tests/behat/addunconfiguredblock.feature @@ -29,12 +29,15 @@ Feature: The activity results block doesn't displays student scores for unconfig Then I should see "Please configure this block and select which activity it should display results from." in the "Activity results" "block" Scenario: Try to configure the block on a resource page in a course without activities - Given I add a "Page" to section "1" - And I set the following fields to these values: - | Name | Test page name | - | Description | Test page description | - | page | This is a page | - And I press "Save and display" + Given the following "activity" exists: + | activity | page | + | course | C1 | + | idnumber | 0001 | + | name | Test page name | + | intro | Test page description | + | section | 1 | + | content | This is a page | + And I am on "Course 1" course homepage When I add the "Activity results" block And I configure the "Activity results" block And I should see "There are not yet any activities in this course." diff --git a/blocks/activity_results/tests/behat/addunsupportedactivity.feature b/blocks/activity_results/tests/behat/addunsupportedactivity.feature index 982510d3a90..4f9b286703a 100644 --- a/blocks/activity_results/tests/behat/addunsupportedactivity.feature +++ b/blocks/activity_results/tests/behat/addunsupportedactivity.feature @@ -18,10 +18,9 @@ Feature: The activity results block doesn't display student scores for unsupport And I am on "Course 1" course homepage with editing mode on Scenario: Try to configure the block to use an activity without grades - Given I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | + | assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 | And I am on "Course 1" course homepage And I add the "Activity results" block And I configure the "Activity results" block diff --git a/blocks/activity_results/tests/behat/defaultsettings.feature b/blocks/activity_results/tests/behat/defaultsettings.feature index 3af9d0e39fc..6c32edaebfe 100644 --- a/blocks/activity_results/tests/behat/defaultsettings.feature +++ b/blocks/activity_results/tests/behat/defaultsettings.feature @@ -16,6 +16,16 @@ Feature: The activity results block can have administrator set defaults | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | intro | Offline text | + | section | 1 | + | assignsubmission_file_enabled | 0 | + And I log in as "teacher1" + And I am on "Course 1" course homepage with editing mode on Scenario: Assign some site-wide defaults to the block. Given the following config values are set as admin: @@ -23,12 +33,6 @@ Feature: The activity results block can have administrator set defaults | config_showworst | 0 | block_activity_results | | config_gradeformat | 2 | block_activity_results | | config_nameformat | 2 | block_activity_results | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | And I am on "Course 1" course homepage And I add the "Activity results" block When I configure the "Activity results" block @@ -46,12 +50,6 @@ Feature: The activity results block can have administrator set defaults | config_showbest_locked | 1 | block_activity_results | | config_showworst | 0 | block_activity_results | | config_showworst_locked | 1 | block_activity_results | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | And I am on "Course 1" course homepage And I add the "Activity results" block When I configure the "Activity results" block diff --git a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature index 9a18affe494..6af65257a1a 100644 --- a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature @@ -24,13 +24,11 @@ Feature: The activity results block displays student high scores | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | + | assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/highscoreswithscales.feature b/blocks/activity_results/tests/behat/highscoreswithscales.feature index 76d5b2ac88d..d560b0238e0 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscales.feature @@ -24,6 +24,13 @@ Feature: The activity results block displays students high scores in group as sc | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | intro | Offline text | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Scales" in the course gradebook @@ -32,13 +39,13 @@ Feature: The activity results block displays students high scores in group as sc | Name | My Scale | | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I press "Save changes" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | + And I am on "Course 1" course homepage + And I follow "Test assignment" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | + And I press "Save and return to course" And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on @@ -48,7 +55,7 @@ Feature: The activity results block displays students high scores in group as sc And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment" And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment" And I press "Save changes" - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on Scenario: Configure the block on the course page to show 1 high score Given I add the "Activity results" block diff --git a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature index bb9cb706e06..aa6a98e2472 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature @@ -41,22 +41,26 @@ Feature: The activity results block displays student in group high scores as sca | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | assign | Test assignment | Offline text | C1 | 1 | assign1 | And I log in as "teacher1" - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on And I navigate to "Scales" in the course gradebook And I press "Add a new scale" And I set the following fields to these values: | Name | My Scale | | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I press "Save changes" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | + And I am on "Course 1" course homepage + And I follow "Test assignment" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | assignsubmission_file_enabled | 0 | | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | | Group mode | Separate groups | + And I press "Save and return to course" And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on diff --git a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature index 754a6140ecd..1b8953be518 100644 --- a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature @@ -41,14 +41,17 @@ Feature: The activity results block displays student in separate groups scores | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | intro | Offline text | + | section | 1 | + | assignsubmission_file_enabled | 0 | + | groupmode | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - | Group mode | Separate groups | - And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature index 3eca15e95e6..b7f5e965703 100644 --- a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature @@ -41,13 +41,16 @@ Feature: The activity results block displays student in visible groups scores | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | assignsubmission_file_enabled | + | assign | Test assignment | Test assignment | C1 | assign1 | 1 | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | + And I follow "Test assignment" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Group mode | Visible groups | + And I press "Save and return to course" And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on diff --git a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature index 6c24497b142..1c0577d61e9 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature @@ -24,13 +24,16 @@ Feature: The activity results block displays student low scores | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | intro | Offline text | + | section | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/lowscoreswithscales.feature b/blocks/activity_results/tests/behat/lowscoreswithscales.feature index e4880575f3b..66ba066c72e 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscales.feature @@ -24,6 +24,14 @@ Feature: The activity results block displays student low scores as scales | student3 | C1 | student | | student4 | C1 | student | | student5 | C1 | student | + Given the following "activity" exists: + | activity | assign | + | name | Test assignment | + | intro | Offline text | + | course | C1 | + | idnumber | 0001 | + | section | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Scales" in the course gradebook @@ -33,12 +41,12 @@ Feature: The activity results block displays student low scores as scales | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I press "Save changes" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | + And I follow "Test assignment" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | + And I press "Save and return to course" And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on diff --git a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature index a1e378a85dd..47f55beb4fd 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature @@ -41,6 +41,14 @@ Feature: The activity results block displays students in groups low scores as sc | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | description | Offline text | + | assignsubmission_file_enabled | 0 | + | groupmode | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Scales" in the course gradebook @@ -49,14 +57,13 @@ Feature: The activity results block displays students in groups low scores as sc | Name | My Scale | | Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! | And I press "Save changes" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | + And I am on "Course 1" course homepage + And I follow "Test assignment" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | - | Group mode | Separate groups | + And I press "Save and return to course" And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on @@ -67,7 +74,7 @@ Feature: The activity results block displays students in groups low scores as sc And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment" And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment" And I press "Save changes" - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on Scenario: Try to configure the block on the course page to show 1 low score Given I add the "Activity results" block diff --git a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature index 5575855345c..eadf2e9b0d9 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature @@ -41,14 +41,11 @@ Feature: The activity results block displays students in separate groups scores | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activities" exist: + | activity | course | idnumber | name | intro | assignsubmission_file_enabled | groupmode | + | assign | C1 | a1 | Test assignment | Offline text | 0 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - | Group mode | Separate groups | - And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature index ee5cb5e22d1..13ed3f897fb 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature @@ -41,14 +41,17 @@ Feature: The activity results block displays student in visible groups low score | student4 | G2 | | student5 | G3 | | student6 | G3 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment | + | intro | Offline text | + | section | 1 | + | assignsubmission_file_enabled | 0 | + | groupmode | 2 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - | Group mode | Visible groups | - And I am on "Course 1" course homepage And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" diff --git a/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature b/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature index 586e00c51ec..40e676f6bb7 100644 --- a/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature +++ b/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature @@ -18,12 +18,16 @@ Feature: Enable Block blog menu in an activity | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | + Given the following "activity" exists: + | activity | assign | + | name | Test assignment 1 | + | intro | Offline text | + | course | C1 | + | idnumber | 0001 | + | section | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 1 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | And I follow "Test assignment 1" And I add the "Blog menu" block And I log out diff --git a/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature b/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature index 09112b7162c..70407adb747 100644 --- a/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature +++ b/blocks/blog_recent/tests/behat/block_blog_recent_activity.feature @@ -18,12 +18,16 @@ Feature: Students can use the recent blog entries block to view recent entries o | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment 1 | + | intro | Offline text | + | section | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 1 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | And I follow "Test assignment 1" And I add the "Blog menu" block And I add the "Recent blog entries" 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 5ef506d9a89..c1fd0b2b03c 100644 --- a/blocks/section_links/tests/behat/block_section_links_course.feature +++ b/blocks/section_links/tests/behat/block_section_links_course.feature @@ -14,12 +14,11 @@ Feature: The section links block allows users to quickly navigate around a moodl And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | assignsubmission_file_enabled | + | assign | Test assignment 1 | Offline text | C1 | 5 | assign1 | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "5" and I fill the form with: - | Assignment name | Test assignment 1 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | Scenario: Add the section links block to a course. Given I add the "Section links" block diff --git a/blocks/tests/behat/manage_blocks.feature b/blocks/tests/behat/manage_blocks.feature index afc49fd3497..e3903a9ce64 100644 --- a/blocks/tests/behat/manage_blocks.feature +++ b/blocks/tests/behat/manage_blocks.feature @@ -14,15 +14,18 @@ Feature: Block appearances And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | description | course | idnumber | section | + | survey | Test survey name | Test survey description | C1 | survey1 | 1 | + | book | Test book name | Test book description | C1 | book1 | 1 | And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Survey" to section "1" and I fill the form with: - | Name | Test survey name | + And I am on "Course 1" course homepage + And I follow "Test survey name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Survey type | ATTLS (20 item version) | - | Description | Test survey description | - And I add a "Book" to section "1" and I fill the form with: - | Name | Test book name | - | Description | Test book description | + And I press "Save and return to course" + And I am on "Course 1" course homepage with editing mode on And I follow "Test book name" And I set the following fields to these values: | Chapter title | Book title | diff --git a/blocks/tests/behat/return_block_original_state.feature b/blocks/tests/behat/return_block_original_state.feature index 79c4b97a904..c0f45f5f121 100644 --- a/blocks/tests/behat/return_block_original_state.feature +++ b/blocks/tests/behat/return_block_original_state.feature @@ -8,6 +8,10 @@ Feature: The context of a block can always be returned to it's original state. Given the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | assign | Assignment1 | Description | C1 | 1 | assign1 | + | assign | Assignment2 | Description | C1 | 1 | assign1 | And I log in as "admin" When I am on "Course 1" course homepage with editing mode on And I add the "Tags" block @@ -18,9 +22,6 @@ Feature: The context of a block can always be returned to it's original state. | Display on page types | Any page | And I press "Save changes" And I am on "Course 1" course homepage - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Assignment1 | - | Description | Description | And I follow "Assignment1" And I configure the "Tags" block And I set the following fields to these values: @@ -32,9 +33,6 @@ Feature: The context of a block can always be returned to it's original state. And I navigate to course participants And "Tags" "block" should not exist And I am on "Course 1" course homepage - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Assignment2 | - | Description | Description | And I follow "Assignment2" And I should see "Tags" in the "Tags" "block" And I configure the "Tags" block diff --git a/completion/tests/behat/completion_no_calendar_capabilities.feature b/completion/tests/behat/completion_no_calendar_capabilities.feature index f690f76e556..f9f73e64d85 100644 --- a/completion/tests/behat/completion_no_calendar_capabilities.feature +++ b/completion/tests/behat/completion_no_calendar_capabilities.feature @@ -14,8 +14,25 @@ Feature: Completion with no calendar capabilites And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | Test forum name | + | intro | Test forum name description | + | section | 1 | + | completion | 2 | And I log in as "admin" And I am on "Course 1" course homepage + And I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | id_completionexpected_enabled | 1 | + | id_completionexpected_day | 1 | + | id_completionexpected_month | 1 | + | id_completionexpected_year | 2017 | + And I press "Save and return to course" + And I am on "Course 1" course homepage And I navigate to "Users > Permissions" in current page administration And I override the system permissions of "Teacher" role with: | capability | permission | @@ -23,17 +40,6 @@ Feature: Completion with no calendar capabilites And I log out Scenario: Editing completion date - Given I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - When I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | - | Completion tracking | Show activity as complete when conditions are met | - | id_completionexpected_enabled | 1 | - | id_completionexpected_day | 1 | - | id_completionexpected_month | 1 | - | id_completionexpected_year | 2017 | - And I log out When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I follow "Test forum name" diff --git a/course/tests/behat/activities_edit_completion.feature b/course/tests/behat/activities_edit_completion.feature index ebca3b4f1f3..c22719accd6 100644 --- a/course/tests/behat/activities_edit_completion.feature +++ b/course/tests/behat/activities_edit_completion.feature @@ -8,15 +8,11 @@ Feature: Edit completion settings of an activity Given the following "courses" exist: | fullname | shortname | enablecompletion | | Course 1 | C1 | 1 | + And the following "activities" exist: + | activity | course | idnumber | intro | name | completion | completionview | + | page | C1 | p1 | x | TestPage | 2 | 1 | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - And I add a "Page" to section "1" and I fill the form with: - | Name | TestPage | - | Description | x | - | Page content | x | - | Completion tracking | 2 | - | Require view | 1 | - And I am on "Course 1" course homepage Scenario: Completion is not locked when the activity has not yet been viewed Given I click on "Edit settings" "link" in the "TestPage" activity diff --git a/course/tests/behat/course_controls.feature b/course/tests/behat/course_controls.feature index 0cb64fed9fe..e51d1807df9 100644 --- a/course/tests/behat/course_controls.feature +++ b/course/tests/behat/course_controls.feature @@ -98,6 +98,10 @@ Feature: Course activity controls works as expected And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | forum | Test forum name 1 | Test forum description 1 | C1 | 0001 | 1 | + | forum | Test forum name 2 | Test forum description 2 | C1 | 0002 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage When I follow @@ -107,12 +111,6 @@ Feature: Course activity controls works as expected And I click on "Delete Recent activity block" "link" And I press "Yes" And "section" exist - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name 1 | - | Description | Test forum description 1 | - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name 2 | - | Description | Test forum description 2 | And "section" exist And I indent right "Test forum name 1" activity And "section" exist diff --git a/course/tests/behat/general_section.feature b/course/tests/behat/general_section.feature index 4a5a259c4a0..ba6f10b12fe 100644 --- a/course/tests/behat/general_section.feature +++ b/course/tests/behat/general_section.feature @@ -14,12 +14,12 @@ Feature: General section does not show in navigation when empty And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | forum | Test forum name | Test forum name description | C1 | forum1 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I add the "Navigation" block if not present - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | Scenario: General section is visible in navigation when it is not empty When I move "Test forum name" activity to section "0" diff --git a/course/tests/behat/move_activities.feature b/course/tests/behat/move_activities.feature index b06c7f6a73b..ebdc29a1ffd 100644 --- a/course/tests/behat/move_activities.feature +++ b/course/tests/behat/move_activities.feature @@ -14,14 +14,18 @@ Feature: Activities can be moved between sections And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | Test forum name | + | intro | Test forum description | + | section | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I add the "Recent activity" block And I follow "Delete Recent activity block" And I press "Yes" - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | Scenario: Move activities in a single page course with Javascript disabled When I move "Test forum name" activity to section "2" @@ -39,12 +43,16 @@ Feature: Activities can be moved between sections Scenario: Move activities in a course section with Javascript disabled using paged mode Given I navigate to "Edit settings" in current page administration + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00002 | + | name | Second forum name | + | intro | Second forum description | + | section | 1 | And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save and display" - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Second forum name | - | Description | Second forum description | And I follow "Topic 1" When I move "Second forum name" activity to section "1" Then "Second forum name" "link" should appear before "Test forum name" "link" diff --git a/course/tests/behat/move_sections.feature b/course/tests/behat/move_sections.feature index 0e9e097346c..b4b379f6936 100644 --- a/course/tests/behat/move_sections.feature +++ b/course/tests/behat/move_sections.feature @@ -15,38 +15,40 @@ Feature: Sections can be moved | user | course | role | | teacher1 | C1 | editingteacher | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on Scenario: Move up and down a section with Javascript disabled in a single page course - Given I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | forum | Test forum name | Test forum name description | C1 | forum1 | 1 | + And I am on "Course 1" course homepage with editing mode on When I move down section "1" Then I should see "Test forum name" in the "Topic 2" "section" And I move up section "2" And I should see "Test forum name" in the "Topic 1" "section" Scenario: Move up and down a section with Javascript disabled in the course home of a course using paged mode - Given I navigate to "Edit settings" in current page administration + Given the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | forum | Test forum name | Test forum name description | C1 | forum1 | 1 | + And I am on "Course 1" course homepage with editing mode on + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save and display" - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | When I move down section "1" Then I should see "Test forum name" in the "Topic 2" "section" And I move up section "2" And I should see "Test forum name" in the "Topic 1" "section" Scenario: Sections can not be moved with Javascript disabled in a section page of a course using paged mode - Given I navigate to "Edit settings" in current page administration + Given the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | forum | Test forum name | Test forum name description | C1 | forum1 | 2 | + And I am on "Course 1" course homepage with editing mode on + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save and display" - And I add a "Forum" to section "2" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | When I follow "Topic 2" Then "Topic 1" "section" should not exist And "Topic 3" "section" should not exist diff --git a/course/tests/behat/restrict_available_activities.feature b/course/tests/behat/restrict_available_activities.feature index d3616b631b7..521f2f2f06c 100644 --- a/course/tests/behat/restrict_available_activities.feature +++ b/course/tests/behat/restrict_available_activities.feature @@ -28,6 +28,7 @@ Feature: Restrict activities availability Then I should see "Test glossary name" And I should see "Test chat name" + @javascript Scenario: Activities can not be added when the admin restricts the permissions Given I log in as "admin" And I set the following system permissions of "Teacher" role: @@ -39,5 +40,6 @@ Feature: Restrict activities availability And I log out And I log in as "teacher1" When I am on "Course 1" course homepage with editing mode on - Then the "Add a resource to section 'Topic 1'" select box should not contain "Chat" - Then the "Add an activity to section 'Topic 1'" select box should not contain "Glossary" + And I press "Add an activity or resource" + Then "Add a new Chat" "link" should not exist in the "Add an activity or resource" "dialogue" + Then "Add a new Glossary" "link" should not exist in the "Add an activity or resource" "dialogue" diff --git a/enrol/guest/tests/behat/guest_access.feature b/enrol/guest/tests/behat/guest_access.feature index 93742ba4f81..859d5bc71f5 100644 --- a/enrol/guest/tests/behat/guest_access.feature +++ b/enrol/guest/tests/behat/guest_access.feature @@ -15,11 +15,15 @@ Feature: Guest users can auto-enrol themself in courses where guest access is al And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 0001 | + | name | Test forum name | + | intro | Test forum description | + | section | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | Scenario: Allow guest access without password Given I navigate to "Users > Enrolment methods" in current page administration diff --git a/enrol/lti/tests/behat/index_page.feature b/enrol/lti/tests/behat/index_page.feature index b824e7e9031..28fb2108bc3 100644 --- a/enrol/lti/tests/behat/index_page.feature +++ b/enrol/lti/tests/behat/index_page.feature @@ -14,6 +14,9 @@ Feature: Check that the page listing the shared external tools is functioning as And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | assign | Test assignment name | Submit your online text | C1 | assign1 | 1 | And I log in as "admin" And I navigate to "Plugins > Enrolments > Manage enrol plugins" in site administration And I click on "Enable" "link" in the "Publish as LTI tool" "table_row" @@ -22,9 +25,6 @@ Feature: Check that the page listing the shared external tools is functioning as Scenario: I want to edit an external tool Given I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment name | - | Description | Submit your online text | And I navigate to "Users > Enrolment methods" in current page administration And I select "Publish as LTI tool" from the "Add method" singleselect And I set the following fields to these values: diff --git a/grade/grading/form/guide/tests/behat/edit_guide.feature b/grade/grading/form/guide/tests/behat/edit_guide.feature index 403eacf6d16..55e93eef85c 100644 --- a/grade/grading/form/guide/tests/behat/edit_guide.feature +++ b/grade/grading/form/guide/tests/behat/edit_guide.feature @@ -16,12 +16,27 @@ Feature: Marking guides can be created and edited | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | assign1 | + | name | Test assignment 1 name | + | intro | Test assignment description | + | section | 1 | + | assignsubmission_file_enabled | 1 | + | assignsubmission_onlinetext_enabled | 1 | + | assignsubmission_file_maxfiles | 1 | + | assignsubmission_file_maxsizebytes | 1000 | + | assignfeedback_comments_enabled | 1 | + | assignfeedback_file_enabled | 1 | + | assignfeedback_comments_commentinline | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 1 name | - | Description | Test assignment description | + And I am on "Course 1" course homepage + And I follow "Test assignment 1 name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Grading method | Marking guide | + And I press "Save and return to course" # Defining a marking guide When I go to "Test assignment 1 name" advanced grading definition page And I set the following fields to these values: diff --git a/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature b/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature index f649d1129d6..be777a00e28 100644 --- a/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature +++ b/grade/grading/form/rubric/tests/behat/reuse_own_rubrics.feature @@ -14,12 +14,17 @@ Feature: Reuse my rubrics in other activities And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | assign | Test assignment 1 name | Test assignment 1 description | C1 | 1 | assign1 | + | assign | Test assignment 2 name | Test assignment 2 description | C1 | 1 | assign1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 1 name | - | Description | Test assignment 1 description | + And I am on "Course 1" course homepage + And I follow "Test assignment 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Grading method | Rubric | + And I press "Save and return to course" And I go to "Test assignment 1 name" advanced grading definition page And I set the following fields to these values: | Name | Assignment 1 rubric | @@ -30,10 +35,12 @@ Feature: Reuse my rubrics in other activities | Criterion 3 | Level 31 | 31 | Level 32 | 32 | | | And I press "Save rubric and make it ready" And I am on "Course 1" course homepage - When I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 2 name | - | Description | Test assignment 2 description | + And I am on "Course 1" course homepage + And I follow "Test assignment 2" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Grading method | Rubric | + And I press "Save and return to course" And I set "Test assignment 2 name" activity to use "Assignment 1 rubric" grading form Then I should see "Ready for use" And I should see "Criterion 1" diff --git a/grade/tests/behat/grade_to_pass.feature b/grade/tests/behat/grade_to_pass.feature index 0be6180b699..abfcbda92a5 100644 --- a/grade/tests/behat/grade_to_pass.feature +++ b/grade/tests/behat/grade_to_pass.feature @@ -46,14 +46,18 @@ Feature: We can set the grade to pass value And I press "Cancel" Scenario: Set a valid grade to pass for an assignment activity using points - When I turn editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test Assignment 1 | - | Description | Submit your online text | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | assign | Test Assignment 1 | Submit your online text | C1 | 1 | assign1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Assignment 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | assignsubmission_onlinetext_enabled | 1 | | grade[modgrade_type] | Point | | grade[modgrade_point] | 50 | | Grade to pass | 25 | + And I press "Save and return to course" And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit assign Test Assignment 1" "link" @@ -69,13 +73,17 @@ Feature: We can set the grade to pass value And the field "Grade to pass" matches value "30" Scenario: Set a valid grade to pass for an assignment activity using scales - When I turn editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test Assignment 1 | - | Description | Submit your online text | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | assign | Test Assignment 1 | Submit your online text | C1 | 1 | assign1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Assignment 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | grade[modgrade_type] | Scale | | grade[modgrade_scale] | Test Scale 1 | | Grade to pass | 3 | + And I press "Save and return to course" And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit assign Test Assignment 1" "link" @@ -89,24 +97,32 @@ Feature: We can set the grade to pass value And the field "Grade to pass" matches value "4" Scenario: Set a invalid grade to pass for an assignment activity using scales - When I turn editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test Assignment 1 | - | Description | Submit your online text | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | assign | Test Assignment 1 | Submit your online text | C1 | 1 | assign1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Assignment 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | grade[modgrade_type] | Scale | | grade[modgrade_scale] | Test Scale 1 | | Grade to pass | 10 | + And I press "Save and return to course" Then I should see "The grade to pass can not be greater than the maximum possible grade 4" Scenario: Set a valid grade to pass for workshop activity - When I turn editing mode on - And I add a "Workshop" to section "1" and I fill the form with: - | Workshop name | Test Workshop 1 | - | Description | Test workshop | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | workshop | Test Workshop 1 | Test workshop | C1 | 1 | workshop1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Workshop 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | grade | 80 | | Submission grade to pass | 40 | | gradinggrade | 20 | | Assessment grade to pass | 10 | + And I press "Save and return to course" And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit workshop Test Workshop 1 (submission)" "link" @@ -126,22 +142,31 @@ Feature: We can set the grade to pass value And the field "Assessment grade to pass" matches value "15" Scenario: Set an invalid grade to pass for workshop activity - When I turn editing mode on - And I add a "Workshop" to section "1" and I fill the form with: - | Workshop name | Test Workshop 1 | - | Description | Test workshop | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | workshop | Test Workshop 1 | Test workshop | C1 | 1 | workshop1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Workshop 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | grade | 80 | | Submission grade to pass | 90 | | gradinggrade | 20 | | Assessment grade to pass | 30 | + And I press "Save and return to course" Then "The grade to pass can not be greater than the maximum possible grade 80" "text" should exist in the "Submission grade to pass" "form_row" Then "The grade to pass can not be greater than the maximum possible grade 20" "text" should exist in the "Assessment grade to pass" "form_row" Scenario: Set a valid grade to pass for quiz activity - When I turn editing mode on - And I add a "Quiz" to section "1" and I fill the form with: - | Name | Test Quiz 1 | + Given the following "activities" exist: + | activity | name | course | section | idnumber | + | quiz | Test Quiz 1 | C1 | 1 | quiz1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Quiz 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Grade to pass | 9.5 | + And I press "Save and return to course" And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit quiz Test Quiz 1" "link" @@ -155,11 +180,15 @@ Feature: We can set the grade to pass value And the field "Grade to pass" matches value "8.00" Scenario: Set a valid grade to pass for lesson activity - When I turn editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test Lesson 1 | - | Description | Test | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | lesson | Test Lesson 1 | Test | C1 | 1 | lesson1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Lesson 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Grade to pass | 90 | + And I press "Save and return to course" And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit lesson Test Lesson 1" "link" @@ -173,12 +202,18 @@ Feature: We can set the grade to pass value And the field "Grade to pass" matches value "80" Scenario: Set a valid grade to pass for database activity - When I turn editing mode on - And I add a "Database" to section "1" and I fill the form with: - | Name | Test Database 1 | - | Description | Test | - | Aggregate type | Average of ratings | - | Grade to pass | 90 | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | data | Test Database 1 | Test | C1 | 1 | data1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Database 1" + And I navigate to "Edit settings" in current page administration + And I expand all fieldsets + And I set the following fields to these values: + | Ratings > Aggregate type | Average of ratings | + | id_scale_modgrade_type | Point | + | Ratings > Grade to pass | 90 | + And I press "Save and return to course" And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit data Test Database 1" "link" @@ -191,22 +226,34 @@ Feature: We can set the grade to pass value And the field "Grade to pass" matches value "80" Scenario: Set an invalid grade to pass for forum activity - When I turn editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test Forum 1 | - | Description | Test | - | Ratings > Aggregate type | Average of ratings | - | Ratings > Grade to pass | 90 | - | Ratings > scale[modgrade_point] | 60 | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | forum | Test Forum 1 | Test | C1 | 1 | forum1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Forum 1" + And I navigate to "Edit settings" in current page administration + And I expand all fieldsets + And I set the following fields to these values: + | Ratings > Aggregate type | Average of ratings | + | id_scale_modgrade_type | Point | + | Ratings > Grade to pass | 90 | + | Ratings > scale[modgrade_point] | 60 | + And I press "Save and return to course" Then I should see "The grade to pass can not be greater than the maximum possible grade 60" Scenario: Set a valid grade to pass for forum activity - When I turn editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test Forum 1 | - | Description | Test | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | forum | Test Forum 1 | Test | C1 | 1 | forum1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Forum 1" + And I navigate to "Edit settings" in current page administration + And I expand all fieldsets + And I set the following fields to these values: | Ratings > Aggregate type | Average of ratings | + | id_scale_modgrade_type | Point | | Ratings > Grade to pass | 90 | + And I press "Save and return to course" And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit forum Test Forum 1 rating" "link" @@ -220,12 +267,17 @@ Feature: We can set the grade to pass value And the field "Ratings > Grade to pass" matches value "80" Scenario: Set a valid grade to pass for glossary activity - When I turn editing mode on - And I add a "Glossary" to section "1" and I fill the form with: - | Name | Test Glossary 1 | - | Description | Test | - | Aggregate type | Average of ratings | - | Grade to pass | 90 | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | glossary | Test Glossary 1 | Test | C1 | 1 | glossary1 | + And I am on "Course 1" course homepage with editing mode on + And I follow "Test Glossary 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | Ratings > Aggregate type | Average of ratings | + | id_scale_modgrade_type | Point | + | Ratings > Grade to pass | 90 | + And I press "Save and return to course" And I navigate to "View > Grader report" in the course gradebook And I turn editing mode on And I click on "Edit glossary Test Glossary 1" "link" diff --git a/grade/tests/behat/grade_view.feature b/grade/tests/behat/grade_view.feature index 1700dc0efed..3c24b8f9afe 100644 --- a/grade/tests/behat/grade_view.feature +++ b/grade/tests/behat/grade_view.feature @@ -17,20 +17,28 @@ Feature: We can enter in grades and view reports from the gradebook | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | assign | Test assignment name 1 | Submit your online text | C1 | 1 | assign1 | + | assign | Test assignment name 2 | Submit your online text | C1 | 1 | assign2 | And I log in as "admin" And I set the following administration settings values: | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural | And I log out And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment name 1 | + And I am on "Course 1" course homepage + And I follow "Test assignment name 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Description | Submit your online text | | assignsubmission_onlinetext_enabled | 1 | - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment name 2 | + And I press "Save and return to course" + And I follow "Test assignment name 2" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Description | Submit your online text | | assignsubmission_onlinetext_enabled | 1 | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -39,6 +47,8 @@ Feature: We can enter in grades and view reports from the gradebook And I set the following fields to these values: | Online text | This is a submission for assignment 1 | And I press "Save changes" + And I press "Submit assignment" + And I press "Continue" Then I should see "Submitted for grading" And I am on "Course 1" course homepage And I follow "Test assignment name 2" @@ -46,6 +56,8 @@ Feature: We can enter in grades and view reports from the gradebook And I set the following fields to these values: | Online text | This is a submission for assignment 2 | And I press "Save changes" + And I press "Submit assignment" + And I press "Continue" Then I should see "Submitted for grading" And I log out And I log in as "teacher1" diff --git a/lib/form/tests/behat/modgrade_validation.feature b/lib/form/tests/behat/modgrade_validation.feature index d154d6768ff..f27ea4ae97d 100644 --- a/lib/form/tests/behat/modgrade_validation.feature +++ b/lib/form/tests/behat/modgrade_validation.feature @@ -32,15 +32,20 @@ Feature: Using the activity grade form element And I press "Save changes" And I log out And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | forum | Test forum name | Test forum description | C1 | forum1 | + And I am on "Course 1" course homepage + And I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Forum type | Standard forum for general use | - | Description | Test forum description | | Aggregate type | Average of ratings | | scale[modgrade_type] | Point | | scale[modgrade_point] | 100 | | Group mode | No groups | + And I press "Save and return to course" + And I am on "Course 1" course homepage And I follow "Test forum name" And I navigate to "Edit settings" in current page administration When I expand all fieldsets @@ -156,15 +161,19 @@ Feature: Using the activity grade form element Scenario: Attempting to change the maximum grade when ratings exist Given I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | forum | Test forum name | Test forum description | C1 | forum1 | 1 | + And I am on "Course 1" course homepage + And I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Forum type | Standard forum for general use | - | Description | Test forum description | | Aggregate type | Average of ratings | | scale[modgrade_type] | Point | | scale[modgrade_point] | 100 | | Group mode | No groups | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage diff --git a/mod/assign/tests/behat/assign_comments_no_error.feature b/mod/assign/tests/behat/assign_comments_no_error.feature index 96e6fb3ceb6..00b16edaafc 100644 --- a/mod/assign/tests/behat/assign_comments_no_error.feature +++ b/mod/assign/tests/behat/assign_comments_no_error.feature @@ -11,13 +11,11 @@ Feature: Switch role does not cause an error message in assignsubmission_comment And the following "course enrolments" exist: | course | user | role | | C1 | teacher1 | editingteacher | + And the following "activities" exist: + | activity | course | idnumber | name | intro | teamsubmission | + | assign | C1 | a1 | Test assignment one | This is the description text | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage - And I turn editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment | - | Description | This is the description text | - | Students submit in groups | Yes | Scenario: I switch role to student and an error doesn't occur When I follow "Switch role to..." in the user menu diff --git a/mod/assign/tests/behat/assign_course_reset.feature b/mod/assign/tests/behat/assign_course_reset.feature index 2373b71d3c3..ed91d37069a 100644 --- a/mod/assign/tests/behat/assign_course_reset.feature +++ b/mod/assign/tests/behat/assign_course_reset.feature @@ -22,25 +22,27 @@ Feature: Assign reset | name | course | idnumber | | Group 1 | C1 | G1 | | Group 2 | C1 | G2 | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment name | - | Description | Submit your online text | - | assignsubmission_onlinetext_enabled | 1 | - | assignsubmission_onlinetext_wordlimit_enabled | 1 | - | assignsubmission_onlinetext_wordlimit | 10 | - | assignsubmission_file_enabled | 0 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment name | + | intro | Submit your online text | + | assignsubmission_onlinetext_enabled | 1 | + | assignsubmission_onlinetext_wordlimit_enabled | 1 | + | assignsubmission_onlinetext_wordlimit | 10 | + | assignsubmission_file_enabled | 0 | Scenario: Use course reset to clear all attempt data - When I log out - And I log in as "student1" + When I log in as "student1" And I am on "Course 1" course homepage And I follow "Test assignment name" When I press "Add submission" And I set the following fields to these values: | Online text | I'm the student first submission | And I press "Save changes" + And I press "Submit assignment" + And I press "Continue" Then I should see "Submitted for grading" And I should see "I'm the student first submission" And I should see "Not graded" @@ -63,7 +65,9 @@ Feature: Assign reset @javascript Scenario: Use course reset to remove user overrides. - When I follow "Test assignment name" + When I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Test assignment name" And I navigate to "User overrides" in current page administration And I press "Add user override" And I set the following fields to these values: @@ -88,7 +92,9 @@ Feature: Assign reset Then I should not see "Sam1 Student1" Scenario: Use course reset to remove group overrides. - When I follow "Test assignment name" + When I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Test assignment name" And I navigate to "Group overrides" in current page administration And I press "Add group override" And I set the following fields to these values: @@ -113,7 +119,9 @@ Feature: Assign reset Then I should not see "Group 1" Scenario: Use course reset to reset blind marking assignment. - Given I follow "Test assignment name" + When I log in as "teacher1" + And I am on "Course 1" course homepage + And I follow "Test assignment name" And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | blindmarking | 1 | diff --git a/mod/assign/tests/behat/assign_no_calendar_capabilities.feature b/mod/assign/tests/behat/assign_no_calendar_capabilities.feature index d8e9a56c601..a726e6a4f4a 100644 --- a/mod/assign/tests/behat/assign_no_calendar_capabilities.feature +++ b/mod/assign/tests/behat/assign_no_calendar_capabilities.feature @@ -24,14 +24,18 @@ Feature: Assignment with no calendar capabilites Scenario: Editing an assignment Given I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - When I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment name | - | Description | Test assignment description | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | assign | Test assignment name | Test assignment description | C1 | 1 | assign1 | + And I am on "Course 1" course homepage + And I follow "Test assignment name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Allow submissions from | ##1 January 2017## | | Due date | ##1 February 2017## | | Cut-off date | ##2 February 2017## | | Remind me to grade by | ##1 March 2017## | + And I press "Save and return to course" And I log out When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on diff --git a/mod/assign/tests/behat/group_submission.feature b/mod/assign/tests/behat/group_submission.feature index 6a8454301a5..0891e7a6e8b 100644 --- a/mod/assign/tests/behat/group_submission.feature +++ b/mod/assign/tests/behat/group_submission.feature @@ -238,17 +238,25 @@ Feature: Group assignment submissions | grouping | group | | GG1 | G1 | | GG1 | G2 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment name | + | intro | Test assignment description | + | section | 1 | + | assignsubmission_onlinetext_enabled | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment name | - | Description | Test assignment description | - | assignsubmission_onlinetext_enabled | 1 | - | assignsubmission_file_enabled | 0 | + And I follow "Test assignment name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Students submit in groups | Yes | | Grouping for student groups | Grouping 1 | | Group mode | Separate groups | | Require group to make submission | No | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -257,6 +265,8 @@ Feature: Group assignment submissions And I set the following fields to these values: | Online text | I'm the student's 1 submission | And I press "Save changes" + And I press "Submit assignment" + And I press "Continue" And I log out And I log in as "student3" And I am on "Course 1" course homepage @@ -265,6 +275,8 @@ Feature: Group assignment submissions And I set the following fields to these values: | Online text | I'm the student's 3 submission | And I press "Save changes" + And I press "Submit assignment" + And I press "Continue" And I log out And I log in as "student5" And I am on "Course 1" course homepage @@ -273,6 +285,8 @@ Feature: Group assignment submissions And I set the following fields to these values: | Online text | I'm the student's 5 submission | And I press "Save changes" + And I press "Submit assignment" + And I press "Continue" And I log out And I log in as "admin" And I am on "Course 1" course homepage @@ -313,18 +327,26 @@ Feature: Group assignment submissions | user | group | | student1 | G1 | | student2 | G1 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment name | + | intro | Test assignment description | + | section | 1 | + | assignsubmission_onlinetext_enabled | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment name | - | Description | Test assignment description | - | assignsubmission_onlinetext_enabled | 1 | - | assignsubmission_file_enabled | 0 | + And I follow "Test assignment name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Require students to click the submit button | Yes | | Students submit in groups | Yes | | Group mode | No groups | | Require group to make submission | No | | Require all group members submit | No | + And I press "Save and return to course" And I am on "Course 1" course homepage And I add the "Activities" block And I log out diff --git a/mod/book/tests/behat/create_chapters.feature b/mod/book/tests/behat/create_chapters.feature index 5dce6aa23d5..970ce181ef4 100644 --- a/mod/book/tests/behat/create_chapters.feature +++ b/mod/book/tests/behat/create_chapters.feature @@ -14,11 +14,11 @@ Feature: In a book, create chapters and sub chapters And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | book | Test book | A book about dreams! | C1 | book1 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Book" to section "1" and I fill the form with: - | Name | Test book | - | Description | A book about dreams! | Scenario: Create chapters and sub chapters and navigate between them Given I follow "Test book" diff --git a/mod/book/tests/behat/display_book_description.feature b/mod/book/tests/behat/display_book_description.feature index 08f977b7026..de4307e8b33 100644 --- a/mod/book/tests/behat/display_book_description.feature +++ b/mod/book/tests/behat/display_book_description.feature @@ -14,11 +14,11 @@ Feature: Display the book description in the book and optionally in the course And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | book | Test book | A book about dreams! | C1 | book1 | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Book" to section "1" and I fill the form with: - | Name | Test book | - | Description | A book about dreams! | + And I am on "Course 1" course homepage And I follow "Test book" And I should see "Add new chapter" And I set the following fields to these values: diff --git a/mod/book/tests/behat/edit_navigation_options.feature b/mod/book/tests/behat/edit_navigation_options.feature index 8b3480e4439..10a45af2127 100644 --- a/mod/book/tests/behat/edit_navigation_options.feature +++ b/mod/book/tests/behat/edit_navigation_options.feature @@ -15,13 +15,12 @@ Feature: In a book, change the navigation options | user | course | role | | teacher1 | C1 | editingteacher | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on Scenario: Change navigation options - Given I add a "Book" to section "1" and I fill the form with: - | Name | Test book | - | Description | A book about lorem ipsum | - | Style of navigation | TOC Only | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | section | navstyle | + | book | Test book | A book about lorem ipsum | C1 | book1 | 1 | 0 | + And I am on "Course 1" course homepage with editing mode on And I follow "Test book" And I should see "Add new chapter" And I set the following fields to these values: diff --git a/mod/book/tests/behat/reorganize_chapters.feature b/mod/book/tests/behat/reorganize_chapters.feature index e12c109d14c..be0c0883248 100644 --- a/mod/book/tests/behat/reorganize_chapters.feature +++ b/mod/book/tests/behat/reorganize_chapters.feature @@ -14,11 +14,11 @@ Feature: In a book, chapters and subchapters can be rearranged And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | book | Test book | A book about rearrangements! | C1 | book1 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Book" to section "1" and I fill the form with: - | Name | Test book | - | Description | A book about rearrangements! | And I follow "Test book" And I should see "Add new chapter" And I set the following fields to these values: diff --git a/mod/chat/tests/behat/chat_no_calendar_capabilities.feature b/mod/chat/tests/behat/chat_no_calendar_capabilities.feature index a9903493b4c..260b4684431 100644 --- a/mod/chat/tests/behat/chat_no_calendar_capabilities.feature +++ b/mod/chat/tests/behat/chat_no_calendar_capabilities.feature @@ -14,25 +14,31 @@ Feature: Chat with no calendar capabilites And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activity" exists: + | activity | chat | + | course | C1 | + | idnumber | 0001 | + | name | Test chat name | + | intro | Test chat description | + | section | 1 | And I log in as "admin" And I am on "Course 1" course homepage And I navigate to "Users > Permissions" in current page administration And I override the system permissions of "Teacher" role with: | capability | permission | | moodle/calendar:manageentries | Prohibit | - And I log out - - Scenario: Editing a chat - Given I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - When I add a "Chat" to section "1" and I fill the form with: - | Name of this chat room | Test chat name | - | Description | Test chat description | + And I am on "Course 1" course homepage + And I follow "Test chat name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Repeat/publish session times | No repeats - publish the specified time only | | id_chattime_day | 1 | | id_chattime_month | 1 | | id_chattime_year | 2017 | + And I press "Save and return to course" And I log out + + Scenario: Editing a chat When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I follow "Test chat name" diff --git a/mod/choice/tests/behat/add_choice.feature b/mod/choice/tests/behat/add_choice.feature index c748455d7a2..2cc42578069 100644 --- a/mod/choice/tests/behat/add_choice.feature +++ b/mod/choice/tests/behat/add_choice.feature @@ -16,14 +16,9 @@ Feature: Add choice activity | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | - And I log out + And the following "activities" exist: + | activity | name | intro | course | idnumber | option | section | + | choice | Choice name | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 | When I log in as "student1" And I am on "Course 1" course homepage And I choose "Option 1" from "Choice name" choice activity diff --git a/mod/choice/tests/behat/allow_preview.feature b/mod/choice/tests/behat/allow_preview.feature index 6a47ca94067..3e62026bb5c 100644 --- a/mod/choice/tests/behat/allow_preview.feature +++ b/mod/choice/tests/behat/allow_preview.feature @@ -16,15 +16,21 @@ Feature: Allow choice preview | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice name | + | intro | Choice Description | + | section | 1 | + | option | Option 1, Option 2 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on Scenario: Enable the choice preview option and view the activity as a student before the opening time - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | + And I follow "Choice name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | timeopen[enabled] | 1 | | timeclose[enabled] | 1 | | timeopen[day] | 30 | @@ -34,6 +40,7 @@ Feature: Allow choice preview | timeclose[month] | December | | timeclose[year] | 2037 | | Show preview | 1 | + And I press "Save and return to course" And I log out When I log in as "student1" And I am on "Course 1" course homepage diff --git a/mod/choice/tests/behat/block_editing.feature b/mod/choice/tests/behat/block_editing.feature index 2e2ec8e5103..70de2df758e 100644 --- a/mod/choice/tests/behat/block_editing.feature +++ b/mod/choice/tests/behat/block_editing.feature @@ -9,13 +9,16 @@ Feature: Editing choice block Given the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | + And the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice name 1 | + | intro | Choice Description 1 | + | section | 1 | + | option | Option 1, Option 2 | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name 1 | - | Description | Choice Description 1 | - | option[0] | Option 1 | - | option[1] | Option 2 | And I follow "Choice name 1" And I add the "Blog menu" block And I should see "View all entries about this Choice" @@ -40,13 +43,16 @@ Feature: Editing choice block | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice name 1 | + | intro | Choice Description 1 | + | section | 1 | + | option | Option 1, Option 2 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name 1 | - | Description | Choice Description 1 | - | option[0] | Option 1 | - | option[1] | Option 2 | And I follow "Choice name 1" And I add the "Blog menu" block And I should see "View all entries about this Choice" @@ -70,13 +76,16 @@ Feature: Editing choice block | user | course | role | | teacher1 | C1 | editingteacher | | teacher1 | C1 | student | + And the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice name 1 | + | intro | Choice Description 1 | + | section | 1 | + | option | Option 1, Option 2 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name 1 | - | Description | Choice Description 1 | - | option[0] | Option 1 | - | option[1] | Option 2 | And I follow "Choice name 1" And I add the "Blog menu" block And I should see "View all entries about this Choice" diff --git a/mod/choice/tests/behat/change_response.feature b/mod/choice/tests/behat/change_response.feature index 8e7a7bf6774..765285c7a5b 100644 --- a/mod/choice/tests/behat/change_response.feature +++ b/mod/choice/tests/behat/change_response.feature @@ -16,15 +16,15 @@ Feature: Teacher can choose whether to allow students to change their choice res | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | Allow choice to be updated | No | - | option[0] | Option 1 | - | option[1] | Option 2 | - And I log out + And the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice name | + | intro | Choice Description | + | section | 1 | + | option | Option 1, Option 2 | + | allowupdate | 0 | When I log in as "student1" And I am on "Course 1" course homepage And I choose "Option 1" from "Choice name" choice activity diff --git a/mod/choice/tests/behat/choice_availability.feature b/mod/choice/tests/behat/choice_availability.feature index 0ed93dbba96..039dea3d710 100644 --- a/mod/choice/tests/behat/choice_availability.feature +++ b/mod/choice/tests/behat/choice_availability.feature @@ -20,15 +20,18 @@ Feature: Restrict availability of the choice module to a deadline And I am on "Course 1" course homepage with editing mode on Scenario: Enable the choice activity with a start deadline in the future - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | section | + | choice | Choice name | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 | + And I am on "Course 1" course homepage + And I follow "Choice name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | timeopen[enabled] | 1 | | timeopen[day] | 30 | | timeopen[month] | December | | timeopen[year] | 2037 | + And I press "Save and return to course" And I log out When I log in as "student1" And I am on "Course 1" course homepage @@ -36,15 +39,18 @@ Feature: Restrict availability of the choice module to a deadline Then I should see "This activity is not available until" Scenario: Enable the choice activity with a start deadline in the past - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | section | + | choice | Choice name | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 | + And I am on "Course 1" course homepage + And I follow "Choice name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | timeopen[enabled] | 1 | | timeopen[day] | 30 | | timeopen[month] | December | | timeopen[year] | 2007 | + And I press "Save and return to course" And I log out When I log in as "student1" And I am on "Course 1" course homepage @@ -54,15 +60,18 @@ Feature: Restrict availability of the choice module to a deadline And "Save my choice" "button" should exist Scenario: Enable the choice activity with a end deadline in the future - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | section | + | choice | Choice name | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 | + And I am on "Course 1" course homepage + And I follow "Choice name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | timeclose[enabled] | 1 | | timeclose[day] | 30 | | timeclose[month] | December | | timeclose[year] | 2037 | + And I press "Save and return to course" And I log out When I log in as "student1" And I am on "Course 1" course homepage @@ -72,15 +81,18 @@ Feature: Restrict availability of the choice module to a deadline And "Save my choice" "button" should exist Scenario: Enable the choice activity with a end deadline in the past - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | section | + | choice | Choice name | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 | + And I am on "Course 1" course homepage + And I follow "Choice name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | timeclose[enabled] | 1 | | timeclose[day] | 30 | | timeclose[month] | December | | timeclose[year] | 2007 | + And I press "Save and return to course" And I log out When I log in as "student1" And I am on "Course 1" course homepage diff --git a/mod/choice/tests/behat/choice_no_calendar_capabilities.feature b/mod/choice/tests/behat/choice_no_calendar_capabilities.feature index 0f4554c7c78..e2422a7b85e 100644 --- a/mod/choice/tests/behat/choice_no_calendar_capabilities.feature +++ b/mod/choice/tests/behat/choice_no_calendar_capabilities.feature @@ -23,13 +23,14 @@ Feature: Choice with no calendar capabilites And I log out Scenario: Editing a choice + And the following "activities" exist: + | activity | name | intro | course | idnumber | option | section | + | choice | Test choice name | Test choice description | C1 | choice1 | Option 1, Option 2 | 1 | Given I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - When I add a "Choice" to section "1" and I fill the form with: - | Choice name | Test choice name | - | Description | Test choice description | - | option[0] | Option 1 | - | option[1] | Option 2 | + And I am on "Course 1" course homepage + And I follow "Test choice name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_timeopen_enabled | 1 | | id_timeopen_day | 1 | | id_timeopen_month | 1 | @@ -38,6 +39,7 @@ Feature: Choice with no calendar capabilites | id_timeclose_day | 1 | | id_timeclose_month | 2 | | id_timeclose_year | 2017 | + And I press "Save and return to course" And I log out When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on diff --git a/mod/choice/tests/behat/include_inactive.feature b/mod/choice/tests/behat/include_inactive.feature index 44219664218..b69b54ee329 100644 --- a/mod/choice/tests/behat/include_inactive.feature +++ b/mod/choice/tests/behat/include_inactive.feature @@ -20,18 +20,17 @@ Feature: Include responses from inactive users | student1 | C1 | student | | student2 | C1 | student | | student3 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on Scenario: Enable the choice include inactive option and check that responses from inactive students are visible - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | - | option[2] | Option 3 | - | Include responses from inactive/suspended users | Yes | - And I log out + Given the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice name | + | intro | Choice Description | + | section | 1 | + | option | Option 1, Option 2, Option 3 | + | includeinactive | 1 | And I log in as "student1" And I am on "Course 1" course homepage And I choose "Option 1" from "Choice name" choice activity @@ -82,14 +81,15 @@ Feature: Include responses from inactive users And I log out Scenario: Disable the choice include inactive option and check that responses from inactive students are not visible - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | - | option[2] | Option 3 | - | Include responses from inactive/suspended users | No | - And I log out + Given the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice name | + | intro | Choice Description | + | section | 1 | + | option | Option 1, Option 2, Option 3 | + | includeinactive | 0 | And I log in as "student1" And I am on "Course 1" course homepage And I choose "Option 1" from "Choice name" choice activity diff --git a/mod/choice/tests/behat/limit_responses.feature b/mod/choice/tests/behat/limit_responses.feature index 4804e220954..1c4df351134 100644 --- a/mod/choice/tests/behat/limit_responses.feature +++ b/mod/choice/tests/behat/limit_responses.feature @@ -20,19 +20,20 @@ Feature: Limit choice responses | student1 | C1 | student | | student2 | C1 | student | | student3 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | option | showavailable | limitanswers | + | choice | Choice name | Choice description | C1 | choice1 | Option 1, Option 2 | 1 | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | Limit the number of responses allowed | 1 | - | Show available spaces | 1 | - | option[0] | Option 1 | - | limit[0] | 1 | - | option[1] | Option 2 | + And I am on "Course 1" course homepage + And I follow "Choice name" + And I click on "Actions menu" "link" + And I follow "Edit settings" + And I set the field "Limit 1" to "1" + And I press "Save and display" And I log out When I log in as "student1" And I am on "Course 1" course homepage + And I follow "Choice name" And I choose "Option 1" from "Choice name" choice activity Then I should see "Your selection: Option 1" And I should see "Your choice has been saved" diff --git a/mod/choice/tests/behat/multiple_options.feature b/mod/choice/tests/behat/multiple_options.feature index 2efd12414bc..be13fe91126 100644 --- a/mod/choice/tests/behat/multiple_options.feature +++ b/mod/choice/tests/behat/multiple_options.feature @@ -16,15 +16,9 @@ Feature: Multiple option choice response | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | Allow more than one choice to be selected | Yes | - | option[0] | Option 1 | - | option[1] | Option 2 | - And I log out + And the following "activity" exist: + | activity | name | intro | course | idnumber | option | allowmultiple | + | choice | Choice name | Choice description | C1 | 00001 | Option 1, Option 2, Option 3 | 1 | When I log in as "student1" And I am on "Course 1" course homepage And I choose options "Option 1","Option 2" from "Choice name" choice activity @@ -45,20 +39,19 @@ Feature: Multiple option choice response | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | + And the following "activity" exist: + | activity | name | intro | course | idnumber | option | allowmultiple | showavailable | limitanswers | + | choice | Choice name | Choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 1 | 1 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | Allow more than one choice to be selected | Yes | - | Limit the number of responses allowed | 1 | - | Show available spaces | 1 | - | option[0] | Option 1 | - | limit[0] | 1 | - | option[1] | Option 2 | - | limit[1] | 1 | - | option[2] | Option 3 | - | limit[2] | 1 | + And I follow "Choice name" + And I click on "Actions menu" "link" + And I follow "Edit settings" + And I set the following fields to these values: + | Limit 1 | 1 | + | Limit 2 | 1 | + | Limit 3 | 1 | + And I press "Save and display" And I log out When I log in as "student1" And I am on "Course 1" course homepage diff --git a/mod/choice/tests/behat/my_home.feature b/mod/choice/tests/behat/my_home.feature index c5e89f118d9..d1fe29a95c8 100644 --- a/mod/choice/tests/behat/my_home.feature +++ b/mod/choice/tests/behat/my_home.feature @@ -16,13 +16,14 @@ Feature: Test the display of the choice module on my home | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | option | section | + | choice | Test choice name | Test choice description | C1 | choice1 | Option 1, Option 2 | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Choice" to section "1" - And I expand all fieldsets + And I am on "Course 1" course homepage + And I follow "Test choice name" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: - | Choice name | Test choice name | - | Description | Test choice description | | timeopen[enabled] | 1 | | timeclose[enabled] | 1 | | timeclose[day] | 1 | @@ -31,8 +32,6 @@ Feature: Test the display of the choice module on my home | timeclose[hour] | 08 | | timeclose[minute] | 00 | | Allow choice to be updated | No | - | option[0] | Option 1 | - | option[1] | Option 2 | And I press "Save and return to course" And I log out diff --git a/mod/choice/tests/behat/publish_info.feature b/mod/choice/tests/behat/publish_info.feature index db815c03e35..6b9ae22c5a8 100644 --- a/mod/choice/tests/behat/publish_info.feature +++ b/mod/choice/tests/behat/publish_info.feature @@ -17,15 +17,17 @@ Feature: A student can see how the results of the choice activity will be publis | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on Scenario: Results will not be published to the students - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | + | choice | Choice 1 | Choice description | C1 | choice1 | Option 1, Option 2 | + And I am on "Course 1" course homepage + And I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Publish results | Do not publish results to students | - | option[0] | Option 1 | - | option[1] | Option 2 | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -33,13 +35,16 @@ Feature: A student can see how the results of the choice activity will be publis Then I should see "The results of this activity will not be published after you answer." Scenario: Full results will be shown to the students after they answer - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | - | Publish results | Show results to students after they answer | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | + | choice | Choice 1 | Choice description | C1 | choice1 | Option 1, Option 2 | + And I am on "Course 1" course homepage + When I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | Publish results | Show results to students after they answer | | Privacy of results | Publish full results, showing names and their choices | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -47,12 +52,14 @@ Feature: A student can see how the results of the choice activity will be publis Then I should see "Full results, showing everyone's choices, will be published after you answer." Scenario: Anonymous results will be shown to students after they answer - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | - | Publish results | Show results to students after they answer | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | + | choice | Choice 1 | Choice description | C1 | choice1 | Option 1, Option 2 | + And I am on "Course 1" course homepage + When I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the field "Publish results" to "Show results to students after they answer" + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -60,13 +67,15 @@ Feature: A student can see how the results of the choice activity will be publis Then I should see "Anonymous results will be published after you answer." Scenario: Full results will be shown to students only after the choice is closed - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | - | Publish results | Show results to students only after the choice is closed | - | Privacy of results | Publish full results, showing names and their choices | - | option[0] | Option 1 | - | option[1] | Option 2 | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | + | choice | Choice 1 | Choice description | C1 | choice1 | Option 1, Option 2 | + And I am on "Course 1" course homepage + When I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the field "Publish results" to "Show results to students only after the choice is closed" + And I set the field "Privacy of results" to "Publish full results, showing names and their choices" + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -74,12 +83,14 @@ Feature: A student can see how the results of the choice activity will be publis Then I should see "Full results, showing everyone's choices, will be published after the activity is closed." Scenario: Anonymous results will be shown to students only after the choice is closed - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | - | Publish results | Show results to students only after the choice is closed | - | option[0] | Option 1 | - | option[1] | Option 2 | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | + | choice | Choice 1 | Choice description | C1 | choice1 | Option 1, Option 2 | + And I am on "Course 1" course homepage + When I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the field "Publish results" to "Show results to students only after the choice is closed" + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -87,12 +98,14 @@ Feature: A student can see how the results of the choice activity will be publis Then I should see "Anonymous results will be published after the activity is closed." Scenario: Results will always be shown to students - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | - | Publish results | Always show results to students | + And the following "activities" exist: + | activity | name | intro | course | idnumber | option | + | choice | Choice 1 | Choice description | C1 | choice1 | Option 1, Option 2 | + And I am on "Course 1" course homepage + When I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the field "Publish results" to "Always show results to students" + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage diff --git a/mod/choice/tests/behat/publish_results.feature b/mod/choice/tests/behat/publish_results.feature index b35430d7719..989af1f46cd 100644 --- a/mod/choice/tests/behat/publish_results.feature +++ b/mod/choice/tests/behat/publish_results.feature @@ -20,12 +20,20 @@ Feature: A teacher can choose one of 4 options for publishing choice results And I am on "Course 1" course homepage with editing mode on Scenario: Do not publish results to students - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | + Given the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice 1 | + | intro | Choice Description | + | section | 1 | + | option | Option 1, Option 2 | + And I am on "Course 1" course homepage + And I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Publish results | Do not publish results to students | - | option[0] | Option 1 | - | option[1] | Option 2 | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -35,12 +43,20 @@ Feature: A teacher can choose one of 4 options for publishing choice results And I should not see "Graph display" Scenario: Show results to students after they answer - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | + Given the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice 1 | + | intro | Choice Description | + | section | 1 | + | option | Option 1, Option 2 | + And I am on "Course 1" course homepage + And I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Publish results | Show results to students after they answer | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -52,12 +68,20 @@ Feature: A teacher can choose one of 4 options for publishing choice results And I should see "Responses" Scenario: Show results to students only after the choice is closed - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | + Given the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice 1 | + | intro | Choice Description | + | section | 1 | + | option | Option 1, Option 2 | + And I am on "Course 1" course homepage + And I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Publish results | Show results to students only after the choice is closed | - | option[0] | Option 1 | - | option[1] | Option 2 | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -87,12 +111,20 @@ Feature: A teacher can choose one of 4 options for publishing choice results And I should see "Responses" Scenario: Always show results to students - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | + Given the following "activity" exists: + | activity | choice | + | course | C1 | + | idnumber | choice1 | + | name | Choice 1 | + | intro | Choice Description | + | section | 1 | + | option | Option 1, Option 2 | + And I am on "Course 1" course homepage + And I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Publish results | Always show results to students | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage diff --git a/mod/choice/tests/behat/publish_results_anonymously.feature b/mod/choice/tests/behat/publish_results_anonymously.feature index 08474d7d031..f73c2e90028 100644 --- a/mod/choice/tests/behat/publish_results_anonymously.feature +++ b/mod/choice/tests/behat/publish_results_anonymously.feature @@ -19,16 +19,18 @@ Feature: A teacher can choose whether to publish choice activity results anonymo | student1 | C1 | student | | student2 | C1 | student | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on Scenario: Publish anonymous results - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | section | + | choice | Choice 1 | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 | + And I am on "Course 1" course homepage + And I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Publish results | Always show results to students | | Privacy of results | Publish anonymous results, do not show student names | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -41,13 +43,16 @@ Feature: A teacher can choose whether to publish choice activity results anonymo And I should not see "Users who chose this option" Scenario: Publish full results - Given I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice 1 | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | option | section | + | choice | Choice 1 | Choice Description | C1 | choice1 | Option 1, Option 2 | 1 | + And I am on "Course 1" course homepage + And I follow "Choice 1" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Publish results | Always show results to students | | Privacy of results | Publish full results, showing names and their choices | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage diff --git a/mod/choice/tests/behat/remove_choice_options.feature b/mod/choice/tests/behat/remove_choice_options.feature index fa9d6d6f03d..13417bb7406 100644 --- a/mod/choice/tests/behat/remove_choice_options.feature +++ b/mod/choice/tests/behat/remove_choice_options.feature @@ -18,15 +18,9 @@ Feature: Update a choice activity removing options | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Choice" to section "1" and I fill the form with: - | Choice name | Choice name | - | Description | Choice Description | - | option[0] | Option 1 | - | option[1] | Option 2 | - | option[2] | Option 3 | - And I log out + And the following "activities" exist: + | activity | name | intro | course | idnumber | option | section | + | choice | Choice name | Choice Description | C1 | choice1 | Option 1, Option 2, Option 3 | 1 | And I log in as "student1" And I am on "Course 1" course homepage And I choose "Option 3" from "Choice name" choice activity diff --git a/mod/data/tests/behat/data_no_calendar_capabilities.feature b/mod/data/tests/behat/data_no_calendar_capabilities.feature index 98d7d490311..ec001ebfa1c 100644 --- a/mod/data/tests/behat/data_no_calendar_capabilities.feature +++ b/mod/data/tests/behat/data_no_calendar_capabilities.feature @@ -24,10 +24,13 @@ Feature: Database with no calendar capabilites Scenario: Editing a database Given I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - When I add a "Database" to section "1" and I fill the form with: - | Name | Test database name | - | Description | Test database description | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | data | Test database name | Test database description | C1 | 1 | data1 | + And I am on "Course 1" course homepage + And I follow "Test database name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_timeavailablefrom_enabled | 1 | | id_timeavailablefrom_day | 1 | | id_timeavailablefrom_month | 1 | @@ -44,6 +47,7 @@ Feature: Database with no calendar capabilites | id_timeviewto_day | 1 | | id_timeviewto_month | 4 | | id_timeviewto_year | 2017 | + And I press "Save and return to course" And I log out When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on diff --git a/mod/feedback/tests/behat/feedback_no_calendar_capabilities.feature b/mod/feedback/tests/behat/feedback_no_calendar_capabilities.feature index bf348ad2c7a..b03ff5b1128 100644 --- a/mod/feedback/tests/behat/feedback_no_calendar_capabilities.feature +++ b/mod/feedback/tests/behat/feedback_no_calendar_capabilities.feature @@ -23,11 +23,14 @@ Feature: Feedback with no calendar capabilites And I log out Scenario: Editing a feedback - Given I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - When I add a "Feedback" to section "1" and I fill the form with: - | Name | Test feedback name | - | Description | Test feedback description | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | + | feedback | Test feedback name | Test feedback description | C1 | feedback1 | + And I log in as "admin" + And I am on "Course 1" course homepage + And I follow "Test feedback name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_timeopen_enabled | 1 | | id_timeopen_day | 1 | | id_timeopen_month | 1 | @@ -36,6 +39,7 @@ Feature: Feedback with no calendar capabilites | id_timeclose_day | 1 | | id_timeclose_month | 2 | | id_timeclose_year | 2017 | + And I press "Save and return to course" And I log out When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on diff --git a/mod/forum/tests/behat/discussion_subscriptions.feature b/mod/forum/tests/behat/discussion_subscriptions.feature index 2ba4f0a707b..31b02d8bbae 100644 --- a/mod/forum/tests/behat/discussion_subscriptions.feature +++ b/mod/forum/tests/behat/discussion_subscriptions.feature @@ -289,12 +289,11 @@ Feature: A user can control their own subscription preferences for a discussion 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 + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | type | + | forum | Test forum name | Test forum description | Acceptance test site | 1 | forum1 | general | + And I am on site homepage And I turn editing mode on - 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: | Subject | Test post subject one | | Message | Test post message one | @@ -308,12 +307,11 @@ Feature: A user can control their own subscription preferences for a discussion And "Unsubscribe from this discussion" "checkbox" 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 + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | type | + | forum | Test forum name | Test forum description | Acceptance test site | 1 | forum1 | general | + And I am on site homepage And I turn editing mode on - 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: | Subject | Test post subject one | | Message | Test post message one | diff --git a/mod/forum/tests/behat/edit_post_teacher.feature b/mod/forum/tests/behat/edit_post_teacher.feature index 5afcd968630..4875a8d648c 100644 --- a/mod/forum/tests/behat/edit_post_teacher.feature +++ b/mod/forum/tests/behat/edit_post_teacher.feature @@ -16,11 +16,11 @@ Feature: Teachers can edit or delete any forum post | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | forum | Test forum name | Test forum description | C1 | 1 | forum1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | + And I am on "Course 1" course homepage And I add a new discussion to "Test forum name" forum with: | Subject | Teacher post subject | | Message | Teacher post message | diff --git a/mod/forum/tests/behat/forum_subscriptions.feature b/mod/forum/tests/behat/forum_subscriptions.feature index 74ad6b09b87..85c0c8210fd 100644 --- a/mod/forum/tests/behat/forum_subscriptions.feature +++ b/mod/forum/tests/behat/forum_subscriptions.feature @@ -15,14 +15,22 @@ Feature: A user can control their own subscription preferences for a forum | user | course | role | | student1 | C1 | student | And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on Scenario: A disallowed subscription forum cannot be subscribed to - Given 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 | + Given the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | forum1 | + | name | Test forum name | + | intro | Test forum description | + | type | general | + | section | 1 | + And I am on "Course 1" course homepage + Given I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Subscription mode | Subscription disabled | + And I press "Save and return to course" And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | @@ -36,11 +44,20 @@ Feature: A user can control their own subscription preferences for a forum And "You are not subscribed to this discussion. Click to subscribe." "link" should not exist in the "Test post subject" "table_row" Scenario: A forced subscription forum cannot be subscribed to - Given 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 | + Given the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | forum1 | + | name | Test forum name | + | intro | Test forum description | + | type | general | + | section | 1 | + And I am on "Course 1" course homepage + Given I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Subscription mode | Forced subscription | + And I press "Save and return to course" And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | @@ -54,11 +71,20 @@ Feature: A user can control their own subscription preferences for a forum And "You are not subscribed to this discussion. Click to subscribe." "link" should not exist in the "Test post subject" "table_row" Scenario: An optional forum can be subscribed to - Given 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 | + Given the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | forum1 | + | name | Test forum name | + | intro | Test forum description | + | type | general | + | section | 1 | + And I am on "Course 1" course homepage + Given I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Subscription mode | Optional subscription | + And I press "Save and return to course" And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | @@ -74,11 +100,20 @@ Feature: A user can control their own subscription preferences for a forum And I should not see "Subscribe to this forum" Scenario: An Automatic forum can be unsubscribed from - Given 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 | + Given the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | forum1 | + | name | Test forum name | + | intro | Test forum description | + | type | general | + | section | 1 | + And I am on "Course 1" course homepage + Given I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Subscription mode | Auto subscription | + And I press "Save and return to course" And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | diff --git a/mod/forum/tests/behat/forum_subscriptions_availability.feature b/mod/forum/tests/behat/forum_subscriptions_availability.feature index 770f4332fe7..1d8deba5dae 100644 --- a/mod/forum/tests/behat/forum_subscriptions_availability.feature +++ b/mod/forum/tests/behat/forum_subscriptions_availability.feature @@ -64,12 +64,21 @@ Feature: As a teacher I need to see an accurate list of subscribed users And I should not see "Student 3" Scenario: A forced forum does not allow to edit the subscribers - When I add a "Forum" to section "1" and I fill the form with: - | Forum name | Forced Forum 2 | - | Forum type | Standard forum for general use | - | Description | Test forum description | + Given the following "activity" exists: + | activity | forum | + | name | Forced Forum 2 | + | intro | Test forum description | + | type | general | + | course | C1 | + | idnumber | 0001 | + | section | 1 | + And I am on "Course 1" course homepage + And I follow "Forced Forum 2" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Subscription mode | Forced subscription | | Availability | Show on course page | + And I press "Save and return to course" And I follow "Forced Forum 2" And I navigate to "Show/edit current subscribers" in current page administration Then I should see "Teacher Teacher" @@ -79,12 +88,21 @@ Feature: As a teacher I need to see an accurate list of subscribed users And I should not see "Manage subscribers" Scenario: A forced and hidden forum lists only teachers - When I add a "Forum" to section "1" and I fill the form with: - | Forum name | Forced Forum 2 | - | Forum type | Standard forum for general use | - | Description | Test forum description | + Given the following "activity" exists: + | activity | forum | + | name | Forced Forum 2 | + | intro | Test forum description | + | type | general | + | course | C1 | + | idnumber | 0001 | + | section | 1 | + And I am on "Course 1" course homepage + And I follow "Forced Forum 2" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Subscription mode | Forced subscription | | Availability | Hide from students | + And I press "Save and return to course" And I follow "Forced Forum 2" And I navigate to "Show/edit current subscribers" in current page administration Then I should see "Teacher Teacher" diff --git a/mod/forum/tests/behat/forum_subscriptions_default.feature b/mod/forum/tests/behat/forum_subscriptions_default.feature index 637e8b397f5..07b898e972a 100644 --- a/mod/forum/tests/behat/forum_subscriptions_default.feature +++ b/mod/forum/tests/behat/forum_subscriptions_default.feature @@ -16,16 +16,20 @@ Feature: A user can control their default discussion subscription settings | user | course | role | | student1 | C1 | student | | student2 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | type | section | + | forum | Test forum name | Test forum description | C1 | forump1 | general | 1 | And I log in as "admin" + And I am on "Course 1" course homepage + And I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | Subscription mode | Optional subscription | + And I press "Save and return to course" And I am on "Course 1" course homepage with editing mode on Scenario: Creating a new discussion in an optional forum follows user preferences - Given 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 | - | Subscription mode | Optional subscription | - And I log out + Given I log out And I log in as "student1" And I am on "Course 1" course homepage And I follow "Test forum name" @@ -41,12 +45,7 @@ Feature: A user can control their default discussion subscription settings And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist Scenario: Replying to an existing discussion in an optional forum follows user preferences - Given 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 | - | Subscription mode | Optional subscription | - And I add a new discussion to "Test forum name" forum with: + Given I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | And I log out @@ -65,11 +64,11 @@ Feature: A user can control their default discussion subscription settings And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist Scenario: Creating a new discussion in an automatic forum follows forum subscription - Given 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 | + Given I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Subscription mode | Auto subscription | + And I press "Save and return to course" And I log out And I log in as "student1" And I am on "Course 1" course homepage @@ -86,11 +85,12 @@ Feature: A user can control their default discussion subscription settings And "input[name=discussionsubscribe][checked=checked]" "css_element" should exist Scenario: Replying to an existing discussion in an automatic forum follows forum subscription - Given 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 | + Given I am on "Course 1" course homepage + And I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Subscription mode | Optional subscription | + And I press "Save and return to course" And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | @@ -111,11 +111,11 @@ Feature: A user can control their default discussion subscription settings @javascript Scenario: Replying to an existing discussion in an automatic forum which has been unsubscribed from follows user preferences - Given 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 | + Given I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Subscription mode | Auto subscription | + And I press "Save and return to course" And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | diff --git a/mod/forum/tests/behat/forum_subscriptions_management.feature b/mod/forum/tests/behat/forum_subscriptions_management.feature index 9a21ffaa4ef..2f117fafe23 100644 --- a/mod/forum/tests/behat/forum_subscriptions_management.feature +++ b/mod/forum/tests/behat/forum_subscriptions_management.feature @@ -18,13 +18,19 @@ Feature: A teacher can control the subscription to a forum | teacher | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | f01 | + | intro | Test forum description | + | name | Test forum name | And I log in as "teacher" - And I am on "Course 1" course homepage with editing mode on - 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 | - | Subscription mode | Auto subscription | + And I am on "Course 1" course homepage + And I follow "Test forum name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | Subscription mode | Auto subscription | + And I press "Save and return to course" Scenario: A teacher can change toggle subscription editing on and off Given I follow "Test forum name" diff --git a/mod/forum/tests/behat/grade_forum.feature b/mod/forum/tests/behat/grade_forum.feature index adc10362cd9..3b40afd483d 100644 --- a/mod/forum/tests/behat/grade_forum.feature +++ b/mod/forum/tests/behat/grade_forum.feature @@ -131,13 +131,17 @@ Feature: I can grade a students interaction across a forum And I should see "Tutor" in the "Parent category" "fieldset" Scenario: Setting both a rating and a whole forum grade does not bleed - Given I add a "Forum" to section "1" - And I expand all fieldsets - And I set the following fields to these values: - | Forum name | Test Forum 1 | - | Description | Test | - - When I set the field "Ratings > Aggregate type" to "Count of ratings" + Given the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 0001 | + | name | Test Forum 1 | + | intro | Test | + | section | 1 | + And I am on "Course 1" course homepage + And I follow "Test Forum 1" + And I navigate to "Edit settings" in current page administration + And I set the field "Ratings > Aggregate type" to "Count of ratings" And I set the field "Ratings > Type" to "Point" And I set the field "Ratings > Maximum grade" to "100" And I set the field "Ratings > Grade category" to "Peers" diff --git a/mod/forum/tests/behat/separate_group_single_group_discussions.feature b/mod/forum/tests/behat/separate_group_single_group_discussions.feature index c7d53359859..9a3e7b27b90 100644 --- a/mod/forum/tests/behat/separate_group_single_group_discussions.feature +++ b/mod/forum/tests/behat/separate_group_single_group_discussions.feature @@ -38,21 +38,10 @@ Feature: Posting to groups in a separate group discussion when restricted to gro | G1 | G1G1 | | G1 | G1G2 | | G2 | G2G1 | - And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Multiple groups forum | - | Forum type | Standard forum for general use | - | Description | Standard forum description | - | Group mode | Separate groups | - | Grouping | G1 | - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Single groups forum | - | Forum type | Standard forum for general use | - | Description | Standard forum description | - | Group mode | Separate groups | - | Grouping | G2 | - And I log out + And the following "activities" exist: + | activity | course | idnumber | name | intro | type | section | groupmode | grouping | + | forum | C1 | 00001 | Multiple groups forum | Standard forum description | general | 1 | 1 | G1 | + | forum | C1 | 00001 | Single groups forum | Standard forum description | general | 1 | 1 | G2 | Scenario: Teacher with accessallgroups can post in all groups Given I log in as "teacher1" diff --git a/mod/forum/tests/behat/split_forum_discussion.feature b/mod/forum/tests/behat/split_forum_discussion.feature index 0cbd00dcf33..51e8a4efb47 100644 --- a/mod/forum/tests/behat/split_forum_discussion.feature +++ b/mod/forum/tests/behat/split_forum_discussion.feature @@ -18,12 +18,11 @@ Feature: Forum discussions can be split | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | type | + | forum | Study discussions | Forum to discuss your coursework. | C1 | forump1 | general | And I log in as "teacher1" - And I am on "Science 101" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Study discussions | - | Forum type | Standard forum for general use | - | Description | Forum to discuss your coursework. | + And I am on "Science 101" course homepage And I add a new discussion to "Study discussions" forum with: | Subject | Photosynthesis discussion | | Message | Lets discuss our learning about Photosynthesis this week in this thread. | diff --git a/mod/forum/tests/behat/timed_discussions.feature b/mod/forum/tests/behat/timed_discussions.feature index 406fa615eac..2e238790b89 100644 --- a/mod/forum/tests/behat/timed_discussions.feature +++ b/mod/forum/tests/behat/timed_discussions.feature @@ -14,13 +14,13 @@ Feature: Users can choose to set start and end time for display of their discuss And the following "course enrolments" exist: | user | course | role | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | type | + | forum | Test forum name | Test forum description | C1 | forump1 | general | And I log in as "admin" And the following config values are set as admin: | forum_enabletimedposts | 1 | - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | + And I am on "Course 1" course homepage And I add a new discussion to "Test forum name" forum with: | Subject | Discussion 1 | | Message | Discussion contents 1, first message | diff --git a/mod/forum/tests/behat/track_read_posts.feature b/mod/forum/tests/behat/track_read_posts.feature index 6787a2ae220..2b4ad1c4b64 100644 --- a/mod/forum/tests/behat/track_read_posts.feature +++ b/mod/forum/tests/behat/track_read_posts.feature @@ -17,14 +17,17 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos | student1 | C1 | student | | student2 | C1 | student | And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on Scenario: Tracking forum posts off - Given 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 | - | Read tracking | Off | + Given the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | Test forum name | + | intro | Test forum description | + | section | 1 | + | trackingtype | 0 | + And I am on "Course 1" course homepage And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | @@ -36,11 +39,16 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos And I should not see "Track unread posts" Scenario: Tracking forum posts optional with user tracking on - Given 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 | - | Read tracking | Optional | + Given the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | Test forum name | + | intro | Test forum description | + | section | 1 | + | type | generalforum | + | trackingtype | 1 | + And I am on "Course 1" course homepage And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | @@ -61,11 +69,16 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos And I should not see "1 unread post" Scenario: Tracking forum posts optional with user tracking off - Given 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 | - | Read tracking | Optional | + Given the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | Test forum name | + | intro | Test forum description | + | section | 1 | + | type | generalforum | + | trackingtype | 1 | + And I am on "Course 1" course homepage And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | @@ -79,12 +92,16 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos Scenario: Tracking forum posts forced with user tracking on Given the following config values are set as admin: | forum_allowforcedreadtracking | 1 | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | Test forum name | + | intro | Test forum description | + | section | 1 | + | type | generalforum | + | trackingtype | 2 | And I am on "Course 1" course homepage - Given 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 | - | Read tracking | Force | And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | @@ -101,12 +118,16 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos Scenario: Tracking forum posts forced with user tracking off Given the following config values are set as admin: | forum_allowforcedreadtracking | 1 | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | Test forum name | + | intro | Test forum description | + | section | 1 | + | type | generalforum | + | trackingtype | 2 | And I am on "Course 1" course homepage - Given 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 | - | Read tracking | Force | And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | @@ -123,12 +144,16 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos Scenario: Tracking forum posts forced (with force disabled) with user tracking on Given the following config values are set as admin: | forum_allowforcedreadtracking | 1 | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | Test forum name | + | description | Test forum description | + | section | 1 | + | type | generalforum | + | trackingtype | 2 | And I am on "Course 1" course homepage - Given 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 | - | Read tracking | Force | And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | @@ -153,12 +178,16 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos Scenario: Tracking forum posts forced (with force disabled) with user tracking off Given the following config values are set as admin: | forum_allowforcedreadtracking | 1 | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 00001 | + | name | Test forum name | + | description | Test forum description | + | section | 1 | + | type | generalforum | + | trackingtype | 2 | And I am on "Course 1" course homepage - Given 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 | - | Read tracking | Force | And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject | | Message | Test post message | diff --git a/mod/glossary/tests/behat/entries_always_editable.feature b/mod/glossary/tests/behat/entries_always_editable.feature index 906b27f363d..d237e913813 100644 --- a/mod/glossary/tests/behat/entries_always_editable.feature +++ b/mod/glossary/tests/behat/entries_always_editable.feature @@ -16,15 +16,11 @@ Feature: A teacher can set whether glossary entries are always editable or not | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | editalways | + | glossary | Test glossary name | Test glossary description | C1 | glossary1 | 0 | And the following config values are set as admin: | maxeditingtime | 5 | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Glossary" to section "1" and I fill the form with: - | Name | Test glossary name | - | Description | Test glossary description | - | Always allow editing | No | - And I log out And I log in as "student1" And I am on "Course 1" course homepage And I follow "Test glossary name" diff --git a/mod/glossary/tests/behat/entries_require_approval.feature b/mod/glossary/tests/behat/entries_require_approval.feature index c47b8b1fb1c..6eb1f2c603a 100644 --- a/mod/glossary/tests/behat/entries_require_approval.feature +++ b/mod/glossary/tests/behat/entries_require_approval.feature @@ -18,13 +18,14 @@ Feature: A teacher can choose whether glossary entries require approval | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - Given I add a "Glossary" to section "1" and I fill the form with: - | Name | Test glossary name | - | Description | Test glossary entries require approval | - | Approved by default | No | - And I log out + And the following "activity" exists: + | activity | glossary | + | course | C1 | + | idnumber | 0001 | + | name | Test glossary name | + | intro | Test glossary entries require approval | + | section | 1 | + | defaultapproval | 0 | Scenario: Approve and undo approve glossary entries Given I log in as "student1" diff --git a/mod/h5pactivity/tests/behat/contentbank_link.feature b/mod/h5pactivity/tests/behat/contentbank_link.feature index dfcf5f17f76..bdccb1e93a2 100644 --- a/mod/h5pactivity/tests/behat/contentbank_link.feature +++ b/mod/h5pactivity/tests/behat/contentbank_link.feature @@ -28,6 +28,7 @@ Feature: Content bank link in the activity settings form And I should see "C1" in the "page-navbar" "region" And I close all opened windows + @javascript Scenario: Content bank is not displayed if the user don't have access to the content bank Given the following "permission overrides" exist: | capability | permission | role | contextlevel | reference | diff --git a/mod/lesson/tests/behat/all_other_answers_catch.feature b/mod/lesson/tests/behat/all_other_answers_catch.feature index 362386bc865..bfc0ad682d2 100644 --- a/mod/lesson/tests/behat/all_other_answers_catch.feature +++ b/mod/lesson/tests/behat/all_other_answers_catch.feature @@ -16,15 +16,23 @@ Feature: Numeric and short answer questions have a section to catch all other st | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + Given the following "activity" exists: + | activity | lesson | + | course | C1 | + | idnumber | 0001 | + | name | Test lesson name | + | intro | Test lesson description | + | section | 1 | + | maxattempts | 3 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" + And I am on "Course 1" course homepage + And I follow "Test lesson name" + When I navigate to "Edit settings" in current page administration + And I expand all fieldsets And I set the following fields to these values: - | Name | Test lesson name | - | Description | Test lesson description | | Provide option to try a question again | Yes | - | Maximum number of attempts | 3 | - And I press "Save and display" + And I press "Save and return to course" + And I follow "Test lesson name" Scenario: I can create a numerical question with an option to catch all student responses. Given I follow "Add a question page" diff --git a/mod/lesson/tests/behat/completion_condition_end_reached.feature b/mod/lesson/tests/behat/completion_condition_end_reached.feature index 0510e57b3ff..fc1c9b80410 100644 --- a/mod/lesson/tests/behat/completion_condition_end_reached.feature +++ b/mod/lesson/tests/behat/completion_condition_end_reached.feature @@ -16,18 +16,26 @@ Feature: Set end of lesson reached as a completion condition for a lesson | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + Given the following "activity" exists: + | activity | lesson | + | course | C1 | + | idnumber | 0001 | + | name | Test lesson | + | intro | Test lesson description | + | section | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save and display" - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson | - | Description | Test lesson description | - | Completion tracking | Show activity as complete when conditions are met | - | completionview | 0 | - | completionendreached | 1 | + And I follow "Test lesson" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | Completion tracking | Show activity as complete when conditions are met | + | completionview | 0 | + | completionendreached | 1 | + And I press "Save and return to course" And I follow "Test lesson" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/completion_condition_time_spent.feature b/mod/lesson/tests/behat/completion_condition_time_spent.feature index af392fff799..a47d80e6ae2 100644 --- a/mod/lesson/tests/behat/completion_condition_time_spent.feature +++ b/mod/lesson/tests/behat/completion_condition_time_spent.feature @@ -16,20 +16,28 @@ Feature: Set time spent as a completion condition for a lesson | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | lesson | + | course | C1 | + | idnumber | 0001 | + | name | Test lesson | + | intro | Test lesson description | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on + And I am on "Course 1" course homepage And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save and display" - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson | - | Description | Test lesson description | + And I follow "Test lesson" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Completion tracking | Show activity as complete when conditions are met | | completionview | 0 | | completiontimespentenabled | 1 | | completiontimespent[timeunit] | 1 | | completiontimespent[number] | 10 | + And I press "Save and return to course" + And I am on "Course 1" course homepage And I follow "Test lesson" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/date_availability.feature b/mod/lesson/tests/behat/date_availability.feature index dfdbda5fa09..c1b0ebac036 100644 --- a/mod/lesson/tests/behat/date_availability.feature +++ b/mod/lesson/tests/behat/date_availability.feature @@ -20,18 +20,20 @@ Feature: A teacher can set available from and deadline dates to access a lesson And I am on "Course 1" course homepage with editing mode on Scenario: Forbidding lesson accesses until a specified date - Given I add a "Lesson" to section "1" - And I expand all fieldsets + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | lesson | Test lesson | Test lesson description | C1 | 1 | lesson1 | + And I am on "Course 1" course homepage + And I follow "Test lesson" + And I navigate to "Edit settings" in current page administration And I set the field "id_available_enabled" to "1" And I set the following fields to these values: - | Name | Test lesson | - | Description | Test lesson description | | available[day] | 1 | | available[month] | January | | available[year] | 2030 | | available[hour] | 08 | | available[minute] | 00 | - And I press "Save and display" + And I press "Save and return to course" And I follow "Test lesson" And I follow "Add a content page" And I set the following fields to these values: @@ -47,17 +49,20 @@ Feature: A teacher can set available from and deadline dates to access a lesson And I should not see "First page contents" Scenario: Forbidding lesson accesses until a specified date - Given I add a "Lesson" to section "1" + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | lesson | Test lesson | Test lesson description | C1 | 1 | lesson1 | + And I am on "Course 1" course homepage + And I follow "Test lesson" + And I navigate to "Edit settings" in current page administration And I set the field "id_deadline_enabled" to "1" And I set the following fields to these values: - | Name | Test lesson | - | Description | Test lesson description | | deadline[day] | 1 | | deadline[month] | January | | deadline[year] | 2000 | | deadline[hour] | 08 | | deadline[minute] | 00 | - And I press "Save and display" + And I press "Save and return to course" And I follow "Test lesson" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/display_lesson_description.feature b/mod/lesson/tests/behat/display_lesson_description.feature index 07b35409e6e..877002bc1b7 100644 --- a/mod/lesson/tests/behat/display_lesson_description.feature +++ b/mod/lesson/tests/behat/display_lesson_description.feature @@ -14,13 +14,14 @@ Feature: Display the lesson description in the lesson and optionally in the cour And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + Given the following "activity" exists: + | activity | lesson | + | course | C1 | + | idnumber | 0001 | + | name | Test lesson name | + | intro | Test lesson description | + | section | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" - And I set the following fields to these values: - | Name | Test lesson | - | Description | Test lesson description | - And I click on "Save and display" "button" Scenario: Description is displayed in the Lesson Given I am on "Course 1" course homepage diff --git a/mod/lesson/tests/behat/lesson_complete_report.feature b/mod/lesson/tests/behat/lesson_complete_report.feature index 8dd0cb39b0c..052015f2737 100644 --- a/mod/lesson/tests/behat/lesson_complete_report.feature +++ b/mod/lesson/tests/behat/lesson_complete_report.feature @@ -15,14 +15,11 @@ Feature: Teachers can review student progress on all lessons in a course by view | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | retake | + | lesson | Test lesson name | Test lesson description | C1 | lesson1 | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" - And I set the following fields to these values: - | Name | Test lesson name | - | Description | Test lesson description | - | Re-takes allowed | Yes | - And I press "Save and return to course" + And I am on "Course 1" course homepage And I follow "Test lesson name" Scenario: View student progress for lesson that was never attempted diff --git a/mod/lesson/tests/behat/lesson_delete_answers.feature b/mod/lesson/tests/behat/lesson_delete_answers.feature index 37e9ddf9ba4..fabb22c608b 100644 --- a/mod/lesson/tests/behat/lesson_delete_answers.feature +++ b/mod/lesson/tests/behat/lesson_delete_answers.feature @@ -17,11 +17,11 @@ branch table contents | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | lesson | Test lesson name | Test lesson description | C1 | lesson1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | + And I am on "Course 1" course homepage And I follow "Test lesson name" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/lesson_edit_cluster.feature b/mod/lesson/tests/behat/lesson_edit_cluster.feature index 58c72091b6a..13415cabb9f 100644 --- a/mod/lesson/tests/behat/lesson_edit_cluster.feature +++ b/mod/lesson/tests/behat/lesson_edit_cluster.feature @@ -16,11 +16,11 @@ Feature: In a lesson activity, teacher can edit a cluster page | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | lesson | Lesson with cluster | Test lesson description | C1 | lesson1 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Lesson with cluster | - | Description | Test lesson description | And I follow "Lesson with cluster" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/lesson_edit_pages.feature b/mod/lesson/tests/behat/lesson_edit_pages.feature index 188a6287c45..1d141b09895 100644 --- a/mod/lesson/tests/behat/lesson_edit_pages.feature +++ b/mod/lesson/tests/behat/lesson_edit_pages.feature @@ -16,11 +16,11 @@ Feature: In a lesson activity, teacher can edit lesson's pages | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | lesson | Test lesson name | Test lesson description | C1 | lesson1 | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | + And I am on "Course 1" course homepage And I follow "Test lesson name" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/lesson_essay_question.feature b/mod/lesson/tests/behat/lesson_essay_question.feature index e44d8532196..beabb309399 100644 --- a/mod/lesson/tests/behat/lesson_essay_question.feature +++ b/mod/lesson/tests/behat/lesson_essay_question.feature @@ -15,12 +15,11 @@ Feature: In a lesson activity, teacher can add an essay question | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | feedback | + | lesson | Test lesson name | Test lesson description | C1 | lesson1 | 1 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | - | Use default feedback | Yes | And I follow "Test lesson name" And I follow "Add a question page" And I set the field "Select a question type" to "Essay" diff --git a/mod/lesson/tests/behat/lesson_exit_enter_clusters.feature b/mod/lesson/tests/behat/lesson_exit_enter_clusters.feature index 216a95e0900..1183d6aa2b9 100644 --- a/mod/lesson/tests/behat/lesson_exit_enter_clusters.feature +++ b/mod/lesson/tests/behat/lesson_exit_enter_clusters.feature @@ -15,11 +15,11 @@ Feature: In a lesson activity, students can exit and re-enter the activity when | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | lesson | Lesson with cluster | Cluster lesson description | C1 | lesson1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Lesson with cluster | - | Description | Cluster lesson description | And I follow "Lesson with cluster" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/lesson_informations_at_end.feature b/mod/lesson/tests/behat/lesson_informations_at_end.feature index 07a3c7d629c..6ea79647f99 100644 --- a/mod/lesson/tests/behat/lesson_informations_at_end.feature +++ b/mod/lesson/tests/behat/lesson_informations_at_end.feature @@ -14,12 +14,16 @@ Feature: In a lesson activity, if custom scoring is not enabled, student should | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | lesson | Test lesson name | Test lesson description | C1 | 1 | lesson1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | + And I am on "Course 1" course homepage + And I follow "Test lesson name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Custom scoring | No | + And I press "Save and return to course" And I follow "Test lesson name" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/lesson_navigation.feature b/mod/lesson/tests/behat/lesson_navigation.feature index 2a88e51d69e..cc8380be3a1 100644 --- a/mod/lesson/tests/behat/lesson_navigation.feature +++ b/mod/lesson/tests/behat/lesson_navigation.feature @@ -17,12 +17,12 @@ Feature: In a lesson activity, students can navigate through a series of pages i | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on Scenario: Student navigation with pages and questions - Given I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | + | lesson | Test lesson name | Test lesson description | C1 | lesson1 | + And I am on "Course 1" course homepage And I follow "Test lesson name" And I follow "Add a content page" And I set the following fields to these values: @@ -88,11 +88,16 @@ Feature: In a lesson activity, students can navigate through a series of pages i And I should see "Your score is 0 (out of 1)." Scenario: Student reattempts a question until out of attempts - Given I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | + | lesson | Test lesson name | Test lesson description | C1 | lesson1 | + And I am on "Course 1" course homepage + And I follow "Test lesson name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_review | Yes | | id_maxattempts | 3 | + And I press "Save and return to course" And I follow "Test lesson name" And I follow "Add a question page" And I set the following fields to these values: @@ -129,11 +134,16 @@ Feature: In a lesson activity, students can navigate through a series of pages i And I should see "Congratulations - end of lesson reached" Scenario: Student should not see remaining attempts notification if maximum number of attempts is set to unlimited - Given I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | + | lesson | Test lesson name | Test lesson description | C1 | lesson1 | + And I am on "Course 1" course homepage + And I follow "Test lesson name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_review | Yes | | id_maxattempts | 0 | + And I press "Save and return to course" And I follow "Test lesson name" And I follow "Add a question page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/lesson_no_calendar_capabilities.feature b/mod/lesson/tests/behat/lesson_no_calendar_capabilities.feature index 80e5cf8f381..3568d7d0984 100644 --- a/mod/lesson/tests/behat/lesson_no_calendar_capabilities.feature +++ b/mod/lesson/tests/behat/lesson_no_calendar_capabilities.feature @@ -14,6 +14,13 @@ Feature: Lesson with no calendar capabilites And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + Given the following "activity" exists: + | activity | lesson | + | course | C1 | + | idnumber | 0001 | + | name | Test lesson name | + | intro | Test lesson description | + | section | 1 | And I log in as "admin" And I am on "Course 1" course homepage And I navigate to "Users > Permissions" in current page administration @@ -25,9 +32,9 @@ Feature: Lesson with no calendar capabilites Scenario: Editing a lesson Given I log in as "admin" And I am on "Course 1" course homepage with editing mode on - When I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | + And I follow "Test lesson name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_available_enabled | 1 | | id_available_day | 1 | | id_available_month | 1 | @@ -36,6 +43,7 @@ Feature: Lesson with no calendar capabilites | id_deadline_day | 1 | | id_deadline_month | 2 | | id_deadline_year | 2017 | + And I press "Save and return to course" And I log out When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on diff --git a/mod/lesson/tests/behat/lesson_number_of_student_attempts.feature b/mod/lesson/tests/behat/lesson_number_of_student_attempts.feature index a3a732f824e..730faaa5a0d 100644 --- a/mod/lesson/tests/behat/lesson_number_of_student_attempts.feature +++ b/mod/lesson/tests/behat/lesson_number_of_student_attempts.feature @@ -19,21 +19,27 @@ Feature: In Dashboard, teacher can see the number of student attempts to lessons | student1 | C1 | student | | student2 | C1 | student | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on Scenario: number of student attempts - Given I add a "Lesson" to section "1" + Given the following "activity" exists: + | activity | lesson | + | course | C1 | + | idnumber | 0001 | + | name | Test lesson name | + | intro | Test lesson description | + | retake | 1 | + | section | 1 | + And I am on "Course 1" course homepage + And I follow "Test lesson name" + When I navigate to "Edit settings" in current page administration And I expand all fieldsets And I set the following fields to these values: - | Name | Test lesson name | - | Description | Test lesson description | | id_deadline_enabled | 1 | | deadline[day] | 1 | | deadline[month] | January | | deadline[year] | 2030 | | deadline[hour] | 08 | | deadline[minute] | 00 | - | Re-takes allowed | Yes | And I press "Save and return to course" And I follow "Test lesson name" And I follow "Add a question page" diff --git a/mod/lesson/tests/behat/lesson_numerical_question_with_locale.feature b/mod/lesson/tests/behat/lesson_numerical_question_with_locale.feature index a3daa905bf0..a226dcc9eb3 100644 --- a/mod/lesson/tests/behat/lesson_numerical_question_with_locale.feature +++ b/mod/lesson/tests/behat/lesson_numerical_question_with_locale.feature @@ -16,12 +16,11 @@ Feature: In a lesson activity, I need to edit pages in the lesson taking into ac And the following "language customisations" exist: | component | stringid | value | | core_langconfig | decsep | # | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | modattempts | + | lesson | Test lesson name | Test lesson description | C1 | lesson1 | 1 | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | - | Allow student review | Yes | + And I am on "Course 1" course homepage And I follow "Test lesson name" And I follow "Add a question page" And I set the field "Select a question type" to "Numerical" diff --git a/mod/lesson/tests/behat/lesson_outline_report.feature b/mod/lesson/tests/behat/lesson_outline_report.feature index c4eea60cd58..a852831acca 100644 --- a/mod/lesson/tests/behat/lesson_outline_report.feature +++ b/mod/lesson/tests/behat/lesson_outline_report.feature @@ -15,14 +15,15 @@ Feature: Teachers can review student progress on all lessons in a course by view | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | lesson | + | course | C1 | + | idnumber | 0001 | + | name | Test lesson name | + | intro | Test lesson description | + | retake | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" - And I set the following fields to these values: - | Name | Test lesson name | - | Description | Test lesson description | - | Re-takes allowed | Yes | - And I press "Save and return to course" + And I am on "Course 1" course homepage And I follow "Test lesson name" Scenario: View student progress for lesson that was never attempted diff --git a/mod/lesson/tests/behat/lesson_practice.feature b/mod/lesson/tests/behat/lesson_practice.feature index ed7307fdfe6..c5335f79a41 100644 --- a/mod/lesson/tests/behat/lesson_practice.feature +++ b/mod/lesson/tests/behat/lesson_practice.feature @@ -16,12 +16,15 @@ Feature: Practice mode in a lesson activity | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | lesson | + | course | C1 | + | idnumber | 0001 | + | name | Test lesson name | + | intro | Lesson description | + | section | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with 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" diff --git a/mod/lesson/tests/behat/lesson_progress_bar.feature b/mod/lesson/tests/behat/lesson_progress_bar.feature index 8cdc5773b0a..7f081fd6b40 100644 --- a/mod/lesson/tests/behat/lesson_progress_bar.feature +++ b/mod/lesson/tests/behat/lesson_progress_bar.feature @@ -16,12 +16,16 @@ Feature: In a lesson activity, students can see their progress viewing a progres | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | lesson | Test lesson name | Test lesson description | C1 | 1 | lesson1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | + And I am on "Course 1" course homepage + And I follow "Test lesson name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Progress bar | Yes | + And I press "Save and return to course" And I follow "Test lesson name" And I follow "Add a content page" And I set the following fields to these values: @@ -39,7 +43,7 @@ Feature: In a lesson activity, students can see their progress viewing a progres | id_answer_editor_1 | Next page | | id_jumpto_1 | Next page | And I press "Save page" - And I follow "Expanded" + And I click on "Expanded" "link" in the "region-main" "region" And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][3]" "xpath_element" And I set the field "Select a question type" to "Numerical" And I press "Add a question page" diff --git a/mod/lesson/tests/behat/lesson_question_attempts.feature b/mod/lesson/tests/behat/lesson_question_attempts.feature index 9994f8acdc4..a98ab003593 100644 --- a/mod/lesson/tests/behat/lesson_question_attempts.feature +++ b/mod/lesson/tests/behat/lesson_question_attempts.feature @@ -15,15 +15,17 @@ Feature: In a lesson activity, students can not re-attempt a question more than | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | lesson | + | course | C1 | + | idnumber | 0001 | + | name | Test lesson name | + | intro | Test lesson description | + | retake | 1 | + | minquestions | 3 | + | section | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" - And I set the following fields to these values: - | Name | Test lesson name | - | Description | Test lesson description | - | Re-takes allowed | Yes | - | Minimum number of questions | 3 | - And I press "Save and return to course" And I follow "Test lesson name" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/lesson_report.feature b/mod/lesson/tests/behat/lesson_report.feature index c7ff38a7c95..d76870dc9ad 100644 --- a/mod/lesson/tests/behat/lesson_report.feature +++ b/mod/lesson/tests/behat/lesson_report.feature @@ -16,14 +16,11 @@ Feature: In a lesson activity, teachers can review student attempts | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | retake | + | lesson | Test lesson name | Test | C1 | 1 | lesson1 | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" - And I set the following fields to these values: - | Name | Test lesson name | - | Description | Test lesson description | - | Re-takes allowed | Yes | - And I press "Save and return to course" + And I am on "Course 1" course homepage And I follow "Test lesson name" Scenario: View student attempts in a lesson containing both content and question pages diff --git a/mod/lesson/tests/behat/lesson_review.feature b/mod/lesson/tests/behat/lesson_review.feature index 39e2731a449..875b09128e5 100644 --- a/mod/lesson/tests/behat/lesson_review.feature +++ b/mod/lesson/tests/behat/lesson_review.feature @@ -16,11 +16,14 @@ Feature: In a lesson activity, students can review the answers they gave to ques | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + Given the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | lesson | Test lesson name | Test lesson description | C1 | 1 | lesson1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | + And I am on "Course 1" course homepage + And I follow "Test lesson name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Display ongoing score | Yes | | Slideshow | Yes | | Maximum number of answers | 10 | @@ -28,6 +31,7 @@ Feature: In a lesson activity, students can review the answers they gave to ques | Maximum number of attempts | 3 | | Custom scoring | No | | Re-takes allowed | Yes | + And I press "Save and return to course" And I follow "Test lesson name" And I follow "Add a question page" And I set the field "Select a question type" to "Numerical" diff --git a/mod/lesson/tests/behat/lesson_student_resume.feature b/mod/lesson/tests/behat/lesson_student_resume.feature index 2a66d6c1cca..e3d8c4185e0 100644 --- a/mod/lesson/tests/behat/lesson_student_resume.feature +++ b/mod/lesson/tests/behat/lesson_student_resume.feature @@ -14,14 +14,16 @@ Feature: In a lesson activity a student should | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | lesson | + | name | Test lesson name | + | intro | Test lesson description | + | course | C1 | + | idnumber | 0001 | + | section | 1 | + | retake | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" - And I set the following fields to these values: - | Name | Test lesson name | - | Description | Test lesson description | - | Re-takes allowed | Yes | - And I press "Save and return to course" + And I am on "Course 1" course homepage And I follow "Test lesson name" Scenario: resume a lesson with both content then question pages diff --git a/mod/lesson/tests/behat/lesson_with_clusters.feature b/mod/lesson/tests/behat/lesson_with_clusters.feature index f2ecf79c43d..9fc577e28b2 100644 --- a/mod/lesson/tests/behat/lesson_with_clusters.feature +++ b/mod/lesson/tests/behat/lesson_with_clusters.feature @@ -16,13 +16,13 @@ Feature: In a lesson activity, students can see questions in random order | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | lesson | Lesson with clusters | Test lesson description | C1 | lesson1 | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on Scenario: Lesson with two clusters - Given I add a "Lesson" to section "1" and I fill the form with: - | Name | Lesson with clusters | - | Description | Test lesson description | + Given I am on "Course 1" course homepage with editing mode on And I follow "Lesson with clusters" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/lesson_with_subcluster.feature b/mod/lesson/tests/behat/lesson_with_subcluster.feature index 6a85581e79a..effbcfa66fb 100644 --- a/mod/lesson/tests/behat/lesson_with_subcluster.feature +++ b/mod/lesson/tests/behat/lesson_with_subcluster.feature @@ -17,12 +17,12 @@ Feature: In a lesson activity, students can see questions in random order and a | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on Scenario: Lesson with subcluster - Given I add a "Lesson" to section "1" and I fill the form with: - | Name | Lesson with subcluster | - | Description | Test lesson description | + Given the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | lesson | Lesson with subcluster | Test lesson description | C1 | lesson1 | 1 | + And I am on "Course 1" course homepage And I follow "Lesson with subcluster" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/link_to_gradebook.feature b/mod/lesson/tests/behat/link_to_gradebook.feature index 87b45ef4ac4..7a50c94187c 100644 --- a/mod/lesson/tests/behat/link_to_gradebook.feature +++ b/mod/lesson/tests/behat/link_to_gradebook.feature @@ -17,10 +17,10 @@ Feature: link to gradebook on the end of lesson page | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson | - | Description | Test lesson description | + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | lesson | Test lesson | Test lesson description | C1 | lesson1 | + And I am on "Course 1" course homepage And I follow "Test lesson" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/password_protection.feature b/mod/lesson/tests/behat/password_protection.feature index 057620e6573..467d0b0d05c 100644 --- a/mod/lesson/tests/behat/password_protection.feature +++ b/mod/lesson/tests/behat/password_protection.feature @@ -16,13 +16,17 @@ Feature: A teacher can password protect a lesson | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | lesson | + | course | C1 | + | idnumber | 0001 | + | name | Test lesson | + | intro | Test lesson description | + | section | 1 | + | usepassword | 1 | + | password | moodle_rules | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson | - | Description | Test lesson description | - | Password protected lesson | Yes | - | id_password | moodle_rules | + And I am on "Course 1" course homepage And I follow "Test lesson" And I follow "Add a content page" And I set the following fields to these values: diff --git a/mod/lesson/tests/behat/teacher_grade_essays.feature b/mod/lesson/tests/behat/teacher_grade_essays.feature index a2effe14ca7..612cc7c6d97 100644 --- a/mod/lesson/tests/behat/teacher_grade_essays.feature +++ b/mod/lesson/tests/behat/teacher_grade_essays.feature @@ -33,12 +33,17 @@ Feature: In a lesson activity, a non editing teacher can grade essay questions | student1 | G1 | | student2 | G2 | | student3 | G3 | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | lesson | Test lesson name | Test lesson description | C1 | lesson1 | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" and I fill the form with: - | Name | Test lesson name | - | Description | Test lesson description | + And I am on "Course 1" course homepage + And I follow "Test lesson name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Group mode | Separate groups | + And I press "Save and return to course" + And I am on "Course 1" course homepage with editing mode on And I follow "Test lesson name" And I follow "Add a question page" And I set the field "Select a question type" to "Essay" diff --git a/mod/lesson/tests/behat/wrong_answer_continue.feature b/mod/lesson/tests/behat/wrong_answer_continue.feature index 45bfb8f4ef9..62ef8c73765 100644 --- a/mod/lesson/tests/behat/wrong_answer_continue.feature +++ b/mod/lesson/tests/behat/wrong_answer_continue.feature @@ -16,15 +16,18 @@ Feature: An incorrect response to an answer with multiple attempts show appropri | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | section | idnumber | + | lesson | Test lesson name | Test lesson description | C1 | 1 | lesson1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Lesson" to section "1" + And I am on "Course 1" course homepage + And 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 | Test lesson name | - | Description | Test lesson description | | Provide option to try a question again | Yes | | Maximum number of attempts | 2 | - And I press "Save and display" + And I press "Save and return to course" + And I follow "Test lesson name" Scenario: A student answering incorrectly to a question will see an option to move to the next question if set up. Given I follow "Add a question page" diff --git a/mod/lti/tests/behat/lti_activity_completion.feature b/mod/lti/tests/behat/lti_activity_completion.feature index 97829cb5a43..950acef4593 100644 --- a/mod/lti/tests/behat/lti_activity_completion.feature +++ b/mod/lti/tests/behat/lti_activity_completion.feature @@ -16,6 +16,9 @@ Feature: View activity completion information in the LTI activity | user | course | role | | student1 | C1 | student | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | course | idnumber | + | lti | Music history | C1 | lti1 | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Edit settings" in current page administration @@ -25,11 +28,13 @@ Feature: View activity completion information in the LTI activity | Show completion conditions | Yes | And I press "Save and display" And I turn editing mode on - And I add a "External tool" to section "1" and I fill the form with: - | Activity name | Music history | + And I follow "Music history" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Completion tracking | Show activity as complete when conditions are met | | Require view | 1 | | Require grade | 1 | + And I press "Save and return to course" And I log out Scenario: View automatic completion items as a teacher diff --git a/mod/page/tests/behat/page_activity_completion.feature b/mod/page/tests/behat/page_activity_completion.feature index 14e207148f0..4e465c2945c 100644 --- a/mod/page/tests/behat/page_activity_completion.feature +++ b/mod/page/tests/behat/page_activity_completion.feature @@ -16,6 +16,12 @@ Feature: View activity completion information in the Page resource | user | course | role | | student1 | C1 | student | | teacher1 | C1 | editingteacher | + And the following "activity" exists: + | activity | page | + | course | C1 | + | idnumber | page1 | + | name | Music history | + | intro | A lesson learned in life | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Edit settings" in current page administration @@ -27,11 +33,12 @@ Feature: View activity completion information in the Page resource Scenario: View automatic completion items Given I am on "Course 1" course homepage with editing mode on - And I add a "Page" to section "1" and I fill the form with: - | Name | Music history | - | Page content | A lesson learned in life | - | Completion tracking | Show activity as complete when conditions are met | - | Require view | 1 | + And I follow "Music history" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: + | Completion tracking | Show activity as complete when conditions are met | + | completionview | 1 | + And I press "Save and return to course" # Teacher view. And I follow "Music history" And "Music history" should have the "View" completion condition @@ -45,10 +52,11 @@ Feature: View activity completion information in the Page resource @javascript Scenario: Use manual completion Given I am on "Course 1" course homepage with editing mode on - And I add a "Page" to section "1" and I fill the form with: - | Name | Music history | - | Page content | A lesson learned in life | + And I follow "Music history" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Completion tracking | Students can manually mark the activity as completed | + And I press "Save and return to course" # Teacher view. And I follow "Music history" And the manual completion button for "Music history" should be disabled @@ -69,10 +77,11 @@ Feature: View activity completion information in the Page resource | Enable completion tracking | Yes | | Show completion conditions | No | And I press "Save and display" - And I add a "Page" to section "1" and I fill the form with: - | Name | Music history | - | Page content | A lesson learned in life | + And I follow "Music history" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Completion tracking | Students can manually mark the activity as completed | + And I press "Save and return to course" # Teacher view. And the manual completion button for "Music history" should not exist And I log out diff --git a/mod/quiz/tests/behat/add_quiz.feature b/mod/quiz/tests/behat/add_quiz.feature index 7344a0a149c..bac363abccc 100644 --- a/mod/quiz/tests/behat/add_quiz.feature +++ b/mod/quiz/tests/behat/add_quiz.feature @@ -16,11 +16,16 @@ Feature: Add a quiz | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | quiz | + | course | C1 | + | idnumber | 00001 | + | name | Test quiz name | + | intro | Test quiz description | + | section | 1 | + | grade | 10 | When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Quiz" to section "1" and I fill the form with: - | Name | Test quiz name | - | Description | Test quiz description | And I add a "True/False" question to the "Test quiz name" quiz with: | Question name | First question | | Question text | Answer the first question | diff --git a/mod/quiz/tests/behat/quiz_no_calendar_capabilities.feature b/mod/quiz/tests/behat/quiz_no_calendar_capabilities.feature index 4bd2b0bc3a0..475444cffe8 100644 --- a/mod/quiz/tests/behat/quiz_no_calendar_capabilities.feature +++ b/mod/quiz/tests/behat/quiz_no_calendar_capabilities.feature @@ -14,20 +14,18 @@ Feature: Quiz with no calendar capabilites And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activity" exists: + | activity | quiz | + | course | C1 | + | idnumber | 00001 | + | name | Test quiz name | + | intro | Test quiz description | + | section | 1 | And I log in as "admin" And I am on "Course 1" course homepage - And I navigate to "Users > Permissions" in current page administration - And I override the system permissions of "Teacher" role with: - | capability | permission | - | moodle/calendar:manageentries | Prohibit | - And I log out - - Scenario: Editing a quiz - Given I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - When I add a "Quiz" to section "1" and I fill the form with: - | Name | Test quiz name | - | Description | Test quiz description | + And I follow "Test quiz name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | id_timeopen_enabled | 1 | | id_timeopen_day | 1 | | id_timeopen_month | 1 | @@ -36,7 +34,15 @@ Feature: Quiz with no calendar capabilites | id_timeclose_day | 1 | | id_timeclose_month | 2 | | id_timeclose_year | 2017 | + And I press "Save and return to course" + And I am on "Course 1" course homepage + And I navigate to "Users > Permissions" in current page administration + And I override the system permissions of "Teacher" role with: + | capability | permission | + | moodle/calendar:manageentries | Prohibit | And I log out + + Scenario: Editing a quiz When I am on the "Test quiz name" "mod_quiz > View" page logged in as "teacher1" And I navigate to "Edit settings" in current page administration And I set the following fields to these values: diff --git a/mod/survey/tests/behat/survey_completion.feature b/mod/survey/tests/behat/survey_completion.feature index 3b1b682ee82..573d4430049 100644 --- a/mod/survey/tests/behat/survey_completion.feature +++ b/mod/survey/tests/behat/survey_completion.feature @@ -17,7 +17,6 @@ Feature: A teacher can use activity completion to track a student progress | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on Scenario: Require survey view Given the following "activities" exist: @@ -27,6 +26,7 @@ Feature: A teacher can use activity completion to track a student progress And I follow "Test survey name" And I navigate to "Edit settings" in current page administration And I set the following fields to these values: + | Survey type | Critical incidents | | Completion tracking | Show activity as complete when conditions are met | | completionview | 1 | | completionsubmit | 0 | diff --git a/mod/survey/tests/behat/survey_types.feature b/mod/survey/tests/behat/survey_types.feature index 88472193da4..75a269ab05f 100644 --- a/mod/survey/tests/behat/survey_types.feature +++ b/mod/survey/tests/behat/survey_types.feature @@ -14,19 +14,25 @@ Feature: A teacher can set three types of survey activity And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | survey | Test survey name | Test survey description | C1 | survey1 | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - When I add a "Survey" to section "1" and I fill the form with: - | Name | Test survey name | + And I am on "Course 1" course homepage + And I follow "Test survey name" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Survey type | ATTLS (20 item version) | - | Description | Test survey description | + And I press "Save and return to course" And I follow "Test survey name" Then I should see "Attitudes Towards Thinking and Learning" + And I click on "Actions menu" "link" And I follow "Edit settings" And I set the following fields to these values: | Survey type | Critical incidents | And I press "Save and display" And I should see "At what moment in class were you most engaged as a learner?" + And I click on "Actions menu" "link" And I follow "Edit settings" And I set the following fields to these values: | Survey type | COLLES (Preferred and Actual) | diff --git a/mod/url/tests/behat/url_activity_completion.feature b/mod/url/tests/behat/url_activity_completion.feature index c6f9ea2ab84..000d71dfec2 100644 --- a/mod/url/tests/behat/url_activity_completion.feature +++ b/mod/url/tests/behat/url_activity_completion.feature @@ -18,6 +18,9 @@ Feature: View activity completion information in the URL resource | teacher1 | C1 | editingteacher | And the following config values are set as admin: | displayoptions | 0,1,2,3,4,5,6 | url | + And the following "activities" exist: + | activity | name | description | course | idnumber | externalurl | + | url | Music history | URL description | C1 | url1 | https://moodle.org/ | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Edit settings" in current page administration @@ -29,12 +32,13 @@ Feature: View activity completion information in the URL resource Scenario: View automatic completion items in automatic display mode Given I am on "Course 1" course homepage with editing mode on - And I add a "URL" to section "1" and I fill the form with: - | Name | Music history | - | External URL | https://moodle.org/ | + And I follow "Music history" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Display | Automatic | | Completion tracking | Show activity as complete when conditions are met | | Require view | 1 | + And I press "Save and return to course" # Teacher view. And I follow "Music history" And "Music history" should have the "View" completion condition @@ -47,12 +51,13 @@ Feature: View activity completion information in the URL resource Scenario: View automatic completion items in embed display mode Given I am on "Course 1" course homepage with editing mode on - And I add a "URL" to section "1" and I fill the form with: - | Name | Music history | - | External URL | https://moodle.org/ | + And I follow "Music history" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Display | Embed | | Completion tracking | Show activity as complete when conditions are met | | Require view | 1 | + And I press "Save and return to course" # Teacher view. And I follow "Music history" And "Music history" should have the "View" completion condition @@ -65,12 +70,13 @@ Feature: View activity completion information in the URL resource Scenario: View automatic completion items in open display mode Given I am on "Course 1" course homepage with editing mode on - And I add a "URL" to section "1" and I fill the form with: - | Name | Music history | - | External URL | https://moodle.org/ | + And I follow "Music history" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Display | Open | | Completion tracking | Show activity as complete when conditions are met | | Require view | 1 | + And I press "Save and return to course" # Teacher view. And I follow "Music history" And "Music history" should have the "View" completion condition @@ -83,12 +89,13 @@ Feature: View activity completion information in the URL resource Scenario: View automatic completion items in pop-up display mode Given I am on "Course 1" course homepage with editing mode on - And I add a "URL" to section "1" and I fill the form with: - | Name | Music history | - | External URL | https://moodle.org/ | + And I follow "Music history" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Display | In pop-up | | Completion tracking | Show activity as complete when conditions are met | | Require view | 1 | + And I press "Save and return to course" # Teacher view. And I follow "Music history" And "Music history" should have the "View" completion condition @@ -102,11 +109,12 @@ Feature: View activity completion information in the URL resource @javascript Scenario: Use manual completion Given I am on "Course 1" course homepage with editing mode on - And I add a "URL" to section "1" and I fill the form with: - | Name | Music history | - | External URL | https://moodle.org/ | + And I follow "Music history" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Display | Automatic | | Completion tracking | Students can manually mark the activity as completed | + And I press "Save and return to course" # Teacher view. And I follow "Music history" And the manual completion button for "Music history" should be disabled diff --git a/mod/wiki/tests/behat/preview_page.feature b/mod/wiki/tests/behat/preview_page.feature index 7ae688c2123..554a9b45bc9 100644 --- a/mod/wiki/tests/behat/preview_page.feature +++ b/mod/wiki/tests/behat/preview_page.feature @@ -16,14 +16,13 @@ Feature: Edited wiki pages may be previewed before saving | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Wiki" to section "1" and I fill the form with: - | Wiki name | Test wiki name | - | Description | Test wiki description | - | First page name | First page | - | Wiki mode | Collaborative wiki | - And I log out + And the following "activity" exists: + | activity | wiki | + | course | C1 | + | idnumber | 0001 | + | name | Test wiki name | + | intro | Test wiki description | + | wikimode | collaborative | And I log in as "student1" And I am on "Course 1" course homepage And I follow "Test wiki name" diff --git a/mod/workshop/tests/behat/grade_to_pass.feature b/mod/workshop/tests/behat/grade_to_pass.feature index 1a5724b5d57..25a42b76930 100644 --- a/mod/workshop/tests/behat/grade_to_pass.feature +++ b/mod/workshop/tests/behat/grade_to_pass.feature @@ -17,13 +17,16 @@ Feature: Setting grades to pass via workshop editing form Scenario: Adding a new workshop with grade to pass field set Given I log in as "teacher1" - And I am on "Course1" course homepage with editing mode on - When I add a "Workshop" to section "1" and I fill the form with: - | Workshop name | Awesome workshop | - | Description | Grades to pass are set here | - | Submission grade to pass | 45 | - | Assessment grade to pass | 10.5 | - Then I should not see "Adding a new Workshop" + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | workshop | Awesome workshop | Grades to pass are set here | c1 | workshop1 | 1 | + And I am on "Course1" course homepage + And I follow "Awesome workshop" + And I navigate to "Edit settings" in current page administration + And I set the field "Submission grade to pass" to "45" + And I set the field "Assessment grade to pass" to "10.5" + And I press "Save and return to course" + And I am on "Course1" course homepage And I follow "Awesome workshop" And I navigate to "Edit settings" in current page administration And the field "Submission grade to pass" matches value "45.00" @@ -47,13 +50,10 @@ Feature: Setting grades to pass via workshop editing form Scenario: Adding a new workshop with grade to pass fields left empty Given I log in as "teacher1" + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | workshop | Another awesome workshop | No grades to pass are set here | c1 | workshop1 | 1 | And I am on "Course1" course homepage with editing mode on - When I add a "Workshop" to section "1" and I fill the form with: - | Workshop name | Another awesome workshop | - | Description | No grades to pass are set here | - | Submission grade to pass | | - | Assessment grade to pass | | - Then I should not see "Adding a new Workshop" And I follow "Another awesome workshop" And I navigate to "Edit settings" in current page administration And the field "Submission grade to pass" matches value "0.00" @@ -61,33 +61,42 @@ Feature: Setting grades to pass via workshop editing form Scenario: Adding a new workshop with non-numeric value of a grade to pass Given I log in as "teacher1" - And I am on "Course1" course homepage with editing mode on - When I add a "Workshop" to section "1" and I fill the form with: - | Workshop name | Almost awesome workshop | - | Description | Invalid grade to pass is set here | - | Assessment grade to pass | You shall not pass! | - Then I should see "Adding a new Workshop" + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | workshop | Another awesome workshop | Invalid grade to pass is set here | c1 | workshop1 | 1 | + And I am on "Course1" course homepage + And I follow "Another awesome workshop" + And I navigate to "Edit settings" in current page administration + And I set the field "Assessment grade to pass" to "You shall not pass!" + And I press "Save and return to course" + Then I should see "Updating Workshop in Topic 1" And I should see "You must enter a number here" Scenario: Adding a new workshop with invalid value of a grade to pass Given I log in as "teacher1" - And I am on "Course1" course homepage with editing mode on - When I add a "Workshop" to section "1" and I fill the form with: - | Workshop name | Almost awesome workshop | - | Description | Invalid grade to pass is set here | - | Assessment grade to pass | 10000000 | - Then I should see "Adding a new Workshop" + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | workshop | Almost awesome workshop | Invalid grade to pass is set here | c1 | workshop1 | 1 | + And I am on "Course1" course homepage + And I follow "Almost awesome workshop" + And I navigate to "Edit settings" in current page administration + And I set the field "Assessment grade to pass" to "10000000" + And I press "Save and return to course" + Then I should see "Updating Workshop in Topic 1" And I should see "The grade to pass can not be greater than the maximum possible grade" Scenario: Emptying grades to pass fields sets them to zero Given I log in as "teacher1" - And I am on "Course1" course homepage with editing mode on - And I add a "Workshop" to section "1" and I fill the form with: - | Workshop name | Super awesome workshop | - | Description | Grade to pass are set and then unset here | - | Submission grade to pass | 59.99 | - | Assessment grade to pass | 0.000 | - And I should not see "Adding a new Workshop" + And the following "activities" exist: + | activity | name | intro | course | idnumber | section | + | workshop | Super awesome workshop | Grade to pass are set and then unset here | c1 | workshop1 | 1 | + And I am on "Course1" course homepage + And I follow "Super awesome workshop" + And I navigate to "Edit settings" in current page administration + And I set the field "Submission grade to pass" to "59.99" + And I set the field "Assessment grade to pass" to "0.000" + And I press "Save and return to course" + And I should not see "Updating Workshop in Topic 1" And I follow "Super awesome workshop" And I navigate to "Edit settings" in current page administration And the field "Submission grade to pass" matches value "59.99" diff --git a/mod/workshop/tests/behat/workshop_activity_completion.feature b/mod/workshop/tests/behat/workshop_activity_completion.feature index 8ed6e7a5f62..37818f632a8 100644 --- a/mod/workshop/tests/behat/workshop_activity_completion.feature +++ b/mod/workshop/tests/behat/workshop_activity_completion.feature @@ -18,6 +18,9 @@ Feature: View activity completion information in the Workshop activity | student1 | C1 | student | | student2 | C1 | student | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | submissiontypefile | + | workshop | Music history | Test workshop description | C1 | workshop1 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Edit settings" in current page administration @@ -27,11 +30,13 @@ Feature: View activity completion information in the Workshop activity | Show completion conditions | Yes | And I press "Save and display" And I turn editing mode on - And I add a "Workshop" to section "1" and I fill the form with: - | Workshop name | Music history | + And I follow "Music history" + And I navigate to "Edit settings" in current page administration + And I set the following fields to these values: | Completion tracking | Show activity as complete when conditions are met | | Require view | 1 | | Require grade | Submission | + And I press "Save and return to course" And I edit assessment form in workshop "Music history" as:" | id_description__idx_0_editor | Aspect1 | And I change phase in workshop "Music history" to "Submission phase" diff --git a/report/log/tests/behat/filter_log_actions.feature b/report/log/tests/behat/filter_log_actions.feature index 4e4d07d4435..9fcb4ba7d50 100644 --- a/report/log/tests/behat/filter_log_actions.feature +++ b/report/log/tests/behat/filter_log_actions.feature @@ -8,14 +8,16 @@ Feature: In a report, admin can filter log data by action Given the following "courses" exist: | fullname | shortname | category | groupmode | | Course 1 | C1 | 0 | 1 | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment 1 | + | intro | Offline text | + | assignsubmission_file_enabled | 0 | + | section | 1 | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - # Create Action. - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment 1 | - | Description | Offline text | - | assignsubmission_file_enabled | 0 | - And I am on "Course 1" course homepage # View Action. And I follow "Test assignment 1" # Update Action. @@ -30,7 +32,6 @@ Feature: In a report, admin can filter log data by action When I navigate to "Reports > Logs" in site administration And I set the field "menumodaction" to "Create" And I press "Get these logs" - Then I should see "Course module created" And I should not see "Course module updated" And I should not see "The status of the submission has been viewed." And I should not see "Course module deleted" @@ -71,7 +72,6 @@ Feature: In a report, admin can filter log data by action And I set the field "menumodaction" to "All changes" And I press "Get these logs" Then I should see "Course module deleted" - And I should see "Course module created" And I should see "Course module updated" And I should not see "The status of the submission has been viewed." @@ -81,6 +81,5 @@ Feature: In a report, admin can filter log data by action And I set the field "menumodaction" to "All actions" And I press "Get these logs" Then I should see "Course module deleted" - And I should see "Course module created" And I should see "Course module updated" And I should see "The status of the submission has been viewed." diff --git a/report/log/tests/behat/user_log.feature b/report/log/tests/behat/user_log.feature index b8726726f82..2a172821a89 100644 --- a/report/log/tests/behat/user_log.feature +++ b/report/log/tests/behat/user_log.feature @@ -16,14 +16,15 @@ Feature: User can view activity log. | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: - | Assignment name | Test assignment name | - | Description | Submit your online text | - | assignsubmission_onlinetext_enabled | 1 | - | assignsubmission_file_enabled | 0 | - And I log out + And the following "activity" exists: + | activity | assign | + | course | C1 | + | idnumber | 0001 | + | name | Test assignment name | + | intro | Submit your online text | + | section | 1 | + | assignsubmission_onlinetext_enabled | 1 | + | assignsubmission_file_enabled | 0 | And I log in as "student1" And I am on "Course 1" course homepage And I follow "Test assignment name" diff --git a/report/outline/tests/behat/filter.feature b/report/outline/tests/behat/filter.feature index b7606cfc949..bc6d355b91c 100644 --- a/report/outline/tests/behat/filter.feature +++ b/report/outline/tests/behat/filter.feature @@ -18,16 +18,12 @@ Feature: Filter an outline report | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | + And the following "activities" exist: + | activity | name | description | course | idnumber | section | + | forum | Forum name | Forum description | C1 | FORUM01 | 1 | + | book | Book name | Book description | C1 | BOOK01 | 1 | When I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Forum name | - | Description | Forum description | - | ID number| FORUM01 | - And I add a "Book" to section "1" and I fill the form with: - | Name | Book name | - | Description | Book description | - | ID number| BOOK01 | + And I am on "Course 1" course homepage Scenario: Filter the outline report by start date Given I navigate to "Plugins > Logging > Manage log stores" in site administration diff --git a/report/outline/tests/behat/outline.feature b/report/outline/tests/behat/outline.feature index 99aeb57260d..9d47dc58e43 100644 --- a/report/outline/tests/behat/outline.feature +++ b/report/outline/tests/behat/outline.feature @@ -18,14 +18,12 @@ Feature: View an outline report | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | forum | Forum name | Forum description | C1 | forum1 | + | book | Book name | Book description | C1 | book1 | When I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Forum name | - | Description | Forum description | - And I add a "Book" to section "1" and I fill the form with: - | Name | Book name | - | Description | Book description | + And I am on "Course 1" course homepage Scenario: View the outline report when only the legacy log reader is enabled Given I navigate to "Plugins > Logging > Manage log stores" in site administration diff --git a/report/outline/tests/behat/user.feature b/report/outline/tests/behat/user.feature index e9b1edff93b..41de4ce28a1 100644 --- a/report/outline/tests/behat/user.feature +++ b/report/outline/tests/behat/user.feature @@ -16,15 +16,13 @@ Feature: View the user page for the outline report | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | name | description | course | idnumber | + | folder | Folder name | Folder description | C1 | folder1 | + And the following "activities" exist: + | activity | name | description | course | idnumber | externalurl | + | url | URL name | URL description | C1 | folder1 | http://www.google.com | When I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Folder" to section "1" and I fill the form with: - | Name | Folder name | - | Description | Folder description | - And I add a "URL" to section "1" and I fill the form with: - | Name | URL name | - | Description | URL description | - | External URL | http://www.google.com | Scenario: View the user page when only the legacy log reader is enabled Given I navigate to "Plugins > Logging > Manage log stores" in site administration diff --git a/user/tests/behat/course_preference.feature b/user/tests/behat/course_preference.feature deleted file mode 100644 index 68fc3a4f028..00000000000 --- a/user/tests/behat/course_preference.feature +++ /dev/null @@ -1,33 +0,0 @@ -@core @core_user -Feature: As a user, "Course preferences" allows me to set my course preference(s). - Background: - Given I log in as "admin" - And the following "courses" exist: - | fullname | shortname | format | - | Course 1 | C1 | topics | - And the following "course enrolments" exist: - | user | course | role | - | admin | C1 | editingteacher | - And I am on site homepage - And I follow "Preferences" in the user menu - And I follow "Course preferences" - - @javascript - Scenario: As a user, "activity chooser" should be the default. - # See that the "activity chooser" is enabled by default. - Given the field "enableactivitychooser" matches value "1" - # See that the "activity chooser" is actually shown by default in course page. - When I am on "Course 1" course homepage - And I should not see "Add an activity or resource" in the "Topic 1" "section" - And I turn editing mode on - Then I should see "Add an activity or resource" in the "Topic 1" "section" - And I should not see "Add a resource..." in the "Topic 1" "section" - - @javascript - Scenario: As a user, "activity chooser" should be disabled when I uncheck it in "Course preferences" - Given I set the field "enableactivitychooser" to "0" - And I press "Save changes" - When I am on "Course 1" course homepage - And I should not see "Add a resource..." in the "Topic 1" "section" - And I turn editing mode on - Then I should see "Add a resource..." in the "Topic 1" "section"