| 1 | efrain | 1 | @core @core_my @javascript
 | 
        
           |  |  | 2 | Feature: Navigate and use preferences page
 | 
        
           |  |  | 3 |   In order to navigate through preferences page
 | 
        
           |  |  | 4 |   As a user
 | 
        
           |  |  | 5 |   I need to be able to use preferences page
 | 
        
           |  |  | 6 |   | 
        
           |  |  | 7 |   Background:
 | 
        
           |  |  | 8 |     Given the following "users" exist:
 | 
        
           |  |  | 9 |       | username | firstname | lastname | email          |
 | 
        
           |  |  | 10 |       | student1 | Sam       | Student  | s1@example.com |
 | 
        
           |  |  | 11 |     And the following "courses" exist:
 | 
        
           |  |  | 12 |       | fullname | shortname | format |
 | 
        
           |  |  | 13 |       | Course 1 | C1        | topics |
 | 
        
           |  |  | 14 |     And the following "course enrolments" exist:
 | 
        
           |  |  | 15 |       | user     | course | role           |
 | 
        
           |  |  | 16 |       | student1 | C1     | student        |
 | 
        
           |  |  | 17 |     And I log in as "admin"
 | 
        
           |  |  | 18 |   | 
        
           |  |  | 19 |   Scenario Outline: Navigating through user menu Preferences
 | 
        
           |  |  | 20 |     When I follow "Preferences" in the user menu
 | 
        
           |  |  | 21 |     # Click each link in the 'Preferences' page.
 | 
        
           |  |  | 22 |     And I click on "<userprefpage>" "link" in the "#page-content" "css_element"
 | 
        
           |  |  | 23 |     # Confirm that each redirected page has 'Preferences' in the breadcrumbs.
 | 
        
           |  |  | 24 |     And "Users" "link" should not exist in the ".breadcrumb" "css_element"
 | 
        
           |  |  | 25 |     Then "Preferences" "link" should exist in the ".breadcrumb" "css_element"
 | 
        
           |  |  | 26 |     # Additional confirmation that breadcrumbs is correct.
 | 
        
           |  |  | 27 |     And "<userprefpage>" "text" should exist in the ".breadcrumb" "css_element"
 | 
        
           |  |  | 28 |     # Confirm that user name and profile picture are displayed in header section.
 | 
        
           |  |  | 29 |     And I should see "Admin User" in the ".page-header-headings" "css_element"
 | 
        
           |  |  | 30 |     And ".page-header-image" "css_element" should exist in the "#page-header" "css_element"
 | 
        
           |  |  | 31 |   | 
        
           |  |  | 32 |     Examples:
 | 
        
           |  |  | 33 |       | userprefpage                 |
 | 
        
           |  |  | 34 |       | Edit profile                 |
 | 
        
           |  |  | 35 |       | Change password              |
 | 
        
           |  |  | 36 |       | Preferred language           |
 | 
        
           |  |  | 37 |       | Forum preferences            |
 | 
        
           |  |  | 38 |       | Editor preferences           |
 | 
        
           |  |  | 39 |       | Calendar preferences         |
 | 
        
           |  |  | 40 |       | Content bank preferences     |
 | 
        
           |  |  | 41 |       | Message preferences          |
 | 
        
           |  |  | 42 |       | Notification preferences     |
 | 
        
           |  |  | 43 |       | Manage badges                |
 | 
        
           |  |  | 44 |       | Badge preferences            |
 | 
        
           |  |  | 45 |       | Backpack settings            |
 | 
        
           |  |  | 46 |       | This user's role assignments |
 | 
        
           |  |  | 47 |       | Permissions                  |
 | 
        
           |  |  | 48 |       | Check permissions            |
 | 
        
           |  |  | 49 |       | Blog preferences             |
 | 
        
           |  |  | 50 |       | External blogs               |
 | 
        
           |  |  | 51 |       | Register an external blog    |
 | 
        
           |  |  | 52 |   | 
        
           |  |  | 53 |   Scenario Outline: Navigating through course participant preferences
 | 
        
           |  |  | 54 |     Given I am on "Course 1" course homepage
 | 
        
           |  |  | 55 |     And I navigate to course participants
 | 
        
           |  |  | 56 |     And I follow "Sam Student"
 | 
        
           |  |  | 57 |     When I click on "Preferences" "link" in the "#region-main-box" "css_element"
 | 
        
           |  |  | 58 |     Then I should see "Sam Student" in the ".page-header-headings" "css_element"
 | 
        
           |  |  | 59 |     And ".page-header-image" "css_element" should exist in the "#page-header" "css_element"
 | 
        
           |  |  | 60 |     # Click each link in the 'Preferences' page.
 | 
        
           |  |  | 61 |     And I click on "<courseprefpage>" "link" in the "#page-content" "css_element"
 | 
        
           |  |  | 62 |     # Confirm that each redirected page has 'Users/{user}/Preferences' in the breadcrumbs.
 | 
        
           |  |  | 63 |     Then "Users" "link" should exist in the ".breadcrumb" "css_element"
 | 
        
           |  |  | 64 |     And "Sam Student" "link" should exist in the ".breadcrumb" "css_element"
 | 
        
           |  |  | 65 |     And "Preferences" "link" should exist in the ".breadcrumb" "css_element"
 | 
        
           |  |  | 66 |     # Additional confirmation that breadcrumbs is correct.
 | 
        
           |  |  | 67 |     And "<courseprefpage>" "text" should exist in the ".breadcrumb" "css_element"
 | 
        
           |  |  | 68 |     # Confirm that user name and profile picture are displayed in header section.
 | 
        
           |  |  | 69 |     And I should see "Sam Student" in the ".page-header-headings" "css_element"
 | 
        
           |  |  | 70 |     And ".page-header-image" "css_element" should exist in the "#page-header" "css_element"
 | 
        
           |  |  | 71 |   | 
        
           |  |  | 72 |     Examples:
 | 
        
           |  |  | 73 |       | courseprefpage               |
 | 
        
           |  |  | 74 |       | Edit profile                 |
 | 
        
           |  |  | 75 |       | Preferred language           |
 | 
        
           |  |  | 76 |       | Forum preferences            |
 | 
        
           |  |  | 77 |       | Editor preferences           |
 | 
        
           |  |  | 78 |       | Calendar preferences         |
 | 
        
           |  |  | 79 |       | Content bank preferences     |
 | 
        
           |  |  | 80 |       | Message preferences          |
 | 
        
           |  |  | 81 |       | Notification preferences     |
 | 
        
           |  |  | 82 |       | This user's role assignments |
 | 
        
           |  |  | 83 |       | Permissions                  |
 | 
        
           |  |  | 84 |       | Check permissions            |
 | 
        
           |  |  | 85 |   | 
        
           |  |  | 86 |   Scenario: Navigation with Event monitoring enabled
 | 
        
           |  |  | 87 |     Given I navigate to "Reports > Event monitoring rules" in site administration
 | 
        
           |  |  | 88 |     And I click on "Enable" "link"
 | 
        
           |  |  | 89 |     And I press "Add a new rule"
 | 
        
           |  |  | 90 |     And I set the following fields to these values:
 | 
        
           |  |  | 91 |       | Rule name       | Testing1            |
 | 
        
           |  |  | 92 |       | Area to monitor | Subsystem (core)    |
 | 
        
           |  |  | 93 |       | Event           | Allow role override |
 | 
        
           |  |  | 94 |     And I press "Save changes"
 | 
        
           |  |  | 95 |     When I follow "Preferences" in the user menu
 | 
        
           |  |  | 96 |     # Confirm that Event monitoring is visible and clickable.
 | 
        
           |  |  | 97 |     Then I should see "Miscellaneous"
 | 
        
           |  |  | 98 |     And I follow "Event monitoring"
 | 
        
           |  |  | 99 |     # Confirm that user can subscribe to new rule.
 | 
        
           |  |  | 100 |     And "Subscribe to rule \"Testing1\"" "link" should exist
 | 
        
           |  |  | 101 |     And I am on "Course 1" course homepage
 | 
        
           |  |  | 102 |     And I navigate to course participants
 | 
        
           |  |  | 103 |     And I follow "Sam Student"
 | 
        
           |  |  | 104 |     And I click on "Preferences" "link" in the "#region-main-box" "css_element"
 | 
        
           |  |  | 105 |     # Confirm that admin cannot change student's event monitor subscription.
 | 
        
           |  |  | 106 |     And I should not see "Event monitoring"
 |