first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
@core @core_my
Feature: Add blocks to dashboard page
In order to add more functionality to dashboard page
As a user
I need to add blocks to dashboard page
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "student1"
Scenario: Add blocks to page
When I turn editing mode on
And I add the "Latest announcements" block
And I turn editing mode off
Then I should see "Latest announcements" in the "Latest announcements" "block"
And I should see "Timeline" in the "Timeline" "block"
And I should see "Calendar" in the "Calendar" "block"
And I should not see "Upcoming events"
+141
View File
@@ -0,0 +1,141 @@
@core @core_my
Feature: Run tests over my courses.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| user1 | User | 1 | user1@example.com |
And the following "categories" exist:
| name | category | idnumber |
| CatA | 0 | cata |
And the following "roles" exist:
| shortname | name | archetype |
| role1 | Role 1 | |
And the following "system role assigns" exist:
| user | role | contextlevel | reference |
| user1 | role1 | Category | CatA |
Scenario: Admin can add new courses or manage them from my courses
Given I am on the "My courses" page logged in as "admin"
And I click on "Course management options" "link"
And I click on "New course" "link"
And I wait to be redirected
Then I should see "Add a new course"
And I am on the "My courses" page
And I click on "Course management options" "link"
And I click on "Manage courses" "link"
And I should see "Manage course categories and courses"
Scenario: User without creating a course and managing category permissions cannot see any link
Given I am on the "My courses" page logged in as "user1"
Then "Course management options" "link" should not exist
Scenario: User without capability to browse courses cannot see any link
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/category:viewcourselist | Prevent | user | System | |
Given I am on the "My courses" page logged in as "user1"
Then "Course management options" "link" should not exist
@javascript
Scenario: User with creating a course permission can see the Create course link only
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:create | Allow | role1 | Category | cata |
When I am on the "My courses" page logged in as "user1"
Then "Course management options" "link" should exist
And I click on "Course management options" "link"
And I should see "New course"
And I should not see "Manage courses"
And I click on "New course" "link"
And I wait to be redirected
And I should see "Add a new course"
And "CatA" "autocomplete_selection" should exist
@javascript
Scenario: User with managing a category permission can see the Manage course link only
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/category:manage | Allow | role1 | Category | cata |
When I am on the "My courses" page logged in as "user1"
Then "Course management options" "link" should exist
And I click on "Course management options" "link"
And I should not see "New course"
And I should see "Manage courses"
And I click on "Manage courses" "link"
And I wait to be redirected
And I should see "Manage course categories and courses"
@javascript
Scenario: User with both creating a course and managing a category permission can see both links
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:create | Allow | role1 | Category | cata |
| moodle/category:manage | Allow | role1 | Category | cata |
When I am on the "My courses" page logged in as "user1"
Then "Course management options" "link" should exist
And I click on "Course management options" "link"
And I should see "New course"
And I should see "Manage courses"
And I click on "New course" "link"
And I wait to be redirected
And I should see "Add a new course"
And "CatA" "autocomplete_selection" should exist
And I am on the "My courses" page
And I click on "Course management options" "link"
And I click on "Manage courses" "link"
And I wait to be redirected
And I should see "Manage course categories and courses"
@javascript
Scenario: Admin can see relevant blocks but not add or move them
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Text" block to the default region with:
| Text block title | Text on all pages |
| Content | This is visible on all pages |
And I configure the "Text on all pages" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
| Default region | Right |
And I click on "Save changes" "button" in the "Configure Text on all pages block" "dialogue"
And I should see "This is visible on all pages"
And "Move Text on all pages block" "menuitem" should exist in the "Text on all pages" "block"
When I am on the "My courses" page
# Check blocks visible but are "locked" in place.
Then "Course overview" "text" should exist in the "region-main" "region"
And I should not see "Add a block"
And I should see "This is visible on all pages"
And "Move Text on all pages block" "menuitem" should not exist in the "Text on all pages" "block"
And "Move Course overview block" "menuitem" should not exist in the "Course overview" "block"
And I click on "Actions menu" "icon" in the "Course overview" "block"
And I should not see "Delete Course overview block"
@javascript
Scenario: User with creating a course permission can't see the Request course link
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:request | Allow | user | System | |
When I am on the "My courses" page logged in as "admin"
And I click on "Course management options" "link"
And I should see "New course"
Then I should not see "Request a course"
@javascript
Scenario: User without creating a course but with course request permission could see the Request course link
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/course:request | Allow | user | System | |
When I am on the "My courses" page logged in as "user1"
And I click on "Course management options" "link"
And I should not see "New course"
Then I should see "Request a course"
And the following config values are set as admin:
| enablecourserequests | 0 |
And I am on the "My courses" page logged in as "user1"
And "Course management options" "link" should not exist
Scenario: User without creating nor course request permission shouldn't see any Request course link
Given I am on the "My courses" page logged in as "user1"
Then "Course management options" "link" should not exist
@@ -0,0 +1,106 @@
@core @core_my @javascript
Feature: Navigate and use preferences page
In order to navigate through preferences page
As a user
I need to be able to use preferences page
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam | Student | s1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
Scenario Outline: Navigating through user menu Preferences
When I follow "Preferences" in the user menu
# Click each link in the 'Preferences' page.
And I click on "<userprefpage>" "link" in the "#page-content" "css_element"
# Confirm that each redirected page has 'Preferences' in the breadcrumbs.
And "Users" "link" should not exist in the ".breadcrumb" "css_element"
Then "Preferences" "link" should exist in the ".breadcrumb" "css_element"
# Additional confirmation that breadcrumbs is correct.
And "<userprefpage>" "text" should exist in the ".breadcrumb" "css_element"
# Confirm that user name and profile picture are displayed in header section.
And I should see "Admin User" in the ".page-header-headings" "css_element"
And ".page-header-image" "css_element" should exist in the "#page-header" "css_element"
Examples:
| userprefpage |
| Edit profile |
| Change password |
| Preferred language |
| Forum preferences |
| Editor preferences |
| Calendar preferences |
| Content bank preferences |
| Message preferences |
| Notification preferences |
| Manage badges |
| Badge preferences |
| Backpack settings |
| This user's role assignments |
| Permissions |
| Check permissions |
| Blog preferences |
| External blogs |
| Register an external blog |
Scenario Outline: Navigating through course participant preferences
Given I am on "Course 1" course homepage
And I navigate to course participants
And I follow "Sam Student"
When I click on "Preferences" "link" in the "#region-main-box" "css_element"
Then I should see "Sam Student" in the ".page-header-headings" "css_element"
And ".page-header-image" "css_element" should exist in the "#page-header" "css_element"
# Click each link in the 'Preferences' page.
And I click on "<courseprefpage>" "link" in the "#page-content" "css_element"
# Confirm that each redirected page has 'Users/{user}/Preferences' in the breadcrumbs.
Then "Users" "link" should exist in the ".breadcrumb" "css_element"
And "Sam Student" "link" should exist in the ".breadcrumb" "css_element"
And "Preferences" "link" should exist in the ".breadcrumb" "css_element"
# Additional confirmation that breadcrumbs is correct.
And "<courseprefpage>" "text" should exist in the ".breadcrumb" "css_element"
# Confirm that user name and profile picture are displayed in header section.
And I should see "Sam Student" in the ".page-header-headings" "css_element"
And ".page-header-image" "css_element" should exist in the "#page-header" "css_element"
Examples:
| courseprefpage |
| Edit profile |
| Preferred language |
| Forum preferences |
| Editor preferences |
| Calendar preferences |
| Content bank preferences |
| Message preferences |
| Notification preferences |
| This user's role assignments |
| Permissions |
| Check permissions |
Scenario: Navigation with Event monitoring enabled
Given I navigate to "Reports > Event monitoring rules" in site administration
And I click on "Enable" "link"
And I press "Add a new rule"
And I set the following fields to these values:
| Rule name | Testing1 |
| Area to monitor | Subsystem (core) |
| Event | Allow role override |
And I press "Save changes"
When I follow "Preferences" in the user menu
# Confirm that Event monitoring is visible and clickable.
Then I should see "Miscellaneous"
And I follow "Event monitoring"
# Confirm that user can subscribe to new rule.
And "Subscribe to rule \"Testing1\"" "link" should exist
And I am on "Course 1" course homepage
And I navigate to course participants
And I follow "Sam Student"
And I click on "Preferences" "link" in the "#region-main-box" "css_element"
# Confirm that admin cannot change student's event monitor subscription.
And I should not see "Event monitoring"
+113
View File
@@ -0,0 +1,113 @@
@core @core_my
Feature: Reset all personalised pages to default
In order to reset everyone's personalised pages
As an admin
I need to press a button on the pages to customise the default pages
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
| student3 | Student | 3 | student3@example.com |
And the following "role capability" exists:
| 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 should see "Comments"
And I log out
And I log in as "student2"
And I follow "Profile" in the user menu
And I should see "Logged in user"
And I log out
And I log in as "student3"
And I should not see "Comments"
And I follow "Profile" in the user menu
And I should not see "Logged in user"
And I log out
Scenario: Reset Dashboard for all users
Given I log in as "admin"
And I navigate to "Appearance > Default Dashboard page" in site administration
And I turn editing mode on
And I add the "Latest announcements" block
And I open the "Timeline" blocks action menu
And I follow "Delete Timeline block"
And I press "Yes"
And I turn editing mode off
And I log out
And I log in as "student1"
And I should not see "Latest announcements"
And I should see "Timeline"
And I log out
And I log in as "student3"
And I should not see "Latest announcements"
And I should see "Timeline"
And I log out
And I log in as "admin"
And I navigate to "Appearance > Default Dashboard page" in site administration
When I press "Reset Dashboard for all users"
And I should see "All Dashboard pages have been reset to default."
And I log out
And I log in as "student1"
Then I should see "Latest announcements"
And I should not see "Comments"
And I should not see "Timeline"
And I log out
And I log in as "student3"
And I should see "Latest announcements"
And I should not see "Timeline"
And I log out
# Check that this did not affect the customised profiles.
And I am on the "student2" "user > profile" page logged in as student2
And I should see "Logged in user"
And I should not see "Latest announcements"
Scenario: Reset profile for all users
Given I log in as "admin"
And I navigate to "Appearance > Default profile page" in site administration
And I turn editing mode on
And I add the "Latest announcements" block
And I log out
And I am on the "student2" "user > profile" page logged in as student2
And I should not see "Latest announcements"
And I log out
And I am on the "student3" "user > profile" page logged in as student3
And I should not see "Latest announcements"
And I log out
And I log in as "admin"
And I navigate to "Appearance > Default profile page" in site administration
When I press "Reset profile for all users"
And I should see "All profile pages have been reset to default."
And I log out
And I am on the "student2" "user > profile" page logged in as student2
Then I should see "Latest announcements"
And I should not see "Logged in user"
And I log out
And I am on the "student3" "user > profile" page logged in as student3
And I should see "Latest announcements"
And I log out
# Check that this did not affect the customised dashboards.
And I log in as "student1"
And I should see "Comments"
And I should not see "Latest announcements"
+31
View File
@@ -0,0 +1,31 @@
@core @core_my
Feature: Reset dashboard page to default
In order to remove customisations from dashboard page
As a user
I need to reset dashboard page
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "student1"
Scenario: Add blocks to page and reset
When I turn editing mode on
And I add the "Latest announcements" block
And I add the "Comments" block
And I press "Reset page to default"
Then I should not see "Latest announcements"
And I should see "Timeline"
And I should see "Calendar"
And I should not see "Upcoming events"
And I should not see "Comments"
And I should not see "Reset page to default"
@@ -0,0 +1,37 @@
@core @core_my
Feature: Restrict which blocks can be added to Dashboard
In order to restrict which blocks can be added
As a student I need to ensure I can add the blocks
As an admin I need to remove the capability to add a blocks
As a student I need to ensure I can't add the blocks any more
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
Scenario: The comments block can be added to Dashboard by default
And I log in as "student1"
And I turn editing mode on
Then the add block selector should contain "Comments" block
And the add block selector should contain "Text" block
And the add block selector should contain "Tags" block
Scenario: Remove the ability to add the comments block to Dashboard
Given the following "role capability" exists:
| role | user |
| block/comments:myaddinstance | prohibit |
| block/course_list:myaddinstance | prohibit |
| block/html:myaddinstance | prohibit |
When I log in as "student1"
And I turn editing mode on
Then the add block selector should not contain "Comments" block
And the add block selector should not contain "Courses" block
And the add block selector should not contain "Text" block
And the add block selector should contain "Tags" block
+49
View File
@@ -0,0 +1,49 @@
@core @core_my
Feature: Welcome message
In order to welcome new or existing user
As a user
I will see welcome message when I log into moodle
Scenario: Log in and being redirected to course page
Given the following "users" exist:
| username | password | firstname | lastname | email |
| wf | test | Fei | Wang | fei@example.com |
And the following "courses" exist:
| fullname | shortname |
| Math 101 | M1O1 |
When I am on "Math 101" course homepage
And I should see "You are not logged in" in the "page-footer" "region"
And I set the field "Username" to "wf"
And I set the field "Password" to "test"
And I press "Log in"
And I should see "Math 101" in the "page-header" "region"
And I should not see "Welcome, Fei!" in the "page-header" "region"
And I follow "Dashboard"
Then I should see "Welcome, Fei!" in the "page-header" "region"
@javascript
Scenario: Log in and being redirected to default home page
When I log in as "admin"
And I should see "You are logged in as Admin User" in the "page-footer" "region"
And I should see "Welcome, Admin!" in the "page-header" "region"
And I log out
And I should see "You are not logged in" in the "page-footer" "region"
And I log in as "admin"
Then I should see "Hi, Admin!" in the "page-header" "region"
@accessibility @javascript
Scenario Outline: The start page must meet accessibility standards when the welcome message is displayed
Given the following config values are set as admin:
| defaulthomepage | <defaulthomepage> |
When I log in as "admin"
Then I should see "Welcome, Admin!" in the "page-header" "region"
And the page should meet accessibility standards
Examples:
| defaulthomepage |
# Home.
| 0 |
# Dashboard.
| 1 |
# My courses.
| 2 |