Skip to content

Commit

Permalink
Merge branch 'MDL-70152-master' of https://github.com/andelacruz/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyatregubov committed Jun 14, 2023
2 parents 41efec8 + c95ef35 commit 9611669
Show file tree
Hide file tree
Showing 81 changed files with 638 additions and 1,258 deletions.
8 changes: 2 additions & 6 deletions admin/tool/behat/tests/behat/edit_permissions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,12 @@ Feature: Edit capabilities
And "mod/forum:addquestion" capability has "Allow" permission

Scenario: Module capabilities overrides
Given I log in as "teacher1"
And the following "activity" exists:
Given 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 follow "I'm the name"
And I am on the "I'm the name" "forum activity" page logged in as teacher1
And I navigate to "Permissions" in current page administration
And I override the system permissions of "Student" role with:
| mod/forum:deleteanypost | Prohibit |
Expand Down
10 changes: 3 additions & 7 deletions admin/tool/usertours/tests/behat/tour_filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,10 @@ Feature: Apply tour filters to a tour
| Course 1 | C1 | topics | 1 |
| Course 2 | C2 | topics | 1 |
And the following "activities" exist:
| activity | course | name | firstpagetitle | wikimode |
| wiki | C1 | Test wiki name | First page | collaborative |
| activity | course | name | firstpagetitle | wikimode | idnumber | intro | type |
| wiki | C1 | Test wiki name | First page | collaborative | | | |
| forum | C2 | Test forum name | | | 001 | Test forum description | general |
And I log in as "admin"
And I am on "Course 2" 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 |
And I add a new user tour with:
| Name | Wiki tour |
| Description | A tour with both matches |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,18 @@ Feature: availability_completion
@javascript
Scenario: Test completion and course cache rebuild
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| forum | forum 1 | forum 1 | C1 | forum1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I open "forum 1" actions menu
And I click on "Edit settings" "link" in the "forum 1" activity
| activity | name | course | idnumber |
| forum | forum 1 | C1 | forum1 |
And the following forum discussions exist in course "Course 1":
| user | forum | name | message |
| student1 | forum 1 | Forum posst 1 | This is the body |
And I am on the "forum 1" "forum activity editing" page logged in as teacher1
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| completionview | 1 |
| completionpostsenabled | 1 |
| completionposts | 2 |
And I press "Save and return to course"
And I add a new discussion to "forum 1" forum with:
| Subject | Forum post 1 |
| Message | This is the body |
And I am on "Course 1" course homepage with editing mode on
And I add a "Page" to section "2"
And I set the following fields to these values:
Expand All @@ -87,25 +84,18 @@ Feature: availability_completion
| Required completion status | must be marked complete |
| cm | forum 1 |
And I press "Save and return to course"
And I log out
And I log in as "student1"
When I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
# Page 2 should not appear yet.
Then I should not see "Page 2" in the "region-main" "region"
And I click on "forum 1" "link" in the "region-main" "region"
# Page 2 should not appear yet.
And I should not see "Page 2" in the "region-main" "region"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "forum 1" "forum activity editing" page
And I am on the "forum 1" "forum activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the following fields to these values:
| completionpostsenabled | 0 |
And I press "Save and display"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I click on "forum 1" "link" in the "region-main" "region"
And I am on "Course 1" course homepage
And I should see "Page 2" in the "region-main" "region"
15 changes: 6 additions & 9 deletions availability/tests/behat/edit_availability.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Feature: edit_availability
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | forum |
| course | C1 |
| name | MyForum |

Scenario: Confirm the 'enable availability' option is working
Given the following config values are set as admin:
Expand Down Expand Up @@ -178,9 +182,7 @@ Feature: edit_availability
# Button does not exist when conditional access restrictions are turned off.
Given the following config values are set as admin:
| enableavailability | 0 |
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 am on the "MyForum" "forum activity editing" page logged in as admin
When I expand all fieldsets
Then "Add group/grouping access restriction" "button" should not exist

Expand All @@ -190,12 +192,7 @@ Feature: edit_availability
Given the following "groupings" exist:
| name | course | idnumber |
| GX1 | C1 | GXI1 |
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 set the following fields to these values:
| Forum name | MyForum |
| Description | x |
And I am on the "MyForum" "forum activity editing" page logged in as admin
When I expand all fieldsets
Then the "Add group/grouping access restriction" "button" should be disabled

Expand Down
21 changes: 10 additions & 11 deletions backup/util/ui/tests/behat/restore_moodle2_courses.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ Feature: Restore Moodle 2 course backups
| Course 3 | C3 | 0 | topics | 2 | 0 |
| Course 4 | C4 | 0 | topics | 20 | 0 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | section | externalurl |
| assign | C3 | assign1 | Test assign name | Assign description | 1 | |
| data | C3 | data1 | Test database name | Database description | 2 | |
| url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org |
| activity | course | idnumber | name | intro | section | externalurl |
| assign | C3 | assign1 | Test assign name | Assign description | 1 | |
| data | C3 | data1 | Test database name | Database description | 2 | |
| forum | C1 | 0001 | Test forum name | | 1 | |
| url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org |
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 | Test forum name |
| Description | Test forum description |
And I add the "Activities" block

@javascript
Expand Down Expand Up @@ -63,10 +61,11 @@ Feature: Restore Moodle 2 course backups
Scenario: Restore a backup into the same course removing it's contents before that
When I backup "Course 1" course using this options:
| Confirmation | Filename | test_backup.mbz |
And I am on "Course 1" course homepage
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum post backup name |
| Description | Test forum post backup description |
And the following "activity" exists:
| activity | forum |
| course | C1 |
| section | 1 |
| name | Test forum post backup name |
And I am on the "Course 1" "restore" page
And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options:
| Schema | Section 3 | 0 |
Expand Down
17 changes: 6 additions & 11 deletions blocks/navigation/tests/behat/participants_link.feature
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,15 @@ Feature: Displaying the link to the Participants page

@javascript
Scenario: Course participants link is displayed to users depending on role permissions settings
And I log in as "admin"
And I am on "Course1" 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 the "Course1" "enrolment methods" page
Given the following "activities" exist:
| activity | course | name |
| forum | C1 | Test forum name |
And I am on the "Course1" "enrolment methods" page logged in as admin
And I click on "Edit" "link" in the "Guest access" "table_row"
And I set the following fields to these values:
| Allow guest access | Yes |
And I press "Save changes"
And I log out
When I log in as "guest"
And I am on "Course1" course homepage
When I am on the "Course1" course page logged in as guest
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"
Expand All @@ -60,8 +56,7 @@ Feature: Displaying the link to the Participants page
And I set the following system permissions of "Guest" role:
| capability | permission |
| moodle/course:viewparticipants | Allow |
And I log in as "guest"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as guest
And I should see "Participants" in the "Navigation" "block"
And I am on the "Test forum name" "forum activity" page
And I should see "Participants" in the "Navigation" "block"
Expand Down
Loading

0 comments on commit 9611669

Please sign in to comment.