From 341a7b2a97ea0d9e09e1772580823f76d6a941af Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Mon, 10 Jan 2022 15:34:39 +0100 Subject: [PATCH 1/2] MDL-73347 blocks: New unaddableblocks theme setting A new method, get_unaddable_by_theme_block_types(), has been added to block_manager class to let themes define, using the unaddableblocks theme setting, the blocks that won't be displayed in the "Add a block" list. For now, only the boost theme uses it, to disable some of the blocks, like settings, navigation, course_list and section_links (they are still required for classic). --- lib/blocklib.php | 21 +++++++++-- lib/tests/blocklib_test.php | 37 +++++++++++++++++++ lib/upgrade.txt | 2 ++ theme/boost/lang/en/theme_boost.php | 2 ++ theme/boost/settings.php | 9 +++++ theme/boost/tests/behat/addblock.feature | 41 ++++++++++++++++++++++ theme/boost/version.php | 2 +- theme/classic/settings.php | 6 ++++ theme/classic/tests/behat/addblock.feature | 32 +++++++++++++++++ theme/classic/version.php | 2 +- theme/upgrade.txt | 1 + 11 files changed, 151 insertions(+), 4 deletions(-) create mode 100644 theme/boost/tests/behat/addblock.feature create mode 100644 theme/classic/tests/behat/addblock.feature diff --git a/lib/blocklib.php b/lib/blocklib.php index dc391583aef..83e8ca7f356 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -214,15 +214,17 @@ class block_manager { return $this->addableblocks; } - $unaddableblocks = self::get_undeletable_block_types(); + $undeletableblocks = self::get_undeletable_block_types(); + $unaddablebythemeblocks = $this->get_unaddable_by_theme_block_types(); $requiredbythemeblocks = $this->get_required_by_theme_block_types(); $pageformat = $this->page->pagetype; foreach($allblocks as $block) { if (!$bi = block_instance($block->name)) { continue; } - if ($block->visible && !in_array($block->name, $unaddableblocks) && + if ($block->visible && !in_array($block->name, $undeletableblocks) && !in_array($block->name, $requiredbythemeblocks) && + !in_array($block->name, $unaddablebythemeblocks) && $bi->can_block_be_added($this->page) && ($bi->instance_allow_multiple() || !$this->is_block_present($block->name)) && blocks_name_allowed_in_format($block->name, $pageformat) && @@ -428,6 +430,21 @@ class block_manager { } } + /** + * It returns the list of blocks that can't be displayed in the "Add a block" list. + * This information is taken from the unaddableblocks theme setting. + * + * @return array A list with the blocks that won't be displayed in the "Add a block" list. + */ + public function get_unaddable_by_theme_block_types(): array { + $unaddablebythemeblocks = []; + if (isset($this->page->theme->settings->unaddableblocks) && !empty($this->page->theme->settings->unaddableblocks)) { + $unaddablebythemeblocks = array_map('trim', explode(',', $this->page->theme->settings->unaddableblocks)); + } + + return $unaddablebythemeblocks; + } + /** * Make this block type undeletable and unaddable. * diff --git a/lib/tests/blocklib_test.php b/lib/tests/blocklib_test.php index f15ce7b32ad..a8cc9a7f41f 100644 --- a/lib/tests/blocklib_test.php +++ b/lib/tests/blocklib_test.php @@ -826,6 +826,43 @@ class core_blocklib_testcase extends advanced_testcase { $this->assertEquals('8', $mybr[5]->instance->weight); $PAGE = $storedpage; } + + /** + * Test get_unaddable_by_theme_block_types() method to return expected result depending on the theme. + * + * @covers \block_manager::get_unaddable_by_theme_block_types + */ + public function test_get_unaddable_by_theme_block_types(): void { + global $CFG, $PAGE; + + $this->setAdminUser(); + $this->resetAfterTest(); + $regionname = 'side-pre'; + $context = context_system::instance(); + + $PAGE->reset_theme_and_output(); + $CFG->theme = 'boost'; + + list($page, $blockmanager) = $this->get_a_page_and_block_manager([$regionname], $context, 'page-type'); + $blockmanager->load_blocks(); + $blocks = $blockmanager->get_unaddable_by_theme_block_types(); + // Assert that a few blocks are excluded for boost theme. + $this->assertCount(4, $blocks); + $this->assertContains('navigation', $blocks); + $this->assertContains('settings', $blocks); + $this->assertContains('course_list', $blocks); + $this->assertContains('section_links', $blocks); + + // Change to a theme without unaddable blocks. + $PAGE->reset_theme_and_output(); + $CFG->theme = 'classic'; + + list($page, $blockmanager) = $this->get_a_page_and_block_manager([$regionname], $context, 'page-type'); + $blockmanager->load_blocks(); + $blocks = $blockmanager->get_unaddable_by_theme_block_types(); + // Assert that no blocks are excluded for classic theme. + $this->assertEmpty($blocks); + } } /** diff --git a/lib/upgrade.txt b/lib/upgrade.txt index b5fdd52d3cc..a5a9d147d95 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -163,6 +163,8 @@ current value for a pluginname depending on its status (enabled, disabled, other * /renderer.php * /rsslib.php This default applies both when there is no supplied coverage.php file, and is used to supplement any existing coverage configuration file if one is found. +* New method get_unaddable_by_theme_block_types() has been added to block_manager class. It uses the 'unaddableblocks' theme setting +value to get the list of blocks that won't be displayed for a theme. === 3.11.4 === * A new option dontforcesvgdownload has been added to the $options parameter of the send_file() function. diff --git a/theme/boost/lang/en/theme_boost.php b/theme/boost/lang/en/theme_boost.php index 16f509b45d9..2260c455bd4 100644 --- a/theme/boost/lang/en/theme_boost.php +++ b/theme/boost/lang/en/theme_boost.php @@ -50,6 +50,8 @@ $string['rawscsspre'] = 'Raw initial SCSS'; $string['rawscsspre_desc'] = 'In this field you can provide initialising SCSS code, it will be injected before everything else. Most of the time you will use this setting to define variables.'; $string['region-side-pre'] = 'Right'; $string['showfooter'] = 'Show footer'; +$string['unaddableblocks'] = 'Unaddable blocks'; +$string['unaddableblocks_desc'] = 'The blocks defined in this field will not be displayed in the "Add a block" list.'; $string['privacy:metadata:preference:draweropennav'] = 'The user\'s preference for hiding or showing the drawer menu navigation.'; $string['privacy:drawernavclosed'] = 'The current preference for the navigation drawer is closed.'; $string['privacy:drawernavopen'] = 'The current preference for the navigation drawer is open.'; diff --git a/theme/boost/settings.php b/theme/boost/settings.php index 08ddf3d96d7..46f9d9a4aca 100644 --- a/theme/boost/settings.php +++ b/theme/boost/settings.php @@ -26,6 +26,15 @@ if ($ADMIN->fulltree) { $settings = new theme_boost_admin_settingspage_tabs('themesettingboost', get_string('configtitle', 'theme_boost')); $page = new admin_settingpage('theme_boost_general', get_string('generalsettings', 'theme_boost')); + // Unaddable blocks. + // Blocks to be excluded when this theme is enabled in the "Add a block" list: Administration, Navigation, Courses and + // Section links. + $default = 'navigation,settings,course_list,section_links'; + $setting = new admin_setting_configtext('theme_boost/unaddableblocks', + get_string('unaddableblocks', 'theme_boost'), get_string('unaddableblocks_desc', 'theme_boost'), $default, PARAM_TEXT); + $setting->set_updatedcallback('theme_reset_all_caches'); + $page->add($setting); + // Preset. $name = 'theme_boost/preset'; $title = get_string('preset', 'theme_boost'); diff --git a/theme/boost/tests/behat/addblock.feature b/theme/boost/tests/behat/addblock.feature new file mode 100644 index 00000000000..d786b887ef1 --- /dev/null +++ b/theme/boost/tests/behat/addblock.feature @@ -0,0 +1,41 @@ +@javascript @theme_boost +Feature: Add a block using boost theme + In order to decide the blocks to display in the Add a block list for a theme + As an administrator + I need to define them using the unaddableblocks setting + + Background: + Given the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And I log in as "admin" + + Scenario: Default blocks defined in unaddableblocks settings are not displayed in the Add a block list + Given I am on "Course 1" course homepage with editing mode on + When I click on "Add a block" "link" + Then I should not see "Administration" + And I should not see "Navigation" + And I should not see "Courses" + And I should not see "Section links" + And I should see "Online users" + + Scenario: Admins can change unaddable blocks using the unaddableblocks setting + Given the following config values are set as admin: + | unaddableblocks | settings,private_files | theme_boost| + And I am on "Course 1" course homepage with editing mode on + When I click on "Add a block" "link" + Then I should not see "Administration" + And I should not see "Private files" + And I should see "Navigation" + And I should see "Courses" + And I should see "Section links" + + Scenario: If unaddableblocks settting is empty, no block is excluded from the Add a block list + Given the following config values are set as admin: + | unaddableblocks | | theme_boost| + And I am on "Course 1" course homepage with editing mode on + When I click on "Add a block" "link" + Then I should see "Administration" + And I should see "Navigation" + And I should see "Courses" + And I should see "Section links" diff --git a/theme/boost/version.php b/theme/boost/version.php index 60cffec1fd7..32de59ba0f3 100644 --- a/theme/boost/version.php +++ b/theme/boost/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2021052506; +$plugin->version = 2022011000; $plugin->requires = 2021052500; $plugin->component = 'theme_boost'; diff --git a/theme/classic/settings.php b/theme/classic/settings.php index 66049cbb665..40cad98ae81 100644 --- a/theme/classic/settings.php +++ b/theme/classic/settings.php @@ -35,6 +35,12 @@ if ($ADMIN->fulltree) { $setting->set_updatedcallback('theme_reset_all_caches'); $page->add($setting); + // Unaddable blocks. + $setting = new admin_setting_configtext('theme_classic/unaddableblocks', + get_string('unaddableblocks', 'theme_boost'), get_string('unaddableblocks_desc', 'theme_boost'), '', PARAM_TEXT); + $setting->set_updatedcallback('theme_reset_all_caches'); + $page->add($setting); + // Preset. $name = 'theme_classic/preset'; $title = get_string('preset', 'theme_classic'); diff --git a/theme/classic/tests/behat/addblock.feature b/theme/classic/tests/behat/addblock.feature new file mode 100644 index 00000000000..01ef799510a --- /dev/null +++ b/theme/classic/tests/behat/addblock.feature @@ -0,0 +1,32 @@ +@javascript @theme_classic +Feature: Add a block using classic theme + In order to check the blocks to display in the Add a block list for a them + As an administrator + I need to confirm the unaddableblocks setting is empty for classic. + + Background: + Given the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And I log in as "admin" + + Scenario: All the expected blocks are displayed in the Add a block list for classic + Given I am on "Course 1" course homepage with editing mode on + When I click on "Add a block" "select" + Then I should see "Administration" + And I should see "Navigation" + And I should see "Courses" + And I should see "Section links" + + Scenario: Admins can change unaddable blocks using the unaddableblocks setting for classic + Given the following config values are set as admin: + | unaddableblocks | online_users,private_files,settings | theme_classic| + And I am on "Course 1" course homepage with editing mode on + When I click on "Add a block" "select" + Then I should not see "Online users" + And I should not see "Private files" + # The settings block is defined as required block for classic, so it will be displayed always. + And I should see "Administration" + And I should see "Navigation" + And I should see "Courses" + And I should see "Section links" diff --git a/theme/classic/version.php b/theme/classic/version.php index b06814f07e7..e27729af4ff 100644 --- a/theme/classic/version.php +++ b/theme/classic/version.php @@ -25,7 +25,7 @@ // This line protects the file from being accessed by a URL directly. defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2021052500; +$plugin->version = 2022011400; $plugin->requires = 2021052500; $plugin->component = 'theme_classic'; $plugin->dependencies = array('theme_boost' => 2021052500); diff --git a/theme/upgrade.txt b/theme/upgrade.txt index 605cc11a824..99583776ec8 100644 --- a/theme/upgrade.txt +++ b/theme/upgrade.txt @@ -3,6 +3,7 @@ information provided here is intended especially for theme designer. === 4.0 === * A new theme config 'usescourseindex' allows a theme to specify whether it implements and uses course index. +* A new theme setting 'unaddableblocks' allows admins to define the blocks that won't be displayed in the "Add a block" list. === 3.11 === * The classname 'viewmode-cobmined' in course/management.php has been changed to 'viewmode-combined' From 53fe23d8b5846d7de10778cb1765c2891e9af155 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Mon, 10 Jan 2022 16:16:11 +0100 Subject: [PATCH 2/2] MDL-73347 behat: Add blocks hidden by default for boost For the boost them, a few themes have been hidden by default. The unaddable setting should be set to let admins add them again, because some behat tests need them. --- .../tests/behat/manage_conditions.feature | 4 +++- .../tests/behat/import_contentbank_content.feature | 2 ++ badges/tests/behat/add_badge.feature | 4 ++++ badges/tests/behat/award_badge.feature | 2 ++ .../behat/block_blog_recent_frontpage.feature | 2 ++ blocks/blog_tags/tests/behat/blogtag.feature | 2 ++ .../tests/behat/block_course_list_category.feature | 6 ++++++ .../tests/behat/block_course_list_course.feature | 12 ++++++++++-- .../behat/block_course_list_dashboard.feature | 6 ++++++ .../behat/block_course_list_frontpage.feature | 8 ++++++++ .../tests/behat/expand_courses_node.feature | 2 ++ .../tests/behat/participants_link.feature | 2 ++ .../navigation/tests/behat/view_my_courses.feature | 2 ++ .../tests/behat/block_section_links_course.feature | 12 +++++++++--- .../tests/behat/show_section_name.feature | 2 ++ .../behat/configuring_tag_flickr_block.feature | 2 ++ .../behat/configure_tag_youtube_block.feature | 4 ++++ blog/tests/behat/comment.feature | 2 ++ blog/tests/behat/delete.feature | 2 ++ .../h5p/tests/behat/admin_replace_content.feature | 2 ++ .../h5p/tests/behat/admin_upload_content.feature | 4 ++++ .../h5p/tests/behat/disable_contenttypes.feature | 2 ++ .../h5p/tests/behat/manage_content.feature | 2 ++ .../tests/behat/teacher_replace_content.feature | 2 ++ .../h5p/tests/behat/teacher_upload_content.feature | 14 ++++++++++++++ contentbank/tests/behat/delete_content.feature | 2 ++ contentbank/tests/behat/download_content.feature | 2 ++ contentbank/tests/behat/edit_content.feature | 2 ++ contentbank/tests/behat/events.feature | 2 ++ contentbank/tests/behat/navigate_content.feature | 4 ++++ contentbank/tests/behat/search_content.feature | 2 ++ contentbank/tests/behat/sort_content.feature | 4 ++++ contentbank/tests/behat/view_preferences.feature | 2 ++ contentbank/tests/behat/visibility.feature | 2 ++ course/tests/behat/course_browsing.feature | 2 ++ course/tests/behat/course_controls.feature | 4 ++++ course/tests/behat/coursetags.feature | 4 ++++ course/tests/behat/general_section.feature | 2 ++ course/tests/behat/navigate_course_list.feature | 2 ++ .../tests/behat/entries_require_approval.feature | 2 ++ .../tests/behat/inline_editing_content.feature | 4 ++++ my/tests/behat/restrict_available_blocks.feature | 1 - notes/tests/behat/participants_notes.feature | 2 ++ .../contentbank/tests/behat/file_update.feature | 4 ++++ tag/tests/behat/collections.feature | 2 ++ tag/tests/behat/edit_tag.feature | 6 ++++++ tag/tests/behat/flag_tags.feature | 6 ++++++ tag/tests/behat/tagindex.feature | 4 ++++ user/tests/behat/set_default_homepage.feature | 2 ++ 49 files changed, 166 insertions(+), 7 deletions(-) diff --git a/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature b/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature index 4185bb1e341..a948796b8d8 100644 --- a/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature +++ b/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature @@ -7,7 +7,9 @@ Feature: Manage availability conditions @javascript Scenario: Display list of availability conditions # Check the report doesn't show when not enabled. - Given I log in as "admin" + Given the following config values are set as admin: + | unaddableblocks | | theme_boost| + And I log in as "admin" And I turn editing mode on And I add the "Administration" block if not present And the following config values are set as admin: diff --git a/backup/util/ui/tests/behat/import_contentbank_content.feature b/backup/util/ui/tests/behat/import_contentbank_content.feature index 0417651f68b..028780a79e7 100644 --- a/backup/util/ui/tests/behat/import_contentbank_content.feature +++ b/backup/util/ui/tests/behat/import_contentbank_content.feature @@ -6,6 +6,8 @@ Feature: Import course content bank content Background: Given I log in as "admin" + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I am on site homepage And I turn editing mode on And I add the "Navigation" block if not present diff --git a/badges/tests/behat/add_badge.feature b/badges/tests/behat/add_badge.feature index a59459c7fe2..c4c3240918a 100644 --- a/badges/tests/behat/add_badge.feature +++ b/badges/tests/behat/add_badge.feature @@ -11,6 +11,8 @@ Feature: Add badges to the system @javascript Scenario: Accessing the badges And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Badges" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" @@ -132,6 +134,8 @@ Feature: Add badges to the system @javascript @_file_upload Scenario: Add a badge from Site badges section Given I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Badges" link not accessible without navigation block. And I add the "Navigation" block if not present When I click on "Site pages" "list_item" in the "Navigation" "block" diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature index d9947f6d624..8ca0a4bb0dd 100644 --- a/badges/tests/behat/award_badge.feature +++ b/badges/tests/behat/award_badge.feature @@ -98,6 +98,8 @@ Feature: Award badges # Teacher 1 should NOT have access to manage/create site badges in the Site badges section. When I am on homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Badges" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" diff --git a/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature b/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature index e7403cd513b..aa5fd1f6a71 100644 --- a/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature +++ b/blocks/blog_recent/tests/behat/block_blog_recent_frontpage.feature @@ -12,6 +12,8 @@ Feature: Feature: Students can use the recent blog entries block to view recent 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 diff --git a/blocks/blog_tags/tests/behat/blogtag.feature b/blocks/blog_tags/tests/behat/blogtag.feature index 8cf6b27804a..a6e7ba4b141 100644 --- a/blocks/blog_tags/tests/behat/blogtag.feature +++ b/blocks/blog_tags/tests/behat/blogtag.feature @@ -23,6 +23,8 @@ Feature: Adding blog tag block When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I add the "Blog tags" 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 diff --git a/blocks/course_list/tests/behat/block_course_list_category.feature b/blocks/course_list/tests/behat/block_course_list_category.feature index 53ec6cc0da4..9d817454fda 100644 --- a/blocks/course_list/tests/behat/block_course_list_category.feature +++ b/blocks/course_list/tests/behat/block_course_list_category.feature @@ -31,6 +31,8 @@ Feature: Enable the course_list block on a category page and view it's contents And I turn editing mode on And I am on course index And I follow "Category 1" + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Courses" block And I log out When I log in as "teacher1" @@ -49,6 +51,8 @@ Feature: Enable the course_list block on a category page and view it's contents And I turn editing mode on And I am on course index And I follow "Category 1" + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Courses" block And I log out When I log in as "teacher1" @@ -67,6 +71,8 @@ Feature: Enable the course_list block on a category page and view it's contents And I turn editing mode on And I am on course index And I follow "Category 1" + And the following config values are set as admin: + | unaddableblocks | | theme_boost| When I add the "Courses" block Then I should see "Category 1" in the "Course categories" "block" And I should see "Category A" in the "Course categories" "block" diff --git a/blocks/course_list/tests/behat/block_course_list_course.feature b/blocks/course_list/tests/behat/block_course_list_course.feature index e88161bec23..8d0fbc0c6bc 100644 --- a/blocks/course_list/tests/behat/block_course_list_course.feature +++ b/blocks/course_list/tests/behat/block_course_list_course.feature @@ -28,6 +28,8 @@ Feature: Enable the course_list block on a course page and view it's contents Scenario: Add the course list block on course page and navigate to the course listing Given I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| When I add the "Courses" block Then I should see "Course 1" in the "My courses" "block" And I should see "Course 2" in the "My courses" "block" @@ -39,6 +41,8 @@ Feature: Enable the course_list block on a course page and view it's contents Scenario: Add the course list block on course page and navigate to another course Given I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| When I add the "Courses" block Then I should see "Course 1" in the "My courses" "block" And I should see "Course 2" in the "My courses" "block" @@ -50,6 +54,8 @@ Feature: Enable the course_list block on a course page and view it's contents Scenario: Add the course list block on course page and view as an admin Given I log in as "admin" And I am on "Course 1" course homepage with editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| When I add the "Courses" block Then I should see "Category 1" in the "Course categories" "block" And I should see "Category A" in the "Course categories" "block" @@ -62,7 +68,8 @@ Feature: Enable the course_list block on a course page and view it's contents Scenario: View the course list block on course page with hide all courses link enabled Given the following config values are set as admin: - | block_course_list_hideallcourseslink | 1 | + | block_course_list_hideallcourseslink | 1 | | + | unaddableblocks | | theme_boost| And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on When I add the "Courses" block @@ -70,7 +77,8 @@ Feature: Enable the course_list block on a course page and view it's contents Scenario: View the course list block on course page with admin sees own course enabled Given the following config values are set as admin: - | block_course_list_adminview | own | + | block_course_list_adminview | own | | + | unaddableblocks | | theme_boost| And the following "course enrolments" exist: | user | course | role | | admin | C1 | editingteacher | diff --git a/blocks/course_list/tests/behat/block_course_list_dashboard.feature b/blocks/course_list/tests/behat/block_course_list_dashboard.feature index 2b5df28cbeb..459d162472a 100644 --- a/blocks/course_list/tests/behat/block_course_list_dashboard.feature +++ b/blocks/course_list/tests/behat/block_course_list_dashboard.feature @@ -28,6 +28,8 @@ Feature: Enable the course_list block on the dashboard and view it's contents Scenario: Add the course list block on the dashboard and navigate to the course listing Given I log in as "teacher1" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| When I add the "Courses" block Then I should see "Course 1" in the "My courses" "block" And I should see "Course 2" in the "My courses" "block" @@ -39,6 +41,8 @@ Feature: Enable the course_list block on the dashboard and view it's contents Scenario: Add the course list block on the dashboard and navigate to another course Given I log in as "teacher1" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| When I add the "Courses" block Then I should see "Course 1" in the "My courses" "block" And I should see "Course 2" in the "My courses" "block" @@ -50,6 +54,8 @@ Feature: Enable the course_list block on the dashboard and view it's contents Scenario: Add the course list block on the dashboard and view as an admin Given I log in as "admin" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| When I add the "Courses" block Then I should see "Category 1" in the "Course categories" "block" And I should see "Category A" in the "Course categories" "block" diff --git a/blocks/course_list/tests/behat/block_course_list_frontpage.feature b/blocks/course_list/tests/behat/block_course_list_frontpage.feature index 0f8b0c5845c..c0c6ba286fb 100644 --- a/blocks/course_list/tests/behat/block_course_list_frontpage.feature +++ b/blocks/course_list/tests/behat/block_course_list_frontpage.feature @@ -29,6 +29,8 @@ Feature: Enable the course_list block on the frontpage and view it's contents Given I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Courses" block And I log out When I log in as "teacher1" @@ -44,6 +46,8 @@ Feature: Enable the course_list block on the frontpage and view it's contents Given I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Courses" block And I log out When I log in as "teacher1" @@ -59,6 +63,8 @@ Feature: Enable the course_list block on the frontpage and view it's contents Given I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| When I add the "Courses" block Then I should see "Category 1" in the "Course categories" "block" And I should see "Category A" in the "Course categories" "block" @@ -73,6 +79,8 @@ Feature: Enable the course_list block on the frontpage and view it's contents Given I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Courses" block And I log out When I log in as "guest" diff --git a/blocks/navigation/tests/behat/expand_courses_node.feature b/blocks/navigation/tests/behat/expand_courses_node.feature index e12b4bf3f44..7436be0f63a 100644 --- a/blocks/navigation/tests/behat/expand_courses_node.feature +++ b/blocks/navigation/tests/behat/expand_courses_node.feature @@ -39,6 +39,8 @@ Feature: Expand the courses nodes within the navigation block And I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: diff --git a/blocks/navigation/tests/behat/participants_link.feature b/blocks/navigation/tests/behat/participants_link.feature index 76533c9e935..f08ce38d867 100644 --- a/blocks/navigation/tests/behat/participants_link.feature +++ b/blocks/navigation/tests/behat/participants_link.feature @@ -18,6 +18,8 @@ Feature: Displaying the link to the Participants page And I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: diff --git a/blocks/navigation/tests/behat/view_my_courses.feature b/blocks/navigation/tests/behat/view_my_courses.feature index 2b086ce7445..04364afca12 100644 --- a/blocks/navigation/tests/behat/view_my_courses.feature +++ b/blocks/navigation/tests/behat/view_my_courses.feature @@ -32,6 +32,8 @@ Feature: View my courses in navigation block And I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: diff --git a/blocks/section_links/tests/behat/block_section_links_course.feature b/blocks/section_links/tests/behat/block_section_links_course.feature index c1fd0b2b03c..d94ac4794a0 100644 --- a/blocks/section_links/tests/behat/block_section_links_course.feature +++ b/blocks/section_links/tests/behat/block_section_links_course.feature @@ -21,14 +21,18 @@ Feature: The section links block allows users to quickly navigate around a moodl And I am on "Course 1" course homepage with editing mode on Scenario: Add the section links block to a course. - Given I add the "Section links" block + Given the following config values are set as admin: + | unaddableblocks | | theme_boost| + And I add the "Section links" block And I turn editing mode off And I should see "5" in the "Section links" "block" When I follow "5" Then I should see "Test assignment 1" Scenario: Add the section links block to a course and limit the sections displayed. - Given I add the "Section links" block + Given the following config values are set as admin: + | unaddableblocks | | theme_boost| + And I add the "Section links" block And I configure the "Section links" block And I set the following fields to these values: | id_config_numsections1 | 5 | @@ -42,7 +46,9 @@ Feature: The section links block allows users to quickly navigate around a moodl Then I should see "Test assignment 1" Scenario: Add the section links block to a course and limit the sections displayed using the alternative number of sections. - Given I add the "Section links" block + Given the following config values are set as admin: + | unaddableblocks | | theme_boost| + And I add the "Section links" block And I configure the "Section links" block And I set the following fields to these values: | id_config_numsections1 | 5 | diff --git a/blocks/section_links/tests/behat/show_section_name.feature b/blocks/section_links/tests/behat/show_section_name.feature index a12dadbe1d9..7d3b3d3a51e 100644 --- a/blocks/section_links/tests/behat/show_section_name.feature +++ b/blocks/section_links/tests/behat/show_section_name.feature @@ -20,6 +20,8 @@ Feature: The Section links block can be configured to display section name in ad | showsectionname | 1 | block_section_links | And I log in as "admin" 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 I log out diff --git a/blocks/tag_flickr/tests/behat/configuring_tag_flickr_block.feature b/blocks/tag_flickr/tests/behat/configuring_tag_flickr_block.feature index c6670012b9b..e9569f3055b 100644 --- a/blocks/tag_flickr/tests/behat/configuring_tag_flickr_block.feature +++ b/blocks/tag_flickr/tests/behat/configuring_tag_flickr_block.feature @@ -8,6 +8,8 @@ Feature: Adding and configuring Flickr block Scenario: Adding Flickr block to the tags site page Given I log in as "admin" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" diff --git a/blocks/tag_youtube/tests/behat/configure_tag_youtube_block.feature b/blocks/tag_youtube/tests/behat/configure_tag_youtube_block.feature index f1efd5e5be4..75f82e78c95 100644 --- a/blocks/tag_youtube/tests/behat/configure_tag_youtube_block.feature +++ b/blocks/tag_youtube/tests/behat/configure_tag_youtube_block.feature @@ -15,6 +15,8 @@ Feature: Adding and configuring YouTube block | apikey | | block_tag_youtube | And I follow "Dashboard" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" @@ -35,6 +37,8 @@ Feature: Adding and configuring YouTube block | apikey | invalidapikeyvalue | block_tag_youtube | And I follow "Dashboard" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" And I click on "Tags" "link" in the "Navigation" "block" diff --git a/blog/tests/behat/comment.feature b/blog/tests/behat/comment.feature index 456ac5d77cf..f38d6eae5db 100644 --- a/blog/tests/behat/comment.feature +++ b/blog/tests/behat/comment.feature @@ -12,6 +12,8 @@ Feature: Comment on a blog entry And I log in as "admin" And I am on site homepage And I turn editing mode on + 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 configure the "Navigation" block diff --git a/blog/tests/behat/delete.feature b/blog/tests/behat/delete.feature index 01198204071..5bb2c0e0fce 100644 --- a/blog/tests/behat/delete.feature +++ b/blog/tests/behat/delete.feature @@ -11,6 +11,8 @@ Feature: Delete a blog entry And I log in as "admin" And I am on site homepage And I turn editing mode on + 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 configure the "Navigation" block diff --git a/contentbank/contenttype/h5p/tests/behat/admin_replace_content.feature b/contentbank/contenttype/h5p/tests/behat/admin_replace_content.feature index c34e19f0128..25fa5866701 100644 --- a/contentbank/contenttype/h5p/tests/behat/admin_replace_content.feature +++ b/contentbank/contenttype/h5p/tests/behat/admin_replace_content.feature @@ -10,6 +10,8 @@ Feature: Replace H5P file from an existing content | System | | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p | And I log in as "admin" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" diff --git a/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature b/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature index 80bfb717592..06f95093f4e 100644 --- a/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature +++ b/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature @@ -10,6 +10,8 @@ Feature: H5P file upload to content bank for admins And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager And I click on "Save changes" "button" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" @@ -66,6 +68,8 @@ Feature: H5P file upload to content bank for admins And I wait until the page is ready Then I should see "filltheblanks.h5p" And I am on "Course 1" course homepage + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" diff --git a/contentbank/contenttype/h5p/tests/behat/disable_contenttypes.feature b/contentbank/contenttype/h5p/tests/behat/disable_contenttypes.feature index fa2e8b09664..c001b809f50 100644 --- a/contentbank/contenttype/h5p/tests/behat/disable_contenttypes.feature +++ b/contentbank/contenttype/h5p/tests/behat/disable_contenttypes.feature @@ -21,6 +21,8 @@ Feature: Disable H5P content-types from the content bank | Course | C1 | contenttype_h5p | admin | invalidh5p | /h5p/tests/fixtures/h5ptest.zip | And I log in as "admin" 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 "Navigation" block if not present And I log out diff --git a/contentbank/contenttype/h5p/tests/behat/manage_content.feature b/contentbank/contenttype/h5p/tests/behat/manage_content.feature index aff59f1ea08..800974e2400 100644 --- a/contentbank/contenttype/h5p/tests/behat/manage_content.feature +++ b/contentbank/contenttype/h5p/tests/behat/manage_content.feature @@ -25,6 +25,8 @@ Feature: Manage H5P content from the content bank | Course | C1 | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p | | Course | C1 | contenttype_h5p | teacher1 | ipsums.h5p | /h5p/tests/fixtures/ipsums.h5p | 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 "Navigation" block if not present And I log out diff --git a/contentbank/contenttype/h5p/tests/behat/teacher_replace_content.feature b/contentbank/contenttype/h5p/tests/behat/teacher_replace_content.feature index 014b032aa3f..2c208a1b3ba 100644 --- a/contentbank/contenttype/h5p/tests/behat/teacher_replace_content.feature +++ b/contentbank/contenttype/h5p/tests/behat/teacher_replace_content.feature @@ -30,6 +30,8 @@ Feature: Replace H5P file from an existing content requires special capabilities And I log out And I log in as "teacher1" 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 "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" diff --git a/contentbank/contenttype/h5p/tests/behat/teacher_upload_content.feature b/contentbank/contenttype/h5p/tests/behat/teacher_upload_content.feature index 1146a082656..243caac4dfd 100644 --- a/contentbank/contenttype/h5p/tests/behat/teacher_upload_content.feature +++ b/contentbank/contenttype/h5p/tests/behat/teacher_upload_content.feature @@ -26,12 +26,16 @@ Feature: H5P file upload to content bank for non admins Scenario: Teachers can not access system level content bank Given I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present When I expand "Site pages" node Then I should not see "Content bank" Scenario: Teachers can access course level content bank Given 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 "Navigation" block if not present When I expand "Site pages" node Then I should see "Content bank" @@ -45,6 +49,8 @@ Feature: H5P file upload to content bank for non admins And I log out And I log in as "teacher1" 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 "Navigation" block if not present When I expand "Site pages" node And I click on "Content bank" "link" @@ -67,6 +73,8 @@ Feature: H5P file upload to content bank for non admins And I log out And I log in as "teacher1" 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 "Navigation" block if not present When I expand "Site pages" node And I click on "Content bank" "link" @@ -81,6 +89,8 @@ Feature: H5P file upload to content bank for non admins And I log out When I log in as "teacher2" 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 "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" @@ -94,6 +104,8 @@ Feature: H5P file upload to content bank for non admins And I log out And I log in as "teacher1" 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 "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" @@ -127,6 +139,8 @@ Feature: H5P file upload to content bank for non admins And I log out And I log in as "teacher1" Given 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 "Navigation" block if not present When I expand "Site pages" node And I click on "Content bank" "link" diff --git a/contentbank/tests/behat/delete_content.feature b/contentbank/tests/behat/delete_content.feature index 935be35a5ce..312e3d158af 100644 --- a/contentbank/tests/behat/delete_content.feature +++ b/contentbank/tests/behat/delete_content.feature @@ -11,6 +11,8 @@ Feature: Delete H5P file from the content bank And I click on "Save changes" "button" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: diff --git a/contentbank/tests/behat/download_content.feature b/contentbank/tests/behat/download_content.feature index b10a1113f30..eb45d881108 100644 --- a/contentbank/tests/behat/download_content.feature +++ b/contentbank/tests/behat/download_content.feature @@ -18,6 +18,8 @@ Feature: Download H5P content from the content bank And I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: diff --git a/contentbank/tests/behat/edit_content.feature b/contentbank/tests/behat/edit_content.feature index 4600726efc8..8479af6f96d 100644 --- a/contentbank/tests/behat/edit_content.feature +++ b/contentbank/tests/behat/edit_content.feature @@ -8,6 +8,8 @@ Feature: Content bank use editor feature Given I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: diff --git a/contentbank/tests/behat/events.feature b/contentbank/tests/behat/events.feature index b89437a601f..765f1f5fc01 100644 --- a/contentbank/tests/behat/events.feature +++ b/contentbank/tests/behat/events.feature @@ -20,6 +20,8 @@ Feature: Confirm content bank events are triggered And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager And I click on "Save changes" "button" 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 "Navigation" block if not present Scenario: Content created and uploaded events when uploading a content file diff --git a/contentbank/tests/behat/navigate_content.feature b/contentbank/tests/behat/navigate_content.feature index 99459896eb6..a34e52a60a6 100644 --- a/contentbank/tests/behat/navigate_content.feature +++ b/contentbank/tests/behat/navigate_content.feature @@ -29,6 +29,8 @@ Feature: Navigate to different contexts in the content bank Scenario: Admins can view and navigate to all the contexts in the content bank Given I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node When I click on "Content bank" "link" @@ -64,6 +66,8 @@ Feature: Navigate to different contexts in the content bank And I log out And I am on the "C0" "Course" page logged in as "teacher" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node When I click on "Content bank" "link" diff --git a/contentbank/tests/behat/search_content.feature b/contentbank/tests/behat/search_content.feature index 561f10699b0..6607d1c4870 100644 --- a/contentbank/tests/behat/search_content.feature +++ b/contentbank/tests/behat/search_content.feature @@ -23,6 +23,8 @@ Feature: Search content in the content bank Scenario: Admins can search content in the content bank Given I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" diff --git a/contentbank/tests/behat/sort_content.feature b/contentbank/tests/behat/sort_content.feature index be28927d234..cf756632721 100644 --- a/contentbank/tests/behat/sort_content.feature +++ b/contentbank/tests/behat/sort_content.feature @@ -27,6 +27,8 @@ Feature: Sort content in the content bank Scenario: Admins can order content in the content bank Given I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" @@ -43,6 +45,8 @@ Feature: Sort content in the content bank Scenario: Admins can order content depending on the author Given I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" diff --git a/contentbank/tests/behat/view_preferences.feature b/contentbank/tests/behat/view_preferences.feature index 31668c510f1..c88af5cde6f 100644 --- a/contentbank/tests/behat/view_preferences.feature +++ b/contentbank/tests/behat/view_preferences.feature @@ -12,6 +12,8 @@ Feature: Store the content bank view preference And I click on "Save changes" "button" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: diff --git a/contentbank/tests/behat/visibility.feature b/contentbank/tests/behat/visibility.feature index b2bbe807a55..5fbacea2769 100644 --- a/contentbank/tests/behat/visibility.feature +++ b/contentbank/tests/behat/visibility.feature @@ -8,6 +8,8 @@ Feature: Make content public or unlisted Given I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: diff --git a/course/tests/behat/course_browsing.feature b/course/tests/behat/course_browsing.feature index 586859d2a3c..e4bb0c2e716 100644 --- a/course/tests/behat/course_browsing.feature +++ b/course/tests/behat/course_browsing.feature @@ -37,6 +37,8 @@ Feature: Restricting access to course lists | moodle/category:viewcourselist | Allow | And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I log out And the following "role assigns" exist: diff --git a/course/tests/behat/course_controls.feature b/course/tests/behat/course_controls.feature index 625eca8a8cd..ca25565ea2e 100644 --- a/course/tests/behat/course_controls.feature +++ b/course/tests/behat/course_controls.feature @@ -68,6 +68,8 @@ Feature: Course activity controls works as expected And I show section "1" And "section" exist And section "1" should be visible + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Section links" block And "section" exist And I should see "1 2 3 4 5" in the "Section links" "block" @@ -127,6 +129,8 @@ Feature: Course activity controls works as expected And I show section "1" And "section" exist And section "1" should be visible + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Section links" block And "section" exist And I should see "1 2 3 4 5" in the "Section links" "block" diff --git a/course/tests/behat/coursetags.feature b/course/tests/behat/coursetags.feature index a9e9c6b2285..fa29d31e985 100644 --- a/course/tests/behat/coursetags.feature +++ b/course/tests/behat/coursetags.feature @@ -48,6 +48,8 @@ Feature: Tagging courses And I log out And I log in as "user1" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" @@ -85,6 +87,8 @@ Feature: Tagging courses And I log out And I log in as "user1" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" diff --git a/course/tests/behat/general_section.feature b/course/tests/behat/general_section.feature index ba6f10b12fe..09d82044961 100644 --- a/course/tests/behat/general_section.feature +++ b/course/tests/behat/general_section.feature @@ -19,6 +19,8 @@ Feature: General section does not show in navigation when empty | forum | Test forum name | Test forum name description | C1 | forum1 | 1 | And I log in as "teacher1" 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 "Navigation" block if not present Scenario: General section is visible in navigation when it is not empty diff --git a/course/tests/behat/navigate_course_list.feature b/course/tests/behat/navigate_course_list.feature index c027e62c98d..451360bd15a 100644 --- a/course/tests/behat/navigate_course_list.feature +++ b/course/tests/behat/navigate_course_list.feature @@ -35,6 +35,8 @@ Feature: Browse course list and return back from enrolment page Given I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: diff --git a/mod/glossary/tests/behat/entries_require_approval.feature b/mod/glossary/tests/behat/entries_require_approval.feature index 4b12dbdd0ab..80be24ab710 100644 --- a/mod/glossary/tests/behat/entries_require_approval.feature +++ b/mod/glossary/tests/behat/entries_require_approval.feature @@ -69,6 +69,8 @@ Feature: A teacher can choose whether glossary entries require approval And I log out And I log in as "teacher1" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node And I click on "Tags" "link" in the "Navigation" "block" diff --git a/mod/h5pactivity/tests/behat/inline_editing_content.feature b/mod/h5pactivity/tests/behat/inline_editing_content.feature index d83ee83304d..60f71a43fb7 100644 --- a/mod/h5pactivity/tests/behat/inline_editing_content.feature +++ b/mod/h5pactivity/tests/behat/inline_editing_content.feature @@ -30,6 +30,8 @@ Feature: Inline editing H5P content And I log in as "admin" # Add the navigation block. 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 "Navigation" block if not present # Create an H5P activity with a link to the content-bank file. And I add a "H5P" to section "1" @@ -90,6 +92,8 @@ Feature: Inline editing H5P content And I log in as "admin" # Add the navigation block. 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 "Navigation" block if not present # Create an H5P activity with a copy to the content-bank file. And I add a "H5P" to section "1" diff --git a/my/tests/behat/restrict_available_blocks.feature b/my/tests/behat/restrict_available_blocks.feature index bc699f2fc38..d4f161e1f49 100644 --- a/my/tests/behat/restrict_available_blocks.feature +++ b/my/tests/behat/restrict_available_blocks.feature @@ -20,7 +20,6 @@ Feature: Restrict which blocks can be added to Dashboard 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 "Courses" block And the add block selector should contain "Text" block And the add block selector should contain "Tags" block diff --git a/notes/tests/behat/participants_notes.feature b/notes/tests/behat/participants_notes.feature index 58f7c2a0f2d..7edb7bed9f3 100644 --- a/notes/tests/behat/participants_notes.feature +++ b/notes/tests/behat/participants_notes.feature @@ -24,6 +24,8 @@ Feature: Add notes to course participants Given I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: diff --git a/repository/contentbank/tests/behat/file_update.feature b/repository/contentbank/tests/behat/file_update.feature index c2c6c12674a..f1a6fa6607b 100644 --- a/repository/contentbank/tests/behat/file_update.feature +++ b/repository/contentbank/tests/behat/file_update.feature @@ -34,6 +34,8 @@ Feature: Updating a file in the content bank after using in a course And I switch to the main frame # Now edit the content in the content bank. When I am on "Course1" course homepage with editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" @@ -73,6 +75,8 @@ Feature: Updating a file in the content bank after using in a course And I switch to the main frame # Now edit the content in the content bank. When I am on "Course1" course homepage with editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I expand "Site pages" node And I click on "Content bank" "link" diff --git a/tag/tests/behat/collections.feature b/tag/tests/behat/collections.feature index c652b70857e..b47bd99b554 100644 --- a/tag/tests/behat/collections.feature +++ b/tag/tests/behat/collections.feature @@ -104,6 +104,8 @@ Feature: Managers can create and manage tag collections And I press "Create" And "Yes" "text" should not exist in the "//table[contains(@class,'tag-collections-table')]//tr[contains(.,'Hiddencoll')]" "xpath_element" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" diff --git a/tag/tests/behat/edit_tag.feature b/tag/tests/behat/edit_tag.feature index 888771129a4..ec68ee3da72 100644 --- a/tag/tests/behat/edit_tag.feature +++ b/tag/tests/behat/edit_tag.feature @@ -32,6 +32,8 @@ Feature: Users can edit tags to add description or rename And I log out When I log in as "editor1" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" @@ -57,6 +59,8 @@ Feature: Users can edit tags to add description or rename Scenario: Manager can change tag description, related tags and rename the tag from tag view page When I log in as "manager1" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" @@ -90,6 +94,8 @@ Feature: Users can edit tags to add description or rename Scenario: Renaming the tag from tag view page When I log in as "manager1" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Tags" "link" in the "Navigation" "block" diff --git a/tag/tests/behat/flag_tags.feature b/tag/tests/behat/flag_tags.feature index 57166f5cd4f..b71e6364892 100644 --- a/tag/tests/behat/flag_tags.feature +++ b/tag/tests/behat/flag_tags.feature @@ -25,6 +25,8 @@ Feature: Users can flag tags and manager can reset flags And I log out And I log in as "user2" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" @@ -35,6 +37,8 @@ Feature: Users can flag tags and manager can reset flags And I follow "Flag as inappropriate" And I should see "The person responsible will be notified" And I am on homepage + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" @@ -47,6 +51,8 @@ Feature: Users can flag tags and manager can reset flags And I log out And I log in as "user3" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 site "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" diff --git a/tag/tests/behat/tagindex.feature b/tag/tests/behat/tagindex.feature index 7b7ad3afefd..ffe4db35d2b 100644 --- a/tag/tests/behat/tagindex.feature +++ b/tag/tests/behat/tagindex.feature @@ -23,6 +23,8 @@ Feature: Browsing tagged items Scenario: Browse tag index with javascript disabled When I log in as "user1" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Tags" "link" in the "Navigation" "block" @@ -70,6 +72,8 @@ Feature: Browsing tagged items Scenario: Browse tag index with javascript enabled When I log in as "user1" And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| # TODO MDL-57120 "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" diff --git a/user/tests/behat/set_default_homepage.feature b/user/tests/behat/set_default_homepage.feature index 7fed5c08037..1af719b2af7 100644 --- a/user/tests/behat/set_default_homepage.feature +++ b/user/tests/behat/set_default_homepage.feature @@ -20,6 +20,8 @@ Feature: Set the site home page and dashboard as the default home page Given I log in as "admin" And I am on site homepage And I turn editing mode on + And the following config values are set as admin: + | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present And I configure the "Navigation" block And I set the following fields to these values: