diff --git a/admin/tool/behat/tests/behat/edit_permissions.feature b/admin/tool/behat/tests/behat/edit_permissions.feature index 26d4f42918bd2..29f798193a761 100644 --- a/admin/tool/behat/tests/behat/edit_permissions.feature +++ b/admin/tool/behat/tests/behat/edit_permissions.feature @@ -15,7 +15,6 @@ Feature: Edit capabilities | user | course | role | | teacher1 | C1 | editingteacher | - @javascript Scenario: Default system capabilities modification Given I log in as "admin" And I set the following system permissions of "Teacher" role: @@ -30,7 +29,6 @@ Feature: Edit capabilities And "moodle/grade:managesharedforms" capability has "Prevent" permission And "moodle/course:request" capability has "Prohibit" permission - @javascript Scenario: Course capabilities overrides Given I log in as "teacher1" And I follow "Course 1" @@ -41,11 +39,11 @@ Feature: Edit capabilities | mod/forum:editanypost | Prevent | | mod/forum:addquestion | Allow | When I set the field "Advanced role override" to "Student (3)" + And I press "Go" Then "mod/forum:deleteanypost" capability has "Prohibit" permission And "mod/forum:editanypost" capability has "Prevent" permission And "mod/forum:addquestion" capability has "Allow" permission - @javascript Scenario: Module capabilities overrides Given I log in as "teacher1" And I follow "Course 1" @@ -60,6 +58,7 @@ Feature: Edit capabilities | mod/forum:editanypost | Prevent | | mod/forum:addquestion | Allow | When I set the field "Advanced role override" to "Student (3)" + And I press "Go" Then "mod/forum:deleteanypost" capability has "Prohibit" permission And "mod/forum:editanypost" capability has "Prevent" permission And "mod/forum:addquestion" capability has "Allow" permission diff --git a/blocks/tests/behat/restrict_available_blocks.feature b/blocks/tests/behat/restrict_available_blocks.feature index 4b1fd5a80ef78..363714c00e591 100644 --- a/blocks/tests/behat/restrict_available_blocks.feature +++ b/blocks/tests/behat/restrict_available_blocks.feature @@ -24,7 +24,6 @@ Feature: Allowed blocks controls Then I should see "Activities" in the "Activities" "block" And I should see "Course completion status" in the "Course completion status" "block" - @javascript Scenario: Blocks 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: diff --git a/course/tests/behat/navigate_course_list.feature b/course/tests/behat/navigate_course_list.feature index 529ae6a230dc6..f1c2e880b156a 100644 --- a/course/tests/behat/navigate_course_list.feature +++ b/course/tests/behat/navigate_course_list.feature @@ -42,7 +42,6 @@ Feature: Browse course list and return back from enrolment page And I press "Continue" Then I should see "Edit profile" in the ".breadcrumb-nav" "css_element" - @javascript Scenario: User can return to the choice activity from enrolment page Given the following "roles" exist: | name | shortname | description | archetype | diff --git a/course/tests/behat/restrict_available_activities.feature b/course/tests/behat/restrict_available_activities.feature index 2140e1602f154..6fc056877ecc9 100644 --- a/course/tests/behat/restrict_available_activities.feature +++ b/course/tests/behat/restrict_available_activities.feature @@ -29,7 +29,6 @@ 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: diff --git a/group/tests/behat/create_groups.feature b/group/tests/behat/create_groups.feature index 3e34a4ca80ded..4d07c441215d6 100644 --- a/group/tests/behat/create_groups.feature +++ b/group/tests/behat/create_groups.feature @@ -57,7 +57,6 @@ Feature: Organize students into groups And I should see "Student 3" And I should not see "Student 0" - @javascript Scenario: Create groups and groupings without the 'moodle/course:changeidnumber' capability Given the following "courses" exist: | fullname | shortname | category | groupmode | diff --git a/lib/tests/behat/behat_permissions.php b/lib/tests/behat/behat_permissions.php index cc1ef38d419cc..4b932b6cd7db0 100644 --- a/lib/tests/behat/behat_permissions.php +++ b/lib/tests/behat/behat_permissions.php @@ -74,12 +74,15 @@ public function i_override_the_system_permissions_of_role_with($rolename, $table // We don't know the number of overrides so we have to get it to match the option contents. $roleoption = $this->find('xpath', '//select[@name="roleid"]/option[contains(.,"' . $this->escape($rolename) . '")]'); - return array( + $result = array( new Given('I set the field "' . get_string('advancedoverride', 'role') . - '" to "' . $this->escape($roleoption->getText()) . '"'), - new Given('I fill the capabilities form with the following permissions:', $table), - new Given('I press "' . get_string('savechanges') . '"') - ); + '" to "' . $this->escape($roleoption->getText()) . '"')); + if (!$this->running_javascript()) { + $result[] = new Given('I press "' . get_string('go') . '"'); + } + $result[] = new Given('I fill the capabilities form with the following permissions:', $table); + $result[] = new Given('I press "' . get_string('savechanges') . '"'); + return $result; } /** @@ -132,7 +135,8 @@ public function i_fill_the_capabilities_form_with_the_following_permissions($tab // Here we wait for the element to appear and exception if it does not exist. $radio = $this->find('xpath', '//input[@name="' . $capability . '" and @value="' . $permissionvalue . '"]'); - $radio->click(); + $field = behat_field_manager::get_field_instance('radio', $radio, $this->getSession()); + $field->set_value(1); } } diff --git a/mod/forum/tests/behat/separate_group_discussions.feature b/mod/forum/tests/behat/separate_group_discussions.feature index 3810bdfdc35b9..86d4e08645b5e 100644 --- a/mod/forum/tests/behat/separate_group_discussions.feature +++ b/mod/forum/tests/behat/separate_group_discussions.feature @@ -56,7 +56,6 @@ Feature: Posting to all groups in a separate group discussion is restricted to u And the "Group" select box should contain "Group B" And I should see "Post a copy to all groups" - @javascript Scenario: Teacher in all groups but without accessallgroups can only post in their groups And I log in as "admin" And I set the following system permissions of "Non-editing teacher" role: @@ -71,7 +70,6 @@ Feature: Posting to all groups in a separate group discussion is restricted to u And the "Group" select box should contain "Group B" And I should see "Post a copy to all groups" - @javascript Scenario: Teacher in some groups and without accessallgroups can only post in their groups And I log in as "admin" And I set the following system permissions of "Non-editing teacher" role: 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 9699a303028b7..7fda1f22d68c8 100644 --- a/mod/forum/tests/behat/separate_group_single_group_discussions.feature +++ b/mod/forum/tests/behat/separate_group_single_group_discussions.feature @@ -66,7 +66,6 @@ Feature: Posting to groups in a separate group discussion when restricted to gro And the "Group" select box should contain "G2G1" And I should see "Post a copy to all groups" - @javascript Scenario: Teacher in all groups but without accessallgroups can post in either group but not to All Participants And I log in as "admin" And I set the following system permissions of "Non-editing teacher" role: diff --git a/my/tests/behat/restrict_available_blocks.feature b/my/tests/behat/restrict_available_blocks.feature index 618bf8ec5309d..72c01055d55d5 100644 --- a/my/tests/behat/restrict_available_blocks.feature +++ b/my/tests/behat/restrict_available_blocks.feature @@ -25,7 +25,6 @@ Feature: Restrict which blocks can be added to Dashboard And the "Add a block" select box should contain "HTML" And the "Add a block" select box should contain "Tags" - @javascript Scenario: Remove the ability to add the comments block to Dashboard When I log in as "admin" And I set the following system permissions of "Authenticated user" role: diff --git a/user/tests/behat/view_full_profile.feature b/user/tests/behat/view_full_profile.feature index f585eb8054ea4..c6eb29530aa1d 100644 --- a/user/tests/behat/view_full_profile.feature +++ b/user/tests/behat/view_full_profile.feature @@ -49,7 +49,6 @@ Feature: Access to full profiles of users And I follow "Full profile" Then I should see "First access to site" - @javascript Scenario: Viewing full profiles with global permission Given I log in as "admin" And I set the following system permissions of "Authenticated user" role: