@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: # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/add_blocks.feature:7 Given the following "users" exist: # behat_data_generators::the_following_entities_exist()  | username | firstname | lastname | email | | student1 | Student | 1 | student1@example.com | | student2 | Student | 2 | student2@example.com | And the following "courses" exist: # behat_data_generators::the_following_entities_exist()  | fullname | shortname | format | | Course 1 | C1 | topics | And the following "course enrolments" exist: # behat_data_generators::the_following_entities_exist()  | user | course | role | | student1 | C1 | student | | student2 | C1 | student | And I log in as "student1" # behat_auth::i_log_in_as() Scenario: Add blocks to page # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/add_blocks.feature:21 When I turn editing mode on # behat_theme_boost_behat_navigation::i_turn_editing_mode_on() And I add the "Latest announcements" block # behat_blocks::i_add_the_block() And I turn editing mode off # behat_theme_boost_behat_navigation::i_turn_editing_mode_off() Then I should see "Latest announcements" in the "Latest announcements" "block" # behat_general::assert_element_contains_text() And I should see "Course overview" in the "Course overview" "block" # behat_general::assert_element_contains_text() And I should see "Timeline" in the "Timeline" "block" # behat_general::assert_element_contains_text() And I should see "Calendar" in the "Calendar" "block" # behat_general::assert_element_contains_text() And I should not see "Upcoming events" # behat_general::assert_page_not_contains_text() @core @core_my @block_myoverview Feature: Run tests over my courses page Background: # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:4 Given the following config values are set as admin: # behat_admin::the_following_config_values_are_set_as_admin()  | enablemyhome | 1 | | enablemycourses | 1 | And the following "users" exist: # behat_data_generators::the_following_entities_exist()  | username | firstname | lastname | email | | user1 | User | 1 | user1@example.com | And the following "categories" exist: # behat_data_generators::the_following_entities_exist()  | name | category | idnumber | | CatA | 0 | cata | And the following "roles" exist: # behat_data_generators::the_following_entities_exist()  | shortname | name | archetype | | role1 | Role 1 | | And the following "system role assigns" exist: # behat_data_generators::the_following_entities_exist()  | user | role | contextlevel | reference | | user1 | role1 | Category | CatA | Scenario: Admin can add new courses or manage them from my courses # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:21 Given I am on the "My courses" page logged in as "admin" # behat_theme_boost_behat_navigation::i_am_on_page_logged_in_as() And "Create course" "button" should not exist in the "page-header" "region" # behat_general::should_not_exist_in_the() And "Manage courses" "button" should not exist in the "page-header" "region" # behat_general::should_not_exist_in_the() When I click on "Create course" "button" in the "page-content" "region" # behat_general::i_click_on_in_the() Then I should see "Add a new course" # behat_general::assert_page_contains_text() And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And I click on "Manage course categories" "button" in the "page-content" "region" # behat_general::i_click_on_in_the() And I should see "Manage course categories and courses" # behat_general::assert_page_contains_text() But the following "course" exists: # behat_data_generators::the_following_entity_exists()  | fullname | Course 1 | | shortname | C1 | | format | topics | And the following "course enrolment" exists: # behat_data_generators::the_following_entity_exists()  | user | admin | | course | C1 | | role | student | And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And "Create course" "button" should exist in the "Course overview" "block" # behat_general::should_exist_in_the() And "Manage courses" "button" should exist in the "Course overview" "block" # behat_general::should_exist_in_the() Scenario: User without creating a course and managing category permissions cannot see any link # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:43 When I am on the "My courses" page logged in as "user1" # behat_theme_boost_behat_navigation::i_am_on_page_logged_in_as() Then "Create course" "button" should not exist # behat_general::should_not_exist() And "Manage courses" "button" should not exist # behat_general::should_not_exist() And "Manage course categories" "button" should not exist # behat_general::should_not_exist() But the following "course" exists: # behat_data_generators::the_following_entity_exists()  | fullname | Course 1 | | shortname | C1 | | format | topics | And the following "course enrolment" exists: # behat_data_generators::the_following_entity_exists()  | user | user1 | | course | C1 | | role | student | And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And "Create course" "button" should not exist # behat_general::should_not_exist() And "Manage courses" "button" should not exist # behat_general::should_not_exist() And "Manage course categories" "button" should not exist # behat_general::should_not_exist() Scenario: User without capability to browse courses cannot see any link # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:62 Given the following "permission overrides" exist: # behat_data_generators::the_following_entities_exist()  | capability | permission | role | contextlevel | reference | | moodle/category:viewcourselist | Prevent | user | System | | When I am on the "My courses" page logged in as "user1" # behat_theme_boost_behat_navigation::i_am_on_page_logged_in_as() Then "Create course" "button" should not exist # behat_general::should_not_exist() And "Manage courses" "button" should not exist # behat_general::should_not_exist() And "Manage course categories" "button" should not exist # behat_general::should_not_exist() But the following "course" exists: # behat_data_generators::the_following_entity_exists()  | fullname | Course 1 | | shortname | C1 | | format | topics | And the following "course enrolment" exists: # behat_data_generators::the_following_entity_exists()  | user | user1 | | course | C1 | | role | student | And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And "Create course" "button" should not exist # behat_general::should_not_exist() And "Manage courses" "button" should not exist # behat_general::should_not_exist() And "Manage course categories" "button" should not exist # behat_general::should_not_exist() @javascript Scenario: User with creating a course permission can see the Create course link only # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:85 Given the following "permission overrides" exist: # behat_data_generators::the_following_entities_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" # behat_theme_boost_behat_navigation::i_am_on_page_logged_in_as() Then "Create course" "button" should exist in the "page-content" "region" # behat_general::should_exist_in_the() But "Manage course categories" "button" should not exist # behat_general::should_not_exist() And I click on "Create course" "button" # behat_general::i_click_on() And I should see "Add a new course" # behat_general::assert_page_contains_text() And "CatA" "autocomplete_selection" should exist # behat_general::should_exist() But the following "course" exists: # behat_data_generators::the_following_entity_exists()  | fullname | Course 1 | | shortname | C1 | | format | topics | And the following "course enrolment" exists: # behat_data_generators::the_following_entity_exists()  | user | user1 | | course | C1 | | role | student | And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And "Create course" "button" should exist in the "Course overview" "block" # behat_general::should_exist_in_the() And "Manage courses" "button" should not exist # behat_general::should_not_exist() Scenario: User with managing a category permission can see the Manage course link only # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:108 Given the following "permission overrides" exist: # behat_data_generators::the_following_entities_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" # behat_theme_boost_behat_navigation::i_am_on_page_logged_in_as() Then "Manage course categories" "button" should exist in the "page-content" "region" # behat_general::should_exist_in_the() And "Create course" "button" should not exist # behat_general::should_not_exist() And I click on "Manage course categories" "button" in the "page-content" "region" # behat_general::i_click_on_in_the() And I should see "Manage course categories and courses" # behat_general::assert_page_contains_text() But the following "course" exists: # behat_data_generators::the_following_entity_exists()  | fullname | Course 1 | | shortname | C1 | | format | topics | And the following "course enrolment" exists: # behat_data_generators::the_following_entity_exists()  | user | user1 | | course | C1 | | role | student | And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And "Manage courses" "button" should exist in the "Course overview" "block" # behat_general::should_exist_in_the() And "Create course" "button" should not exist # behat_general::should_not_exist() @javascript Scenario: User with both creating a course and managing a category permission can see both links # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:131 Given the following "permission overrides" exist: # behat_data_generators::the_following_entities_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" # behat_theme_boost_behat_navigation::i_am_on_page_logged_in_as() Then "Create course" "button" should exist in the "page-content" "region" # behat_general::should_exist_in_the() And "Manage course categories" "button" should exist in the "page-content" "region" # behat_general::should_exist_in_the() And I click on "Create course" "button" # behat_general::i_click_on() And I should see "Add a new course" # behat_general::assert_page_contains_text() And "CatA" "autocomplete_selection" should exist # behat_general::should_exist() And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And I click on "Manage course categories" "button" # behat_general::i_click_on() And I should see "Manage course categories and courses" # behat_general::assert_page_contains_text() But the following "course" exists: # behat_data_generators::the_following_entity_exists()  | fullname | Course 1 | | shortname | C1 | | format | topics | And the following "course enrolment" exists: # behat_data_generators::the_following_entity_exists()  | user | user1 | | course | C1 | | role | student | And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And "Create course" "button" should exist in the "Course overview" "block" # behat_general::should_exist_in_the() And "Manage courses" "button" should exist in the "Course overview" "block" # behat_general::should_exist_in_the() @javascript Scenario: Admin can see relevant blocks but not add or move them # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:159 Given the following config values are set as admin: # behat_admin::the_following_config_values_are_set_as_admin()  | defaulthomepage | 0 | And I log in as "admin" # behat_auth::i_log_in_as() And I am on site homepage # behat_general::i_am_on_site_homepage() And I turn editing mode on # behat_theme_boost_behat_navigation::i_turn_editing_mode_on() And I add the "Text" block to the default region with: # behat_blocks::i_add_the_block_to_the_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 # behat_blocks::i_configure_the_block() And I set the following fields to these values: # behat_forms::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" # behat_general::i_click_on_in_the() And I should see "This is visible on all pages" # behat_general::assert_page_contains_text() And "Move Text on all pages block" "menuitem" should exist in the "Text on all pages" "block" # behat_general::should_exist_in_the() When I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() Then "Course overview" "text" should exist in the "region-main" "region" # behat_general::should_exist_in_the() And I should not see "Add a block" # behat_general::assert_page_not_contains_text() And I should see "This is visible on all pages" # behat_general::assert_page_contains_text() And "Move Text on all pages block" "menuitem" should not exist in the "Text on all pages" "block" # behat_general::should_not_exist_in_the() And "Move Course overview block" "menuitem" should not exist in the "Course overview" "block" # behat_general::should_not_exist_in_the() And "Actions menu" "icon" in the "Course overview" "block" should not be visible # behat_general::in_the_should_not_be_visible() Scenario: User with creating a course permission can't see the Request course link # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:184 Given the following "permission overrides" exist: # behat_data_generators::the_following_entities_exist()  | capability | permission | role | contextlevel | reference | | moodle/course:request | Allow | user | System | | When I am on the "My courses" page logged in as "admin" # behat_theme_boost_behat_navigation::i_am_on_page_logged_in_as() Then "Create course" "button" should exist in the "page-content" "region" # behat_general::should_exist_in_the() And "Request a course" "button" should not exist # behat_general::should_not_exist() But the following "course" exists: # behat_data_generators::the_following_entity_exists()  | fullname | Course 1 | | shortname | C1 | | format | topics | And the following "course enrolment" exists: # behat_data_generators::the_following_entity_exists()  | user | admin | | course | C1 | | role | student | And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And "Create course" "button" should exist in the "Course overview" "block" # behat_general::should_exist_in_the() And "Request a course" "button" should not exist # behat_general::should_not_exist() Scenario: User without creating a course but with course request permission could see the Request course link # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:204 Given the following "permission overrides" exist: # behat_data_generators::the_following_entities_exist()  | capability | permission | role | contextlevel | reference | | moodle/course:request | Allow | user | System | | When I am on the "My courses" page logged in as "user1" # behat_theme_boost_behat_navigation::i_am_on_page_logged_in_as() Then "Request a course" "button" should exist in the "page-content" "region" # behat_general::should_exist_in_the() And "Create course" "button" should not exist in the "page-content" "region" # behat_general::should_not_exist_in_the() And the following config values are set as admin: # behat_admin::the_following_config_values_are_set_as_admin()  | enablecourserequests | 0 | And I am on the "My courses" page logged in as "user1" # behat_theme_boost_behat_navigation::i_am_on_page_logged_in_as() And "Request a course" "button" should not exist # behat_general::should_not_exist() But the following "course" exists: # behat_data_generators::the_following_entity_exists()  | fullname | Course 1 | | shortname | C1 | | format | topics | And the following "course enrolment" exists: # behat_data_generators::the_following_entity_exists()  | user | user1 | | course | C1 | | role | student | And the following config values are set as admin: # behat_admin::the_following_config_values_are_set_as_admin()  | enablecourserequests | 1 | And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And "Request a course" "button" should exist in the "Course overview" "block" # behat_general::should_exist_in_the() And "Create course" "button" should not exist # behat_general::should_not_exist() Scenario: User without creating nor course request permission shouldn't see any Request course link # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/my_courses.feature:231 Given I am on the "My courses" page logged in as "user1" # behat_theme_boost_behat_navigation::i_am_on_page_logged_in_as() Then "Request a course" "button" should not exist in the "page-content" "region" # behat_general::should_not_exist_in_the() And "Create course" "button" should not exist in the "page-content" "region" # behat_general::should_not_exist_in_the() And "Manage courses" "button" should not exist in the "page-content" "region" # behat_general::should_not_exist_in_the() But the following "course" exists: # behat_data_generators::the_following_entity_exists()  | fullname | Course 1 | | shortname | C1 | | format | topics | And the following "course enrolment" exists: # behat_data_generators::the_following_entity_exists()  | user | user1 | | course | C1 | | role | student | And I am on the "My courses" page # behat_theme_boost_behat_navigation::i_am_on_page() And "Create course" "button" should not exist # behat_general::should_not_exist() And "Request a course" "button" should not exist # behat_general::should_not_exist() And "Manage courses" "button" should not exist # behat_general::should_not_exist() @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: # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/preferences_navigation.feature:7 Given the following "users" exist: # behat_data_generators::the_following_entities_exist()  | username | firstname | lastname | email | | student1 | Sam | Student | s1@example.com | And the following "courses" exist: # behat_data_generators::the_following_entities_exist()  | fullname | shortname | format | | Course 1 | C1 | topics | And the following "course enrolments" exist: # behat_data_generators::the_following_entities_exist()  | user | course | role | | student1 | C1 | student | And I log in as "admin" # behat_auth::i_log_in_as() Scenario Outline: Navigating through user menu Preferences # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/preferences_navigation.feature:19 When I follow "Preferences" in the user menu # behat_theme_boost_behat_navigation::i_follow_in_the_user_menu() And I click on "" "link" in the "#page-content" "css_element" # behat_general::i_click_on_in_the() And "Users" "link" should not exist in the ".breadcrumb" "css_element" # behat_general::should_not_exist_in_the() Then "Preferences" "link" should exist in the ".breadcrumb" "css_element" # behat_general::should_exist_in_the() And "" "text" should exist in the ".breadcrumb" "css_element" # behat_general::should_exist_in_the() And I should see "Admin User" in the ".page-header-headings" "css_element" # behat_general::assert_element_contains_text() And ".page-header-image" "css_element" should exist in the "#page-header" "css_element" # behat_general::should_exist_in_the() 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 # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/preferences_navigation.feature:53 Given I am on "Course 1" course homepage # behat_theme_boost_behat_navigation::i_am_on_course_homepage() And I navigate to course participants # behat_course::i_navigate_to_course_participants() And I follow "Sam Student" # behat_general::click_link() When I click on "Preferences" "link" in the "#region-main-box" "css_element" # behat_general::i_click_on_in_the() Then I should see "Sam Student" in the ".page-header-headings" "css_element" # behat_general::assert_element_contains_text() And ".page-header-image" "css_element" should exist in the "#page-header" "css_element" # behat_general::should_exist_in_the() And I click on "" "link" in the "#page-content" "css_element" # behat_general::i_click_on_in_the() Then "Users" "link" should exist in the ".breadcrumb" "css_element" # behat_general::should_exist_in_the() And "Sam Student" "link" should exist in the ".breadcrumb" "css_element" # behat_general::should_exist_in_the() And "Preferences" "link" should exist in the ".breadcrumb" "css_element" # behat_general::should_exist_in_the() And "" "text" should exist in the ".breadcrumb" "css_element" # behat_general::should_exist_in_the() And I should see "Sam Student" in the ".page-header-headings" "css_element" # behat_general::assert_element_contains_text() And ".page-header-image" "css_element" should exist in the "#page-header" "css_element" # behat_general::should_exist_in_the() 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 # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/preferences_navigation.feature:86 Given I navigate to "Reports > Event monitoring rules" in site administration # behat_theme_boost_behat_navigation::i_navigate_to_in_site_administration() And I click on "Enable" "link" # behat_general::i_click_on() And I press "Add a new rule" # behat_forms::press_button() And I set the following fields to these values: # behat_forms::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" # behat_forms::press_button() When I follow "Preferences" in the user menu # behat_theme_boost_behat_navigation::i_follow_in_the_user_menu() Then I should see "Miscellaneous" # behat_general::assert_page_contains_text() And I follow "Event monitoring" # behat_general::click_link() And "Subscribe to rule \"Testing1\"" "link" should exist # behat_general::should_exist() And I am on "Course 1" course homepage # behat_theme_boost_behat_navigation::i_am_on_course_homepage() And I navigate to course participants # behat_course::i_navigate_to_course_participants() And I follow "Sam Student" # behat_general::click_link() And I click on "Preferences" "link" in the "#region-main-box" "css_element" # behat_general::i_click_on_in_the() And I should not see "Event monitoring" # behat_general::assert_page_not_contains_text() @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: # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/reset_all_pages.feature:7 Given the following "users" exist: # behat_data_generators::the_following_entities_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: # behat_data_generators::the_following_entity_exists()  | role | user | | moodle/block:edit | allow | | block/myprofile:addinstance | allow | And the following "blocks" exist: # behat_data_generators::the_following_entities_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" # behat_auth::i_log_in_as() And I should see "Comments" # behat_general::assert_page_contains_text() And I log out # behat_auth::i_log_out() And I log in as "student2" # behat_auth::i_log_in_as() And I follow "Profile" in the user menu # behat_theme_boost_behat_navigation::i_follow_in_the_user_menu() And I should see "Logged in user" # behat_general::assert_page_contains_text() And I log out # behat_auth::i_log_out() And I log in as "student3" # behat_auth::i_log_in_as() And I should not see "Comments" # behat_general::assert_page_not_contains_text() And I follow "Profile" in the user menu # behat_theme_boost_behat_navigation::i_follow_in_the_user_menu() And I should not see "Logged in user" # behat_general::assert_page_not_contains_text() And I log out # behat_auth::i_log_out() Scenario: Reset Dashboard for all users # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/reset_all_pages.feature:37 Given I log in as "admin" # behat_auth::i_log_in_as() And I navigate to "Appearance > Default Dashboard page" in site administration # behat_theme_boost_behat_navigation::i_navigate_to_in_site_administration() And I turn editing mode on # behat_theme_boost_behat_navigation::i_turn_editing_mode_on() And I add the "Latest announcements" block # behat_blocks::i_add_the_block() And I open the "Timeline" blocks action menu # behat_blocks::i_open_the_blocks_action_menu() And I follow "Delete Timeline block" # behat_general::click_link() And I press "Yes" # behat_forms::press_button() And I turn editing mode off # behat_theme_boost_behat_navigation::i_turn_editing_mode_off() And I log out # behat_auth::i_log_out() And I log in as "student1" # behat_auth::i_log_in_as() And I should not see "Latest announcements" # behat_general::assert_page_not_contains_text() And I should see "Timeline" # behat_general::assert_page_contains_text() And I log out # behat_auth::i_log_out() And I log in as "student3" # behat_auth::i_log_in_as() And I should not see "Latest announcements" # behat_general::assert_page_not_contains_text() And I should see "Timeline" # behat_general::assert_page_contains_text() And I log out # behat_auth::i_log_out() And I log in as "admin" # behat_auth::i_log_in_as() And I navigate to "Appearance > Default Dashboard page" in site administration # behat_theme_boost_behat_navigation::i_navigate_to_in_site_administration() When I press "Reset Dashboard for all users" # behat_forms::press_button() And I should see "All Dashboard pages have been reset to default." # behat_general::assert_page_contains_text() And I log out # behat_auth::i_log_out() And I log in as "student1" # behat_auth::i_log_in_as() Then I should see "Latest announcements" # behat_general::assert_page_contains_text() And I should not see "Comments" # behat_general::assert_page_not_contains_text() And I should not see "Timeline" # behat_general::assert_page_not_contains_text() And I log out # behat_auth::i_log_out() And I log in as "student3" # behat_auth::i_log_in_as() And I should see "Latest announcements" # behat_general::assert_page_contains_text() And I should not see "Timeline" # behat_general::assert_page_not_contains_text() And I log out # behat_auth::i_log_out() And I am on the "student2" "user > profile" page logged in as student2 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() And I should see "Logged in user" # behat_general::assert_page_contains_text() And I should not see "Latest announcements" # behat_general::assert_page_not_contains_text() Scenario: Reset profile for all users # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/reset_all_pages.feature:80 Given I log in as "admin" # behat_auth::i_log_in_as() And I navigate to "Appearance > Default profile page" in site administration # behat_theme_boost_behat_navigation::i_navigate_to_in_site_administration() And I turn editing mode on # behat_theme_boost_behat_navigation::i_turn_editing_mode_on() And I add the "Latest announcements" block # behat_blocks::i_add_the_block() And I log out # behat_auth::i_log_out() And I am on the "student2" "user > profile" page logged in as student2 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() And I should not see "Latest announcements" # behat_general::assert_page_not_contains_text() And I log out # behat_auth::i_log_out() And I am on the "student3" "user > profile" page logged in as student3 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() And I should not see "Latest announcements" # behat_general::assert_page_not_contains_text() And I log out # behat_auth::i_log_out() And I log in as "admin" # behat_auth::i_log_in_as() And I navigate to "Appearance > Default profile page" in site administration # behat_theme_boost_behat_navigation::i_navigate_to_in_site_administration() When I press "Reset profile for all users" # behat_forms::press_button() And I should see "All profile pages have been reset to default." # behat_general::assert_page_contains_text() And I log out # behat_auth::i_log_out() And I am on the "student2" "user > profile" page logged in as student2 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() Then I should see "Latest announcements" # behat_general::assert_page_contains_text() And I should not see "Logged in user" # behat_general::assert_page_not_contains_text() And I log out # behat_auth::i_log_out() And I am on the "student3" "user > profile" page logged in as student3 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() And I should see "Latest announcements" # behat_general::assert_page_contains_text() And I log out # behat_auth::i_log_out() And I log in as "student1" # behat_auth::i_log_in_as() And I should see "Comments" # behat_general::assert_page_contains_text() And I should not see "Latest announcements" # behat_general::assert_page_not_contains_text() @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: # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/reset_page.feature:7 Given the following "users" exist: # behat_data_generators::the_following_entities_exist()  | username | firstname | lastname | email | | student1 | Student | 1 | student1@example.com | And the following "courses" exist: # behat_data_generators::the_following_entities_exist()  | fullname | shortname | format | | Course 1 | C1 | topics | And the following "course enrolments" exist: # behat_data_generators::the_following_entities_exist()  | user | course | role | | student1 | C1 | student | @javascript Scenario: Add blocks to page and reset # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/reset_page.feature:19 When I log in as "student1" # behat_auth::i_log_in_as() And I turn editing mode on # behat_theme_boost_behat_navigation::i_turn_editing_mode_on() And I add the "Latest announcements" block # behat_blocks::i_add_the_block() And I press "Reset page to default" # behat_forms::press_button() And I click on "Yes" "button" in the "Confirm" "dialogue" # behat_general::i_click_on_in_the() Then "Latest announcements" "block" should not exist # behat_general::should_not_exist() And "Course overview" "block" should exist # behat_general::should_exist() And "Timeline" "block" should exist # behat_general::should_exist() And "Calendar" "block" should exist # behat_general::should_exist() And "Calendar" "block" should not exist in the "region-main" "region" # behat_general::should_not_exist_in_the() And I should not see "Reset page to default" # behat_general::assert_page_not_contains_text() @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: # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/restrict_available_blocks.feature:8 Given the following "users" exist: # behat_data_generators::the_following_entities_exist()  | username | firstname | lastname | email | | student1 | Student | 1 | student1@example.com | And the following "courses" exist: # behat_data_generators::the_following_entities_exist()  | fullname | shortname | format | | Course 1 | C1 | topics | And the following "course enrolments" exist: # behat_data_generators::the_following_entities_exist()  | user | course | role | | student1 | C1 | student | Scenario: The comments block can be added to Dashboard by default # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/restrict_available_blocks.feature:19 And I log in as "student1" # behat_auth::i_log_in_as() And I turn editing mode on # behat_theme_boost_behat_navigation::i_turn_editing_mode_on() Then the add block selector should contain "Comments" block # behat_blocks::the_add_block_selector_should_contain_block() And the add block selector should contain "Text" block # behat_blocks::the_add_block_selector_should_contain_block() And the add block selector should contain "Tags" block # behat_blocks::the_add_block_selector_should_contain_block() Scenario: Remove the ability to add the comments block to Dashboard # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/restrict_available_blocks.feature:26 Given the following "role capability" exists: # behat_data_generators::the_following_entity_exists()  | role | user | | block/comments:myaddinstance | prohibit | | block/course_list:myaddinstance | prohibit | | block/html:myaddinstance | prohibit | When I log in as "student1" # behat_auth::i_log_in_as() And I turn editing mode on # behat_theme_boost_behat_navigation::i_turn_editing_mode_on() Then the add block selector should not contain "Comments" block # behat_blocks::the_add_block_selector_should_not_contain_block() And the add block selector should not contain "Courses" block # behat_blocks::the_add_block_selector_should_not_contain_block() And the add block selector should not contain "Text" block # behat_blocks::the_add_block_selector_should_not_contain_block() And the add block selector should contain "Tags" block # behat_blocks::the_add_block_selector_should_contain_block() @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 # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/welcome.feature:7 Given the following "users" exist: # behat_data_generators::the_following_entities_exist()  | username | password | firstname | lastname | email | | wf | test | Fei | Wang | fei@example.com | And the following "courses" exist: # behat_data_generators::the_following_entities_exist()  | fullname | shortname | | Math 101 | M1O1 | When I am on "Math 101" course homepage # behat_theme_boost_behat_navigation::i_am_on_course_homepage() And I should see "You are not logged in" in the "page-footer" "region" # behat_general::assert_element_contains_text() And I set the field "Username" to "wf" # behat_forms::i_set_the_field_to() And I set the field "Password" to "test" # behat_forms::i_set_the_field_to() And I press "Log in" # behat_forms::press_button() And I should see "Math 101" in the "page-header" "region" # behat_general::assert_element_contains_text() And I should not see "Welcome, Fei!" in the "page-header" "region" # behat_general::assert_element_not_contains_text() And I follow "Dashboard" # behat_general::click_link() Then I should see "Welcome, Fei!" in the "page-header" "region" # behat_general::assert_element_contains_text() @javascript Scenario: Log in and being redirected to default home page # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/welcome.feature:25 When I log in as "admin" # behat_auth::i_log_in_as() And I should see "You are logged in as Admin User" in the "page-footer" "region" # behat_general::assert_element_contains_text() And I should see "Welcome, Admin!" in the "page-header" "region" # behat_general::assert_element_contains_text() And I log out # behat_auth::i_log_out() And I should see "You are not logged in" in the "page-footer" "region" # behat_general::assert_element_contains_text() And I log in as "admin" # behat_auth::i_log_in_as() Then I should see "Hi, Admin!" in the "page-header" "region" # behat_general::assert_element_contains_text() @accessibility @javascript Scenario Outline: The start page must meet accessibility standards when the welcome message is displayed # /Users/huong/Work/moodles/integration_main/moodle/public/my/tests/behat/welcome.feature:35 Given the following config values are set as admin: # behat_admin::the_following_config_values_are_set_as_admin()  | defaulthomepage | | When I log in as "admin" # behat_auth::i_log_in_as() Then I should see "Welcome, Admin!" in the "page-header" "region" # behat_general::assert_element_contains_text() And the page should meet accessibility standards # behat_accessibility::run_axe_validation_for_tags() Examples: | defaulthomepage | | 0 | | 1 | | 2 | 51 scenarios (51 passed) 738 steps (738 passed) 6m4.69s (60.46Mb)