MDL-78158 Behat: Use data generators to add blocks

This commit is contained in:
Angelia Dela Cruz 2023-05-22 12:51:50 +08:00
parent 6628845087
commit 0d5b8d1337
62 changed files with 235 additions and 229 deletions

View File

@ -23,10 +23,10 @@ Feature: Import course's contents into another course
| activity | name | intro | course | idnumber | section |
| data | Test database name | Test database description | C1 | database1 | 2 |
| forum | Test forum name | Test forum name description | C1 | forum1 | 1 |
And I am on "Course 1" course homepage with editing mode on
And I add the "Comments" block
And I add the "Recent blog entries" block
And I turn editing mode off
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"

View File

@ -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

View File

@ -21,8 +21,10 @@ Feature: The activity results block doesn't display student scores for unsupport
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:
| config_showbest | 1 |

View File

@ -50,8 +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 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:
| config_showbest | 0 |

View File

@ -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 turn editing mode on
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

View File

@ -26,11 +26,9 @@ Feature: Enable Block blog menu in an activity
| idnumber | 0001 |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment 1"
And I add the "Blog menu" block
And I log out
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"

View File

@ -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"

View File

@ -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 turn 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 | System | 1 | site-index | side-pre |
Scenario: Students use the blog menu block to post blogs
Given I log in as "student1"

View File

@ -26,12 +26,10 @@ Feature: Students can use the recent blog entries block to view recent entries o
| intro | Offline text |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I 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 "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"

View File

@ -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"

View File

@ -8,12 +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 turn editing mode on
And I add the "Recent blog entries" block
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I log out

View File

@ -52,9 +52,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 |

View File

@ -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 |

View File

@ -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 turn editing mode on
And I add the "Upcoming events" block
And I log out
When I log in as "teacher1"
And I am on site homepage

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 turn editing mode on
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

View File

@ -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

View File

@ -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:
@ -55,7 +57,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:

View File

@ -17,10 +17,12 @@ Feature: Enable Block Completion in a course using manual self completion
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I enable "selfcompletion" "block" plugin
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:

View File

@ -17,10 +17,9 @@ Feature: Course summary block used in a course
| student1 | C101 | student |
| teacher1 | C101 | editingteacher |
And I enable "course_summary" "block" plugin
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"

View File

@ -7,9 +7,10 @@ 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 "Site home > Site home settings" in site administration
And I set the following fields to these values:
| summary | Proved the summary block works! |

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 turn editing mode on
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"

View File

@ -8,9 +8,9 @@ Feature: Add the network servers block when main feature is disabled
Given I log in as "admin"
And I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Enable" "icon" in the "MNet authentication" "table_row"
And I am on site homepage
And I turn editing mode on
And I add the "Network servers" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| mnet_hosts | System | 1 | site-index | side-pre |
When I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Disable" "icon" in the "MNet authentication" "table_row"
And I am on site homepage
@ -21,10 +21,11 @@ Feature: Add the network servers block when main feature is disabled
Given I log in as "admin"
And I navigate to "Plugins > Authentication > Manage authentication" in site administration
And I click on "Enable" "icon" in the "MNet authentication" "table_row"
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| mnet_hosts | System | 1 | site-index | side-pre |
And I am on site homepage
And I turn editing mode on
And I add the "Network servers" block
And I turn editing mode on
And I open the "Network servers" blocks action menu
And I click on "Delete Network servers block" "link" in the "Network servers" "block"
And "Delete block?" "dialogue" should exist

View File

@ -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"

View File

@ -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 turn editing mode on
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"

View File

@ -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 |

View File

@ -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

View File

@ -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

View File

@ -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 turn editing mode on
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"

View File

@ -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 "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

View File

@ -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 turn editing mode on
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"

View File

@ -22,7 +22,9 @@ Feature: The Section links block can be configured to display section name in ad
And I am on "Course 1" course homepage with editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Section links" block
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| section_links | Course | C1 | course-view-* | side-pre |
And I log out
Scenario: Student can see section name under the Section links block

View File

@ -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 turn editing mode on
And I add the "Main menu" block
And the following "activity" exists:
| activity | url |
| course | Acceptance test site |
@ -22,20 +29,15 @@ Feature: Add URL to main menu block
And I set the following fields to these values:
| id_display | In pop-up |
And I press "Save and return to course"
And I turn editing mode on
Then "reference link" "link" should exist in the "Main menu" "block"
And "Add an activity or resource" "button" should exist in the "Main menu" "block"
@javascript
Scenario: Add a URL in menu block can appear in the entire site
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| enablecompletion | 1 |
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Main menu" block
And I configure the "Main menu" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
@ -61,15 +63,9 @@ Feature: Add URL to main menu block
@javascript
Scenario: Add a URL in menu block can appear in any front page
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| enablecompletion | 1 |
When I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Main menu" block
And I configure the "Main menu" block
And I set the following fields to these values:
| Page contexts | Display on the site home and any pages added to the site home. |
@ -95,22 +91,17 @@ Feature: Add URL to main menu block
@javascript
Scenario: When the "Main Menu" block is displayed throrought the entire site, adding an URL in a course
results in adding it in the course and not in the frontpage
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
And I log in as "admin"
results in adding it in the course and not in the frontpage
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Main menu" block
And I configure the "Main menu" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
When the following "activity" exists:
| activity | url |
| course | C1 |
| course | C2 |
| name | reference link |
| intro | mooooooooodle |
| externalurl | http://www.moodle.com |

