MDL-78158 Behat: Use data generators to add blocks

This commit is contained in:
Angelia Dela Cruz
2023-07-04 09:42:15 +08:00
parent b82cf9a27d
commit 7df31a7cd0
55 changed files with 279 additions and 239 deletions
@@ -4,29 +4,29 @@ Feature: Import course's contents into another course
As a teacher
I need to import a course contents into another course selecting what I want to import
Scenario: Import course's contents to another course
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C2 | editingteacher |
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 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
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C2 | editingteacher |
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 the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
| blog_recent | Course | C1 | course-view-* | side-pre |
When I import "Course 1" course into "Course 2" course using this options:
Then I should see "Test database name"
And I should see "Test forum name"
@@ -17,9 +17,11 @@ Feature: Restore Moodle 2 course backups
| 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 the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_modules | Course | C1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add the "Activities" block
@javascript
Scenario: Restore a course in another existing course
@@ -18,12 +18,13 @@ 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 the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_results | Course | C1 | course-view-* | side-pre |
And I am on "Course 1" course homepage
And I add the "Activity results" block
And I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 1 |
@@ -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,14 +50,10 @@ 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 the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_results | Course | C1 | course-view-* | side-pre |
And I am on "Course 1" course homepage
And I add the "Activity results" block
When I configure the "Activity results" block
And the following fields match these values:
| id_config_showbest | 0 |
@@ -14,11 +14,9 @@ Feature: Enable Block Badges on the frontpage and view awarded badges
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Latest badges" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| badges | System | 1 | site-index | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage
# Issue badge 1 of 2
@@ -18,15 +18,17 @@ Feature: Enable Block blog menu in an activity
| 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 "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
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 the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Activity module | 0001 | mod-assign-view | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"
@@ -18,10 +18,9 @@ Feature: Students can use block blog menu in a course
| 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 the "Blog menu" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Course | C1 | course-view-* | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"
@@ -8,11 +8,9 @@ Feature: Enable Block blog menu on the frontpage
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | student1@example.com | S1 |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Blog menu" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | System | 1 | site-index | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"
@@ -18,16 +18,18 @@ Feature: Students can use the recent blog entries block to view recent entries o
| 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 "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
And I log out
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 the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Activity module | 0001 | mod-assign-view | side-pre |
| blog_recent | Activity module | 0001 | mod-assign-view | side-pre |
Scenario: Students use the recent blog entries block to view blogs
Given I log in as "student1"
@@ -16,13 +16,12 @@ Feature: Students can use the recent blog entries block to view recent entries o
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Course | C1 | course-view-* | side-pre |
| blog_recent | Course | C1 | course-view-* | side-pre |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Blog menu" block
And I add the "Recent blog entries" block
And I log out
Scenario: Students use the recent blog entries block to view blogs
Given I log in as "student1"
@@ -8,10 +8,14 @@ Feature: Feature: Students can use the recent blog entries block to view recent
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | student1@example.com | S1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_recent | System | 1 | site-index | side-pre |
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Recent blog entries" block
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I log out
@@ -89,9 +89,10 @@ Feature: Enable the calendar block in a course and test it's functionality
@javascript
Scenario: View a user event in the calendar block
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Calendar" block
Given the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_month | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I create a calendar event with form data:
| id_eventtype | User |
| id_name | User Event |
@@ -9,10 +9,10 @@ Feature: Enable the calendar block on the site front page
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | student1@example.com | S1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_month | System | 1 | site-index | side-pre |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Calendar" block
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | Site Event |
@@ -8,6 +8,9 @@ Feature: View a site event on the frontpage
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_upcoming | System | 1 | site-index | side-pre |
@javascript
Scenario: View a site event in the upcoming events block on the frontpage
@@ -15,9 +18,6 @@ Feature: View a site event on the frontpage
And I create a calendar event with form data:
| id_eventtype | Site |
| id_name | My Site Event |
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Upcoming events" block
And I log out
When I log in as "teacher1"
And I am on site homepage
@@ -16,10 +16,9 @@ Feature: Add a comment to the comments block
| 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 the "Comments" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I log in as "student1"
And I am on "Course 1" course homepage
@@ -19,10 +19,12 @@ Feature: Enable Block comments on an activity page and view comments
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| page | C1 | page1 | Test page name | Test page description |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Activity module | page1 | mod-page-* | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name"
And I add the "Comments" block
And I follow "Show comments"
And I add "I'm a comment from the teacher" comment to comments block
And I log out
@@ -16,9 +16,11 @@ Feature: Enable Block comments on a course page and view comments
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Comments" block
And I follow "Show comments"
And I add "I'm a comment from the teacher" comment to comments block
And I log out
@@ -8,10 +8,11 @@ Feature: Enable Block comments on the frontpage and view comments
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | System | 1 | site-index | side-pre |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Comments" block
And I follow "Show comments"
And I add "I'm a comment from admin" comment to comments block
And I log out
@@ -17,10 +17,9 @@ Feature: Delete comment block messages
| 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 the "Comments" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I log in as "student1"
And I am on "Course 1" course homepage
And I add "Comment from student1" comment to comments block
@@ -18,11 +18,13 @@ Feature: Enable Block Completion in a course using manual completion by others
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | teacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| completionstatus | Course | C1 | course-view-* | side-pre |
Scenario: Add the block to a the course and mark a student complete.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Course completion status" block
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
@@ -54,7 +56,6 @@ Feature: Enable Block Completion in a course using manual completion by others
Scenario: Add the block to a the course and require multiple roles to mark a student complete.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Course completion status" block
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
@@ -16,10 +16,12 @@ Feature: Enable Block Completion in a course using manual self completion
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| completionstatus | Course | C1 | course-view-* | side-pre |
| selfcompletion | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Course completion status" block
And I add the "Self completion" block
And I navigate to "Course completion" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
@@ -16,10 +16,9 @@ Feature: Course summary block used in a course
| user | course | role |
| student1 | C101 | student |
| teacher1 | C101 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Course/site summary" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| course_summary | Course | C101 | course-view-* | side-pre |
Scenario: Student can view course summary
When I log in as "student1"
@@ -6,9 +6,11 @@ Feature: Course summary block used on the frontpage
Background:
Given I log in as "admin"
And I enable "course_summary" "block" plugin
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| course_summary | System | 1 | site-index | side-pre |
And I am on site homepage
And I turn editing mode on
And I add the "Course/site summary" block
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| summary | Proved the summary block works! |
+4 -7
View File
@@ -8,19 +8,16 @@ Feature: Login from a block
Given the following "users" exist:
| username | password | firstname | lastname | email |
| testuser | testpass | Test | User | student1@example.com |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Login" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| login | System | 1 | site-index | side-pre |
Scenario: Login block visible to non-logged in users
Given I log out
When I am on homepage
Then "Login" "block" should exist
Scenario: Login as student through login block
Given I log out
And I am on homepage
Given I am on homepage
When I set the field "Username" to "testuser"
And I set the field "Password" to "testpass"
And I click on "Log in" "button" in the "Login" "block"
@@ -17,8 +17,8 @@ Feature: The logged in user block allows users to view their profile information
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| page | C1 | page1 | Test page name | Test page description |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name"
When I add the "Logged in user" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| myprofile | Activity module | page1 | mod-page-* | side-pre |
When I am on the "Test page name" "page activity" page logged in as teacher1
Then I should see "Teacher One" in the "Logged in user" "block"
@@ -8,11 +8,9 @@ Feature: The logged in user block allows users to view their profile information
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | One | teacher1@example.com | T1 |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Logged in user" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| myprofile | System | 1 | site-index | side-pre |
Scenario: Try to view the logged in user block as a guest
Given I log in as "guest"
@@ -9,17 +9,16 @@ Feature: Latest announcements block displays the course latest news
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And I log in as "admin"
And I create a course with:
| Course full name | Course 1 |
| Course short name | C1 |
| Number of announcements | 5 |
And I enrol "Teacher 1" user as "Teacher"
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 the "Latest announcements" block
And I turn editing mode off
And the following "courses" exist:
| fullname | shortname | category | newsitems |
| Course 1 | C1 | 0 | 5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| news_items | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" Course page logged in as teacher1
When I add a new topic to "Announcements" forum with:
| Subject | Discussion One |
| Message | Not important |
@@ -17,10 +17,10 @@ Feature: The private files block allows users to store files privately in moodle
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| page | C1 | page1 | Test page name | Test page description |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I am on the "Test page name" "page activity" page
And I add the "Private files" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | Activity module | page1 | mod-page-* | side-pre |
And I am on the "Test page name" "page activity" page logged in as teacher1
And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..."
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
@@ -14,9 +14,11 @@ Feature: The private files block allows users to store files privately in moodle
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Private files" block
And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..."
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
@@ -11,11 +11,9 @@ Feature: The private files block allows users to store files privately in moodle
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Private files" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | site-index | side-pre |
Scenario: Try to view the private files block as a guest
Given I log in as "guest"
@@ -16,14 +16,15 @@ Feature: The search forums block allows users to search for forum posts on cours
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| news_items | Course | C1 | course-view-* | side-pre |
| search_forums | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I set the field "id_newsitems" to "1"
And I press "Save and display"
And I turn editing mode on
And I add the "Latest announcements" block
And I add the "Search forums" block
And I log out
Scenario: Use the search forum block in a course without any forum posts
@@ -8,11 +8,9 @@ Feature: The search forums block allows users to search for forum posts on front
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| student1 | Student | 1 | student1@example.com | S1 |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Search forums" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | System | 1 | site-index | side-pre |
Scenario: Use the search forum block on the frontpage and search for posts as a user
Given I log in as "student1"
@@ -4,12 +4,19 @@ Feature: Add URL to main menu block
As a admin
I need to add URLs to the main menu block and check it works.
Background:
Given the following "courses" exist:
| fullname | shortname | category | enablecompletion |
| Course 1 | C1 | 0 | 1 |
| Course 2 | C2 | 0 | |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| site_main_menu | System | 1 | site-index | side-pre |
@javascript
Scenario: Add a URL in menu block and ensure it appears
Given I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Main menu" block
And the following "activity" exists:
| activity | url |
| course | Acceptance test site |
@@ -17,7 +24,7 @@ Feature: Add URL to main menu block
| intro | gooooooooogle |
| externalurl | http://www.google.com |
| section | 0 |
When I am on the "google" "url activity editing" page
When I am on the "reference link" "url activity editing" page
And I expand all fieldsets
And I set the following fields to these values:
| id_display | In pop-up |
@@ -11,10 +11,12 @@ Feature: Edit activities in main menu block
| course | Acceptance test site |
| name | My forum name |
| idnumber | forum |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| site_main_menu | System | 1 | site-index | side-pre |
And I log in as "admin"
And I am on site homepage
And I navigate to "Turn editing on" in current page administration
And I add the "Main menu" block
When I set the field "Edit title" in the "My forum name" "block_site_main_menu > Activity" to "New forum name"
Then I should not see "My forum name"
And I should see "New forum name"
@@ -35,11 +35,14 @@ Feature: Edit activities in social activities block
Scenario: Activities in social activities block can be made available but not visible on a course page
Given the following config values are set as admin:
| allowstealth | 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| recent_activity | Course | C1 | course-view-* | side-pre |
And I log in as "user1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I set the field "Add an activity to section 'section 0'" to "Forum"
And I set the field "Forum name" to "My forum name"
And I set the field "Forum name" to "My forum name"
And I press "Save and return to course"
And "My forum name" activity in social activities block should have "Hide" editing icon
And "My forum name" activity in social activities block should not have "Show" editing icon
@@ -11,12 +11,14 @@ Feature: Show hidden blocks in a docked block region when editing
And the following "course enrolments" exist:
| user | course | role |
| admin | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | Course | C1 | course-view-* | side-pre |
| news_items | Course | C1 | course-view-* | side-pre |
| calendar_upcoming | Course | C1 | course-view-* | side-pre |
| recent_activity | Course | C1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add the "Search forums" block
And I add the "Latest announcements" block
And I add the "Upcoming events" block
And I add the "Recent activity" block
# Hide all the blocks in the non-default region
And I configure the "Search forums" block
And I set the following fields to these values:
+5 -3
View File
@@ -8,18 +8,20 @@ Feature: Block visibility
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| search_forums | Course | C1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Hiding all blocks on the page should remove the column they're in
Given I add the "Search forums" block
And I open the "Search forums" blocks action menu
When I open the "Search forums" blocks action menu
And I click on "Configure Search forums block" "link" in the "Search forums" "block"
And I set the field "Region" to "Right"
And I press "Save changes"
And I turn editing mode off
And ".empty-region-side-post" "css_element" should not exist in the "body" "css_element"
Then ".empty-region-side-post" "css_element" should not exist in the "body" "css_element"
And I turn editing mode on
And I open the "Search forums" blocks action menu
And I click on "Hide Search forums block" "link" in the "Search forums" "block"
+3 -1
View File
@@ -22,9 +22,11 @@ Feature: Block appearances
| book | Test book name |
| title | Book title |
| content | Book content test test |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I am on the "Course 1" course page logged in as teacher1
And I turn editing mode on
And I add the "Comments" block
And I configure the "Comments" block
And I set the following fields to these values:
| Display on page types | Any page |
+3 -1
View File
@@ -22,9 +22,11 @@ Feature: Block region moving
| book | Test book name |
| title | Book title |
| content | Book content test test |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Comments" block
And I configure the "Comments" block
And I set the following fields to these values:
| Display on page types | Any page |
+4 -5
View File
@@ -21,6 +21,7 @@ Feature: Perform basic calendar functionality
| student1 | C1 | student |
| student3 | C1 | student |
| teacher1 | C1 | teacher |
| admin | C1 | editingteacher |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
@@ -28,10 +29,9 @@ Feature: Perform basic calendar functionality
| user | group |
| student1 | G1 |
| teacher1 | G1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add the "Calendar" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_month | Course | C1 | course-view-* | side-pre |
@javascript
Scenario: Create a site event
@@ -195,7 +195,6 @@ Feature: Perform basic calendar functionality
Scenario: Admin can only see all courses if calendar_adminseesall setting is enabled.
Given I log in as "admin"
And I am on "Course 1" course homepage
And I enrol "admin" user as "Teacher"
And I am viewing site calendar
And I click on "New event" "button"
And I set the field "Type of event" to "Course"
@@ -14,12 +14,14 @@ Feature: Limit displayed upcoming events
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| calendar_month | Course | C1 | course-view-* | side-pre |
| calendar_upcoming | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
Scenario: I view calendar details for a future event
Given I am on "Course 1" course homepage with editing mode on
And I add the "Calendar" block
And I add the "Upcoming events" block
And I follow "This month"
And I click on "a.next" "css_element"
And I click on "a.next" "css_element"
@@ -6,8 +6,8 @@ Feature: Allow teachers to manually mark users as complete when configured
Scenario: Mark a student as complete using the completion report
Given the following "courses" exist:
| fullname | shortname | category |
| Completion course | CC1 | 0 |
| fullname | shortname | category | enablecompletion |
| Completion course | CC1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | First | student1@example.com |
@@ -16,14 +16,14 @@ Feature: Allow teachers to manually mark users as complete when configured
| user | course | role |
| student1 | CC1 | student |
| teacher1 | CC1 | editingteacher |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| completionstatus | Course | CC1 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Completion course" course homepage
And completion tracking is "Enabled" in current course
And I follow "Course completion"
And I navigate to "Course completion" in current page administration
And I set the field "Teacher" to "1"
And I press "Save changes"
And I turn editing mode on
And I add the "Course completion status" block
And I log out
And I log in as "student1"
And I am on "Completion course" course homepage
@@ -19,6 +19,9 @@ Feature: Toggle activities visibility from the course page
And the following "activities" exist:
| activity | course | section | idnumber | name | intro | id_visible |
| assign | C1 | 1 | 1 | Test assignment name | Test assignment description | 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| recent_activity | Course | C1 | course-view-* | side-pre |
@javascript
Scenario: Hide/Show toggle with javascript enabled
@@ -77,7 +80,6 @@ Feature: Toggle activities visibility from the course page
| visible | 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
When I hide section "2"
Then "Test forum name" activity should be hidden
And I open "Test forum name" actions menu
@@ -117,7 +119,6 @@ Feature: Toggle activities visibility from the course page
| allowstealth | 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
When I open "Test assignment name" actions menu
Then "Test assignment name" actions menu should not have "Show" item
And "Test assignment name" actions menu should have "Hide" item
@@ -299,11 +299,9 @@ Feature: Group assignment submissions
And the following "mod_assign > submissions" exist:
| assign | user | onlinetext |
| Test assignment name | student1 | I'm the student's first submission |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Activities" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_modules | Course | C1 | course-view-* | side-pre |
And I am on the "C1" Course page logged in as student1
And I click on "Assignments" "link" in the "Activities" "block"
@@ -33,7 +33,6 @@ Feature: Set availability dates for an assignment
And I should see "This assignment will accept submissions from"
And I should see "##tomorrow noon##%A, %d %B %Y, %I:%M %p##"
@javascript
Scenario: Student can see the assignment's due date in the course calendar
Given the following "activity" exists:
| activity | assign |
+33 -18
View File
@@ -9,15 +9,20 @@ 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 the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Activity module | choice1 | mod-choice-* | side-pre |
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"
When I configure the "Blog menu" block
And I press "Save changes"
@@ -40,15 +45,20 @@ 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 the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Activity module | choice1 | mod-choice-* | side-pre |
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"
When I configure the "Blog menu" block
And I press "Save changes"
@@ -70,15 +80,20 @@ 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 the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| blog_menu | Activity module | choice1 | mod-choice-* | side-pre |
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"
When I configure the "Blog menu" block
And I press "Save changes"
+3 -4
View File
@@ -17,10 +17,9 @@ Feature: Users can view the list of data activities and their formatted descript
| activity | name | intro | course | idnumber |
| data | Test database 1 | This is an intro without an image | C1 | data1 |
| data | Test database 2 | This is an intro with an image: <img src="@@PLUGINFILE@@/some_image.jpg"> | C1 | data2 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add the "Activities" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_modules | Course | C1 | course-view-* | side-pre |
Scenario: Teachers can view the list of data activities and their formatted descriptions
Given I log in as "teacher1"
@@ -34,6 +34,12 @@ Feature: Mapping courses in a feedback
| activity | name | course | idnumber | anonymous | publish_stats | section |
| feedback | Course feedback | Acceptance test site | feedback0 | 1 | 1 | 1 |
| feedback | Another feedback | C1 | feedback1 | 1 | 1 | 0 |
And I enable "feedback" "block" plugin
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| feedback | Course | C1 | course-view-* | side-pre |
| feedback | Course | C2 | course-view-* | side-pre |
| feedback | Course | C3 | course-view-* | side-pre |
When I log in as "manager"
And I am on site homepage
And I follow "Course feedback"
@@ -53,14 +59,6 @@ Feature: Mapping courses in a feedback
| Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
| Multiple choice values | option d\noption e\noption f |
And I log out
And I log in as "teacher"
And I am on "Course 1" course homepage with editing mode on
And I add the "Feedback" block
And I am on "Course 2" course homepage
And I add the "Feedback" block
And I am on "Course 3" course homepage
And I add the "Feedback" block
And I log out
Scenario: Course feedback can not be mapped
And I log in as "manager"
@@ -21,9 +21,11 @@ Feature: The forum search allows users to perform advanced searches for forum po
And the following "tags" exist:
| name | isstandard |
| SearchedTag | 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| news_items | Course | C1 | course-view-* | side-pre |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Latest announcements" block
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the field "id_newsitems" to "1"
@@ -41,12 +41,13 @@ Feature: Students can edit or delete their forum posts within a set time limit
@javascript @block_recent_activity
Scenario: Time limit expires
Given I log out
Given the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| recent_activity | Course | C1 | course-view-* | side-pre |
And I log out
And I log in as "admin"
And the following config values are set as admin:
| maxeditingtime | 1 |
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I am on the "Course 1" course page logged in as student1
And I should see "New forum posts:" in the "Recent activity" "block"
And I should see "Forum post subject" in the "Recent activity" "block"
@@ -35,9 +35,10 @@ Feature: Users can see the relevant recent forum posts from the recent activity
| forum | Standard forum | C1 | forum3 | general | 0 | 1 |
| forum | Hidden forum | C1 | forum4 | general | 0 | 0 |
| forum | Q&A forum | C1 | forum5 | qanda | 0 | 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| recent_activity | Course | C1 | course-view-* | side-pre |
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
Scenario: Recent forum activity with separate group discussion
Given I add a new discussion to "Separate groups forum" forum with:
@@ -17,12 +17,14 @@ Feature: Importing glossary entries
And the following "activities" exist:
| activity | course | idnumber | name |
| glossary | C1 | glossary1 | Glossary 1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| recent_activity | Course | C1 | course-view-* | side-pre |
| tags | Course | C1 | course-view-* | side-pre |
@javascript @block_recent_activity
Scenario: Importing glossary entries and checking the Recent activity block
Given 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 am on the "Glossary 1" "glossary activity" page
And I navigate to "Import entries" in current page administration
And I upload "mod/glossary/tests/fixtures/texfilter_glossary_en.xml" file to "File to import" filemanager
@@ -36,8 +38,6 @@ Feature: Importing glossary entries
@javascript @block_tags
Scenario: Importing glossary entries and checking Tags block
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Tags" block
And I am on the "Glossary 1" "glossary activity" page
And I navigate to "Import entries" in current page administration
And I upload "mod/glossary/tests/fixtures/musicians.xml" file to "File to import" filemanager
+4 -9
View File
@@ -14,26 +14,21 @@ Feature: Reset all personalised pages to default
| role | user |
| moodle/block:edit | allow |
| block/myprofile:addinstance | allow |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| comments | User | student1 | my-index | side-pre |
| myprofile | User | student2 | user-profile | side-pre |
And I log in as "student1"
And I follow "Dashboard" in the user menu
And I press "Customise this page"
And I add the "Comments" block
And I press "Stop customising this page"
And I should see "Comments"
And I log out
And I log in as "student2"
And I follow "Profile" in the user menu
And I should not see "Logged in user"
And I press "Customise this page"
And I add the "Logged in user" block
And I press "Stop customising this page"
And I should see "Logged in user"
And I log out
And I log in as "student3"
And I follow "Dashboard" in the user menu
And I should not see "Comments"
And I follow "Profile" in the user menu
And I should not see "Logged in user"
@@ -68,10 +68,12 @@ Feature: The student can navigate to their grades page and user grade report.
| moodle/user:viewalldetails | allow |
| moodle/user:viewuseractivitiesreport | allow |
| moodle/user:viewdetails | allow |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| mentees | System | 1 | site-index | side-pre |
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Mentees" block
And I am on the "student1" "user > profile" page
And I click on "Preferences" "link" in the ".profile_tree" "css_element"
And I follow "Assign roles relative to this user"
@@ -60,10 +60,12 @@ Feature: Access to preferences page
| moodle/user:viewalldetails | allow |
| moodle/user:viewuseractivitiesreport | allow |
| moodle/user:viewdetails | allow |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| mentees | System | 1 | site-index | side-pre |
When I log in as "admin"
And I am on site homepage
And I follow "Turn editing on"
And I add the "Mentees" block
And I am on the "student1" "user > profile" page
And I click on "Preferences" "link" in the ".profile_tree" "css_element"
And I follow "Assign roles relative to this user"