diff --git a/admin/tool/behat/tests/behat/edit_permissions.feature b/admin/tool/behat/tests/behat/edit_permissions.feature index 67365f2d93e..2a9edb5176f 100644 --- a/admin/tool/behat/tests/behat/edit_permissions.feature +++ b/admin/tool/behat/tests/behat/edit_permissions.feature @@ -21,7 +21,7 @@ Feature: Edit capabilities Scenario: Default system capabilities modification Given I log in as "admin" - When I navigate to "Users > Permissions > Define roles" in site administration + And I navigate to "Users > Permissions > Define roles" in site administration And I click on "Edit Teacher role" "link" And I fill the capabilities form with the following permissions: | capability | permission | diff --git a/admin/tool/lp/tests/behat/plan_workflow.feature b/admin/tool/lp/tests/behat/plan_workflow.feature index c68723acd9b..e4a5406b72a 100644 --- a/admin/tool/lp/tests/behat/plan_workflow.feature +++ b/admin/tool/lp/tests/behat/plan_workflow.feature @@ -16,17 +16,16 @@ Feature: Manage plan workflow | usermanageownplan | User manage own plan role | user | | manageplan | Manager all plans role | manager | And the following "role capabilities" exist: - | role | moodle/competency:planmanageowndraft | - | usermanageowndraftplan | allow | - | usermanageownplan | allow | - | manageplan | allow | - And the following "role capabilities" exist: - | role | moodle/competency:planmanageown | - | usermanageownplan | allow | - | manageplan | allow | - And the following "role capabilities" exist: - | role | moodle/competency:planmanage | moodle/competency:planview | moodle/competency:planreview | moodle/competency:planrequestreview | - | manageplan | allow | allow | allow | allow | + | role | moodle/competency:planmanageowndraft | moodle/competency:planmanageown | + | usermanageowndraftplan | allow | | + | usermanageownplan | allow | allow | + | manageplan | allow | allow | + And the following "role capability" exists: + | role | manageplan | + | moodle/competency:planmanage | allow | + | moodle/competency:planview | allow | + | moodle/competency:planreview | allow | + | moodle/competency:planrequestreview | allow | And the following "role assigns" exist: | user | role | contextlevel | reference | | user1 | usermanageowndraftplan | System | | diff --git a/admin/tool/monitor/tests/behat/subscription.feature b/admin/tool/monitor/tests/behat/subscription.feature index 7caf792e057..7182ce26866 100644 --- a/admin/tool/monitor/tests/behat/subscription.feature +++ b/admin/tool/monitor/tests/behat/subscription.feature @@ -169,8 +169,8 @@ Feature: tool_monitor_subscriptions Scenario: No manage rules link when user does not have permission Given the following "role capability" exists: - | role | Non-editing teacher | - | tool/monitor:managerules | Prohibit | + | role | teacher | + | tool/monitor:managerules | prohibit | And I log in as "teacher1" And I follow "Preferences" in the user menu And I follow "Event monitoring" diff --git a/admin/tool/policy/tests/behat/acceptances.feature b/admin/tool/policy/tests/behat/acceptances.feature index 5eebe93a688..8df506a54a0 100644 --- a/admin/tool/policy/tests/behat/acceptances.feature +++ b/admin/tool/policy/tests/behat/acceptances.feature @@ -71,7 +71,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users @javascript Scenario: Agree on behalf of another user as a manager, single policy, javascript on - Given the following "role capabilities" exist: + Given the following "role capability" exists: | role | manager | | tool/policy:acceptbehalf | allow | When I log in as "manager" @@ -166,7 +166,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users Given the following "role capability" exists: | role | manager | | tool/policy:acceptbehalf | allow | - Given I log in as "admin" + And I log in as "admin" And I navigate to "Users > Privacy and policies > Manage policies" in site administration And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row" And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row" diff --git a/blocks/navigation/tests/behat/participants_link.feature b/blocks/navigation/tests/behat/participants_link.feature index 960bfca73dd..3697e0f0b25 100644 --- a/blocks/navigation/tests/behat/participants_link.feature +++ b/blocks/navigation/tests/behat/participants_link.feature @@ -53,11 +53,9 @@ Feature: Displaying the link to the Participants page Then I should not see "Participants" in the "Navigation" "block" And I am on the "Test forum name" "forum activity" page And I should not see "Participants" in the "Navigation" "block" - And I log out - And I log in as "admin" - And I set the following system permissions of "Guest" role: - | capability | permission | - | moodle/course:viewparticipants | Allow | + And the following "role capability" exists: + | role | guest | + | moodle/course:viewparticipants | allow | And I log in as "guest" And I am on "Course1" course homepage And I should see "Participants" in the "Navigation" "block" diff --git a/blocks/tests/behat/restrict_available_blocks.feature b/blocks/tests/behat/restrict_available_blocks.feature index 56cd80f65d3..2885dd241e7 100644 --- a/blocks/tests/behat/restrict_available_blocks.feature +++ b/blocks/tests/behat/restrict_available_blocks.feature @@ -27,7 +27,7 @@ Feature: Allowed blocks controls Given the following "role capability" exists: | role | editingteacher | | block/activity_modules:addinstance | prohibit | - Given I log in as "admin" + 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: diff --git a/course/tests/behat/course_browsing.feature b/course/tests/behat/course_browsing.feature index 6e93281fbfc..4bf22ab9113 100644 --- a/course/tests/behat/course_browsing.feature +++ b/course/tests/behat/course_browsing.feature @@ -25,7 +25,7 @@ Feature: Restricting access to course lists And the following "roles" exist: | name | shortname | description | archetype | | Category viewer | coursebrowse | My custom role 1 | | - And the following "role capabilities" exist: + And the following "role capability" exist: | role | moodle/category:viewcourselist | | user | prevent | | guest | prevent | diff --git a/course/tests/behat/course_download_content_permissions.feature b/course/tests/behat/course_download_content_permissions.feature index 7ec66482833..b5f2110b411 100644 --- a/course/tests/behat/course_download_content_permissions.feature +++ b/course/tests/behat/course_download_content_permissions.feature @@ -16,10 +16,8 @@ Feature: Access to downloading course content can be controlled | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "admin" And the following config values are set as admin: - | downloadcoursecontentallowed | 1 | - And I log out + | downloadcoursecontentallowed | 1 | Scenario: Site admins can remove the download course content feature Given I log in as "admin" @@ -60,25 +58,20 @@ Feature: Access to downloading course content can be controlled And "Download course content" "link" should not exist in current page administration Scenario: Teachers require a capability to access the download course content feature or modify its availability in a course - Given I log in as "admin" - And I navigate to "Courses > Course default settings" in site administration - And I set the field "Enable download course content" to "Yes" - And I press "Save changes" - And I log out + Given the following config values are set as admin: + | config | value | plugin | + | downloadcontentsitedefault | 1 | moodlecourse | # Check teacher can see download option and enable dropdown. And I log in as "teacher1" And I am on "Hockey 101" course homepage And "Download course content" "link" should exist in current page administration And I navigate to "Edit settings" in current page administration And "Enable download course content" "select" should exist - And I log out # Remove teacher's capabilities for download course content. - And I log in as "admin" - And I set the following system permissions of "Teacher" role: - | capability | permission | - | moodle/course:downloadcoursecontent | Prohibit | - | moodle/course:configuredownloadcontent | Prohibit | - And I log out + And the following "role capability" exists: + | role | editingteacher | + | moodle/course:downloadcoursecontent | prohibit | + | moodle/course:configuredownloadcontent | prohibit | # Check teacher can no longer see download option, and that enable value is visible, but dropdown no longer available. When I log in as "teacher1" And I am on "Hockey 101" course homepage @@ -99,13 +92,10 @@ Feature: Access to downloading course content can be controlled And I log in as "student1" And I am on "Hockey 101" course homepage And "Download course content" "button" should exist - And I log out - And I log in as "admin" # Remove student's capability for download course content. - When I set the following system permissions of "Student" role: - | capability | permission | - | moodle/course:downloadcoursecontent | Prohibit | - And I log out + When the following "role capability" exists: + | role | student | + | moodle/course:downloadcoursecontent | prohibit | # Check student can no longer see download button. And I log in as "student1" And I am on "Hockey 101" course homepage diff --git a/course/tests/behat/coursetags.feature b/course/tests/behat/coursetags.feature index 6fe2123a7bc..affbf37592c 100644 --- a/course/tests/behat/coursetags.feature +++ b/course/tests/behat/coursetags.feature @@ -67,8 +67,8 @@ Feature: Tagging courses Scenario: User can set course tags using separate form Given the following "role capability" exists: - | role | Non-editing teacher | - | moodle/course:tag | Allow | + | role | teacher | + | moodle/course:tag | allow | When I log in as "teacher2" And I am on "Course 1" course homepage And I navigate to "Course tags" in current page administration diff --git a/course/tests/behat/keyholder.feature b/course/tests/behat/keyholder.feature index a778d4bce7f..e5ceb9a08d2 100644 --- a/course/tests/behat/keyholder.feature +++ b/course/tests/behat/keyholder.feature @@ -3,9 +3,12 @@ Feature: Keyholder role is listed as course contact As a student I need to know who the keyholder is to enrol in a course Background: - Given the following "roles" exist: - | shortname | name | archetype | context_coursecat | context_course | enrol/self:holdkey | - | keyholder | Keyholder | | 1 | 1 | allow | + Given the following "role" exists: + | shortname | keyholder | + | name | Keyholder | + | context_coursecat | 1 | + | context_course | 1 | + | enrol/self:holdkey | allow | And the following "categories" exist: | name | category | idnumber | | Cat 1 | 0 | CAT1 | @@ -16,11 +19,16 @@ Feature: Keyholder role is listed as course contact | student1 | Student | 1 | teacher1@example.com | And the following "courses" exist: | fullname | shortname | format | coursedisplay | numsections | category | - | Course 1 | C1 | topics | 0 | 5 | CAT1 | + | Course 1 | C1 | topics | 0 | 5 | CAT1 | + And I log in as "admin" And I am on "Course 1" course homepage And I add "Self enrolment" enrolment method with: | Custom instance name | Test student enrolment | - | Enrolment key | letmein | + | Enrolment key | letmein | + And I navigate to "Appearance > Courses" in site administration + And I set the following fields to these values: + | Keyholder | 1 | + And I press "Save changes" And I log out Scenario: Keyholder assigned to a course diff --git a/course/tests/behat/restrict_available_activities.feature b/course/tests/behat/restrict_available_activities.feature index 17fd30f729f..a71ea70bf32 100644 --- a/course/tests/behat/restrict_available_activities.feature +++ b/course/tests/behat/restrict_available_activities.feature @@ -30,10 +30,10 @@ Feature: Restrict activities availability @javascript @skip_chrome_zerosize Scenario: Activities can not be added when the admin restricts the permissions - Given I log in as "admin" - And the following "role capability" exists: + Given the following "role capability" exists: | role | editingteacher | | mod/chat:addinstance | prohibit | + 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: diff --git a/course/tests/behat/role_renaming.feature b/course/tests/behat/role_renaming.feature index 29d5a782573..bd66cd9c994 100644 --- a/course/tests/behat/role_renaming.feature +++ b/course/tests/behat/role_renaming.feature @@ -41,7 +41,7 @@ Feature: Rename roles in a course Scenario: Ability to rename roles can be prevented Given the following "role capability" exists: | role | editingteacher | - | moodle/course:renameroles | inherit | + | moodle/course:renameroles | inherit | When I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Edit settings" in current page administration diff --git a/enrol/self/tests/behat/key_holder.feature b/enrol/self/tests/behat/key_holder.feature index 1431619780b..56d41c6f11e 100644 --- a/enrol/self/tests/behat/key_holder.feature +++ b/enrol/self/tests/behat/key_holder.feature @@ -6,8 +6,8 @@ Feature: Users can be defined as key holders in courses where self enrolment is Background: Given the following "roles" exist: - | shortname | name | archetype | context_course | enrol/self:holdkey | - | keyholder | Key holder | | 1 | allow | + | shortname | name | context_course | enrol/self:holdkey | + | keyholder | Key holder | 1 | allow | And the following "users" exist: | username | firstname | lastname | email | | manager1 | Manager | 1 | manager1@example.com | @@ -33,13 +33,11 @@ Feature: Users can be defined as key holders in courses where self enrolment is | Custom instance name | Test student enrolment | | Enrolment key | moodle_rules | And I log out - - Scenario: The key holder name is displayed on site home page - Given I log in as "student1" + And I log in as "student1" And I am on "Course 1" course homepage And I should see "You should have received this enrolment key from:" And I should see "Manager 1" - When I set the following fields to these values: + And I set the following fields to these values: | Enrolment key | moodle_rules | And I press "Enrol me" Then I should see "Topic 1" diff --git a/grade/report/grader/tests/behat/switch_views.feature b/grade/report/grader/tests/behat/switch_views.feature index efbdcb99876..7e307d311a3 100644 --- a/grade/report/grader/tests/behat/switch_views.feature +++ b/grade/report/grader/tests/behat/switch_views.feature @@ -69,13 +69,13 @@ Feature: We can change what we are viewing on the grader report @javascript @skip_chrome_zerosize Scenario: Minimise the grader report containing hidden activities without the 'moodle/grade:viewhidden' capability - Given the following "role capability" exists: - | role | Teacher | - | moodle/grade:viewhidden | Prevent | - When I am on "Course 1" course homepage with editing mode on + Given I am on "Course 1" course homepage with editing mode on And I open "Test assignment name 2" actions menu And I click on "Hide" "link" in the "Test assignment name 2" activity - And I am on "Course 1" course homepage + And the following "role capability" exists: + | role | editingteacher | + | moodle/grade:viewhidden | prevent | + And I am on the "C1" "course" page logged in as "teacher1" And I navigate to "View > Grader report" in the course gradebook Then I should see "Test assignment name 1" in the "user-grades" "table" And I should see "Test assignment name 2" in the "user-grades" "table" diff --git a/grade/report/user/tests/behat/user_view.feature b/grade/report/user/tests/behat/user_view.feature index 0445c93bdb3..5a8f4f7ed4e 100644 --- a/grade/report/user/tests/behat/user_view.feature +++ b/grade/report/user/tests/behat/user_view.feature @@ -177,7 +177,7 @@ Feature: View the user report as the student will see it Scenario: View the report as the student from both the teachers and students perspective when the student can view hidden Given the following "role capability" exists: | role | student | - | moodle/grade:viewhidden | Allow | + | moodle/grade:viewhidden | allow | And I am on the "C1" "Course" page logged in as "teacher1" And I navigate to "Setup > Course grade settings" in the course gradebook And I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals excluding hidden items" diff --git a/group/tests/behat/delete_groups.feature b/group/tests/behat/delete_groups.feature index cdb853af71b..44a21f0f3c5 100644 --- a/group/tests/behat/delete_groups.feature +++ b/group/tests/behat/delete_groups.feature @@ -58,11 +58,9 @@ Feature: Automatic deletion of groups and groupings @javascript @skip_chrome_zerosize Scenario: Delete groups and groupings with and without ID numbers without the 'moodle/course:changeidnumber' capability - Given I log out - And the following "role capability" exists: - | role | Teacher | - | moodle/course:changeidnumber | Prevent | - And I log out + Given the following "role capability" exists: + | role | editingteacher | + | moodle/course:changeidnumber | prevent | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Users > Groups" in current page administration diff --git a/group/tests/behat/update_groups.feature b/group/tests/behat/update_groups.feature index 22796ba501c..9c5b4de0c2d 100644 --- a/group/tests/behat/update_groups.feature +++ b/group/tests/behat/update_groups.feature @@ -65,10 +65,9 @@ Feature: Automatic updating of groups and groupings @javascript @skip_chrome_zerosize Scenario: Update groups and groupings with ID numbers without the 'moodle/course:changeidnumber' capability - Given I log out - And the following "role capability" exists: - | role | Teacher | - | moodle/course:changeidnumber | Prevent | + Given the following "role capability" exists: + | role | editingteacher | + | moodle/course:changeidnumber | prevent | And I log in as "teacher1" And I am on "Course 1" course homepage And I navigate to "Users > Groups" in current page administration diff --git a/lib/testing/generator/data_generator.php b/lib/testing/generator/data_generator.php index 6ca51ff2f2e..bebd837b002 100644 --- a/lib/testing/generator/data_generator.php +++ b/lib/testing/generator/data_generator.php @@ -863,9 +863,9 @@ EOD; /** * Set role capabilities for the specified role. * - * @param int $roleid The Role to set capabilities for - * @param array $rolecapabilities The list of capability =>permission to set for this role - * @param context $context The context to apply this capability to + * @param int $roleid The Role to set capabilities for + * @param array $rolecapabilities The list of capability =>permission to set for this role + * @param null|context $context The context to apply this capability to */ public function create_role_capability(int $roleid, array $rolecapabilities, context $context = null): void { // Map the capabilities into human-readable names. diff --git a/mod/assign/tests/behat/bulk_remove_submissions.feature b/mod/assign/tests/behat/bulk_remove_submissions.feature index 650e3dd309a..1ee90f43886 100644 --- a/mod/assign/tests/behat/bulk_remove_submissions.feature +++ b/mod/assign/tests/behat/bulk_remove_submissions.feature @@ -36,8 +36,8 @@ Feature: Bulk remove submissions | Test assignment name | student1 | I'm the student1 submission | | Test assignment name | student2 | I'm the student2 submission | And the following "role capability" exists: - | role | Teacher | - | mod/assign:editothersubmission | Allow | + | role | editingteacher | + | mod/assign:editothersubmission | allow | And I am on the "Test assignment name" Activity page logged in as teacher1 And I navigate to "View all submissions" in current page administration And I should see "I'm the student1 submission" @@ -94,29 +94,8 @@ Feature: Bulk remove submissions | Test assignment name | student1 | I'm the student1 submission | | Test assignment name | student2 | I'm the student2 submission | And the following "role capability" exists: - | role | Teacher | - | mod/assign:editothersubmission | Allow | - And I am on the "Test assignment name" Activity page logged in as teacher1 - And I follow "View all submissions" - - @javascript - Scenario: Notification should be displayed when non-group users are selected for submission bulk removal - in separate group mode - Given the following "activity" exists: - | activity | assign | - | course | C1 | - | name | Test assignment name | - | assignsubmission_onlinetext_enabled | 1 | - | assignsubmission_file_enabled | 0 | - | groupmode | 1 | - | submissiondrafts | 0 | - And the following "mod_assign > submissions" exist: - | assign | user | onlinetext | - | Test assignment name | student1 | I'm the student1 submission | - | Test assignment name | student2 | I'm the student2 submission | - Given the following "role capability" exists: - | role | Teacher | - | mod/assign:editothersubmission | Allow | + | role | editingteacher | + | mod/assign:editothersubmission | allow | And I am on the "Test assignment name" Activity page logged in as teacher1 And I navigate to "View all submissions" in current page administration And I should see "I'm the student1 submission" @@ -150,9 +129,8 @@ Feature: Bulk remove submissions | Test assignment name | student1 | I'm the student1 submission | | Test assignment name | student2 | I'm the student2 submission | And the following "role capability" exists: - | role | Teacher | - | mod/assign:editothersubmission | Allow | - + | role | editingteacher | + | mod/assign:editothersubmission | allow | And I am on the "Test assignment name" Activity page logged in as teacher1 And I navigate to "View all submissions" in current page administration And I should see "I'm the student1 submission" diff --git a/mod/assign/tests/behat/remove_submission.feature b/mod/assign/tests/behat/remove_submission.feature index 8bcba800770..d40dc69f87d 100644 --- a/mod/assign/tests/behat/remove_submission.feature +++ b/mod/assign/tests/behat/remove_submission.feature @@ -5,11 +5,8 @@ Feature: Remove a submission I need to remove a student submission at any time Background: - Given the following "role capability" exists: - | role | Teacher | - | mod/assign:editothersubmission | Allow | - And I set the following administration settings values: - | Enable timed assignments | 1 | + Given the following config values are set as admin: + | enabletimelimit | 1 | assign | And the following "courses" exist: | fullname | shortname | category | groupmode | | Course 1 | C1 | 0 | 0 | @@ -23,6 +20,9 @@ Feature: Remove a submission | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | + And the following "role capability" exists: + | role | editingteacher | + | mod/assign:editothersubmission | allow | And the following "groups" exist: | name | course | idnumber | | Group 1 | C1 | G1 | diff --git a/mod/feedback/tests/behat/anonymous.feature b/mod/feedback/tests/behat/anonymous.feature index 04d0841699e..2303cd92af4 100644 --- a/mod/feedback/tests/behat/anonymous.feature +++ b/mod/feedback/tests/behat/anonymous.feature @@ -63,8 +63,8 @@ Feature: Anonymous feedback @javascript Scenario: Complete anonymous feedback and view analysis on the front page as an authenticated user Given the following "role capability" exists: - | role | Authenticated user on frontpage | - | mod/feedback:viewanalysepage | Allow | + | role | frontpage | + | mod/feedback:viewanalysepage | allow | And I log in as "user1" And I am on site homepage When I follow "Site feedback" @@ -127,8 +127,8 @@ Feature: Anonymous feedback Given the following config values are set as admin: | feedback_allowfullanonymous | 1 | And the following "role capability" exists: - | role | Guest | - | mod/feedback:viewanalysepage | Allow | + | role | guest | + | mod/feedback:viewanalysepage | allow | When I follow "Site feedback" And I follow "Preview" And I should see "Do you like our site?" diff --git a/mod/feedback/tests/behat/non_anonymous.feature b/mod/feedback/tests/behat/non_anonymous.feature index 28787a2f1e6..1916b7acd9d 100644 --- a/mod/feedback/tests/behat/non_anonymous.feature +++ b/mod/feedback/tests/behat/non_anonymous.feature @@ -63,8 +63,8 @@ Feature: Non anonymous feedback @javascript Scenario: Complete non anonymous feedback and view analysis on the front page as an authenticated user Given the following "role capability" exists: - | role | Authenticated user on frontpage | - | mod/feedback:viewanalysepage | Allow | + | role | frontpage | + | mod/feedback:viewanalysepage | allow | When I am on the "Site feedback" "feedback activity" page logged in as user1 And I follow "Answer the questions" And I should see "Do you like our site?" diff --git a/my/tests/behat/restrict_available_blocks.feature b/my/tests/behat/restrict_available_blocks.feature index abe0d81c0c1..e1a03a979aa 100644 --- a/my/tests/behat/restrict_available_blocks.feature +++ b/my/tests/behat/restrict_available_blocks.feature @@ -31,7 +31,7 @@ Feature: Restrict which blocks can be added to Dashboard | block/course_list:myaddinstance | prohibit | | block/html:myaddinstance | prohibit | When I log in as "student1" - And I turn editing mode on + And I press "Customise this page" Then the add block selector should not contain "Comments" block And the add block selector should not contain "Courses" block And the add block selector should not contain "HTML" block diff --git a/tag/tests/behat/edit_tag.feature b/tag/tests/behat/edit_tag.feature index e7829f0c67b..b563ec8a045 100644 --- a/tag/tests/behat/edit_tag.feature +++ b/tag/tests/behat/edit_tag.feature @@ -24,11 +24,10 @@ Feature: Users can edit tags to add description or rename @javascript Scenario: User with tag editing capability can change tag description Given the following "role capability" exists: - | role | Tag editor | - | moodle/tag:edit | Allow | - | moodle/site:viewparticipants | Allow | - | moodle/user:viewdetails | Allow | - And I log out + | role | tageditor | + | moodle/tag:edit | allow | + | moodle/site:viewparticipants | allow | + | moodle/user:viewdetails | allow | When I log in as "editor1" And I press "Customise this page" # TODO MDL-57120 site "Tags" link not accessible without navigation block. diff --git a/tag/tests/behat/flag_tags.feature b/tag/tests/behat/flag_tags.feature index e35246a921d..e634137c6df 100644 --- a/tag/tests/behat/flag_tags.feature +++ b/tag/tests/behat/flag_tags.feature @@ -18,9 +18,9 @@ Feature: Users can flag tags and manager can reset flags | name | isstandard | | Neverusedtag | 1 | And the following "role capability" exists: - | role | Authenticated user | - | moodle/site:viewparticipants | Allow | - | moodle/user:viewdetails | Allow | + | role | user | + | moodle/site:viewparticipants | allow | + | moodle/user:viewdetails | allow | And I log in as "user2" And I press "Customise this page" # TODO MDL-57120 site "Tags" link not accessible without navigation block. diff --git a/user/tests/behat/enrol_cohort_list.feature b/user/tests/behat/enrol_cohort_list.feature index 46e02159ea3..3f09a38415e 100644 --- a/user/tests/behat/enrol_cohort_list.feature +++ b/user/tests/behat/enrol_cohort_list.feature @@ -22,9 +22,9 @@ Feature: Viewing the list of cohorts to enrol in a course | idnumber | 1337 | | description | Test cohort description | And the following "role capability" exists: - | role | Teacher | - | moodle/cohort:manage | Prohibit | - | moodle/cohort:view | Prohibit | + | role | editingteacher | + | moodle/cohort:manage | prohibit | + | moodle/cohort:view | prohibit | And I log out And I am on the "Course 1" course page logged in as teacher1 And I navigate to course participants diff --git a/user/tests/behat/filter_participants.feature b/user/tests/behat/filter_participants.feature index 548f002c17e..e3cb2d437d2 100644 --- a/user/tests/behat/filter_participants.feature +++ b/user/tests/behat/filter_participants.feature @@ -733,8 +733,8 @@ Feature: Course participants can be filtered @javascript @skip_chrome_zerosize Scenario: Filter by user identity fields when cannot see the field data Given the following "role capability" exists: - | role | Teacher | - | moodle/site:viewuseridentity | Prevent | + | role | editingteacher | + | moodle/site:viewuseridentity | prevent | And I log in as "admin" And the following config values are set as admin: | showuseridentity | idnumber,email,city,country | diff --git a/user/tests/behat/user_grade_navigation.feature b/user/tests/behat/user_grade_navigation.feature index d8aea0c2db0..0a20f48ebbb 100644 --- a/user/tests/behat/user_grade_navigation.feature +++ b/user/tests/behat/user_grade_navigation.feature @@ -60,9 +60,14 @@ Feature: The student can navigate to their grades page and user grade report. Then I should see "My badges from Acceptance test site web site" Scenario: Log in as a parent and view a childs grades. - Given the following "roles" exist: - | shortname | name | archetype | context_user | moodle/user:editprofile | moodle/user:viewalldetails | moodle/user:viewuseractivitiesreport | moodle/user:viewdetails | - | Parent | Parent | | 1 | allow | allow | allow | allow | + Given the following "role" exists: + | shortname | Parent | + | name | Parent | + | context_user | 1 | + | moodle/user:editprofile | allow | + | moodle/user:viewalldetails | allow | + | moodle/user:viewuseractivitiesreport | allow | + | moodle/user:viewdetails | allow | When I log in as "admin" And I am on site homepage And I turn editing mode on diff --git a/user/tests/behat/view_preferences_page.feature b/user/tests/behat/view_preferences_page.feature index 86c410ea969..18fa6489ced 100644 --- a/user/tests/behat/view_preferences_page.feature +++ b/user/tests/behat/view_preferences_page.feature @@ -52,9 +52,14 @@ Feature: Access to preferences page Then I should see "Preferences" in the "region-main" "region" Scenario: A user with the appropriate permissions can view another user's permissions page. - Given the following "roles" exist: - | shortname | name | archetype | context_user | moodle/user:editprofile | moodle/user:viewalldetails | moodle/user:viewuseractivitiesreport | moodle/user:viewdetails | - | Parent | Parent | | 1 | allow | allow | allow | allow | + Given the following "role" exists: + | shortname | Parent | + | name | Parent | + | context_user | 1 | + | moodle/user:editprofile | allow | + | moodle/user:viewalldetails | allow | + | moodle/user:viewuseractivitiesreport | allow | + | moodle/user:viewdetails | allow | When I log in as "admin" And I am on site homepage And I follow "Turn editing on"