View File

@ -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 turn editing mode on
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"

View File

@ -35,9 +35,11 @@ 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 press "Add an activity or resource"
And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
And I set the field "Forum name" to "My forum name"

View File

@ -8,10 +8,11 @@ Feature: Block removal via modal
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
And I add the "Search forums" block
And "Search forums" "block" should exist
@javascript
Scenario: Removing a block via modal should remove the block on the page

View File

@ -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:

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"

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 |

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 |

View File

@ -30,10 +30,10 @@ 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 |
| calendar_upcoming | Course | C4 | course-view-* | side-pre |
@javascript
Scenario: Create a site event
@ -294,7 +294,6 @@ Feature: Perform basic calendar functionality
And the following config values are set as admin:
| calendar_adminseesall | 0 |
And I am on "Course 4" course homepage with editing mode on
And I add the "Upcoming events" block
And I click on "Go to calendar..." "link" in the "Upcoming events" "block"
And I click on "New event" "button"
And I should see "Course" in the "Type of event" "select"

View File

@ -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 "Full calendar"
And I click on "a.next" "css_element"
And I click on "a.next" "css_element"

View File

@ -23,6 +23,9 @@ Feature: Allow to mark course as completed without cron for activity completion
| name | Test assignment name |
| idnumber | assign1 |
| description | Test assignment description |
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 I navigate to "Settings" in current page administration
@ -38,9 +41,6 @@ Feature: Allow to mark course as completed without cron for activity completion
And I expand all fieldsets
And I set the field "Assignment - Test assignment name" 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
@javascript
Scenario: Update course completion when student marks activity as complete

View File

@ -28,13 +28,15 @@ Feature: Course completion state should match completion criteria
| assignsubmission_onlinetext_enabled | 1 |
| grade[modgrade_type] | Point |
| grade[modgrade_point] | 100 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| completionstatus | 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 navigate to "Course completion" in current page administration
And I click on "Condition: Activity completion" "link"
And I set the field "Assignment - Test assignment name" to "1"
And I press "Save changes"
And I add the "Course completion status" block
And I am on the "Test assignment name" "assign activity" page
And I navigate to "Settings" in current page administration
And I set the following fields to these values:

View File

@ -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

View File

@ -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

View File

@ -295,11 +295,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"

View File

@ -33,7 +33,6 @@ Feature: Set availability dates for an assignment
And the activity date in "Assignment name" should contain "Opens:"
And the activity date in "Assignment name" should contain "##tomorrow noon##%A, %d %B %Y, %I:%M##"
@javascript
Scenario: Student can see the assignment's due date in the course calendar
Given the following "activity" exists:
| activity | assign |

View File

@ -17,10 +17,12 @@ Feature: Editing choice block
| 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 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"
@ -51,10 +53,12 @@ Feature: Editing choice block
| 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 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"
@ -84,10 +88,12 @@ Feature: Editing choice block
| 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 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"

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"

View File

@ -35,6 +35,11 @@ Feature: Mapping courses in a feedback
| 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"
@ -54,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"

View File

@ -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 "Settings" in current page administration
And I expand all fieldsets
And I set the field "id_newsitems" to "1"

View File

@ -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"

View File

@ -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:

View File

@ -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 press "Import entries"
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 press "Import entries"
And I upload "mod/glossary/tests/fixtures/musicians.xml" file to "File to import" filemanager

View File

@ -26,10 +26,9 @@ Feature: Users can see the H5P recent activity from the recent activity block
| course | C1 |
| name | Awesome H5P package |
| packagefilepath | h5p/tests/fixtures/multiple-choice-2-6.h5p |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| recent_activity | Course | C1 | course-view-* | side-pre |
And I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student1
# The H5P content needs some time to be displayed (so better to wait for 1 second to avoid random errors).
And I switch to "h5p-player" class iframe

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"
And I turn editing mode on
And I add the "Comments" block
And I turn editing mode off
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 turn editing mode on
And I add the "Logged in user" block
And I turn editing mode off
And I should see "Logged in user"
And I log out
And I log in as "student3"
And I follow "Dashboard"
And I should not see "Comments"
And I follow "Profile" in the user menu
And I should not see "Logged in user"

View File

@ -223,11 +223,9 @@ Feature: Custom profile fields should be visible and editable by those with the
| moodle/user:viewalldetails | Allow | parent | User | userwithinformation |
| moodle/user:viewdetails | Allow | parent | User | userwithinformation |
| moodle/user:editprofile | Allow | parent | User | userwithinformation |
Given 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 log out
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| mentees | System | 1 | site-index | side-pre |
And I log in as "parent"
And I am on site homepage
When I follow "userwithinformation"

View File

@ -67,10 +67,10 @@ 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"

View File

@ -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 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"