{{# output.search_box }}
{{{ output.search_box }}}
diff --git a/templates/theme_boost/navbar.mustache.upstream b/templates/theme_boost/navbar.mustache.upstream
index 653627166d7..281288d7a5b 100644
--- a/templates/theme_boost/navbar.mustache.upstream
+++ b/templates/theme_boost/navbar.mustache.upstream
@@ -82,7 +82,7 @@
{{{ output.page_heading_menu }}}
-
+
{{# output.search_box }}
{{{ output.search_box }}}
diff --git a/tests/behat/behat_theme_boost_union.php b/tests/behat/behat_theme_boost_union.php
new file mode 100644
index 00000000000..5139ec649a4
--- /dev/null
+++ b/tests/behat/behat_theme_boost_union.php
@@ -0,0 +1,342 @@
+.
+
+/**
+ * Theme Boost Union - Standard behat step data providers.
+ *
+ * @package theme_boost_union
+ * @copyright 2024 onwards Catalyst IT EU {@link https://catalyst-eu.net}
+ * @author Mark Johnson
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class behat_theme_boost_union extends behat_base {
+ /**
+ * Convert page names to URLs for steps like 'When I am on the "[page name]" page'.
+ *
+ * Tabbed settings pages support an optional "> Tabname" suffix, otherwise they will load the default tab.
+ *
+ * Recognised page names are:
+ * | Settings | Settings overview |
+ * | Look | "Look" settings page |
+ * | Feel | "Feel" settings page |
+ * | Content | "Content" settings page |
+ * | Functionality | "Functionality" settings page |
+ * | Flavours | Flavours listing page |
+ * | Smart menus | Smart menus listing page |
+ *
+ * @param string $page name of the page, with the component name removed e.g. 'Admin notification'.
+ * @return moodle_url the corresponding URL.
+ * @throws Exception with a meaningful error message if the specified page cannot be found.
+ */
+ protected function resolve_page_url(string $page): moodle_url {
+ $parts = explode('>', strtolower($page));
+ $section = trim($parts[0]);
+ if (count($parts) < 2) {
+ return match ($section) {
+ 'settings' => new moodle_url('/theme/boost_union/settings_overview.php'),
+ 'look' => new moodle_url('/admin/settings.php?section=theme_boost_union_look'),
+ 'feel' => new moodle_url('/admin/settings.php?section=theme_boost_union_feel'),
+ 'content' => new moodle_url('/admin/settings.php?section=theme_boost_union_content'),
+ 'functionality' => new moodle_url('/admin/settings.php?section=theme_boost_union_functionality'),
+ 'flavours' => new moodle_url('/theme/boost_union/flavours/overview.php'),
+ 'smart menus' => new moodle_url('/theme/boost_union/smartmenus/menus.php'),
+ default => throw new Exception('Unrecognised theme_boost_union page "' . $page . '."')
+ };
+ }
+ $suffix = trim($parts[1]);
+ $tabs = [];
+ switch ($section) {
+ case 'look':
+ $tabs = [
+ 'general',
+ 'scss',
+ 'page',
+ 'sitebranding',
+ 'activitybranding',
+ 'loginpage',
+ 'dashboard',
+ 'blocks',
+ 'course',
+ 'emailbranding',
+ 'resources',
+ 'h5p',
+ 'mobile',
+ ];
+ $suffix = match ($suffix) {
+ 'general', 'general settings' => 'general',
+ 'my courses', 'dashboard / my courses' => 'dashboard',
+ default => str_replace([' ', '-'], ['', ''], $suffix)
+ };
+ break;
+
+ case 'feel':
+ $tabs = [
+ 'navigation',
+ 'blocks',
+ 'pagelayouts',
+ 'links',
+ 'misc',
+ ];
+ $suffix = match ($suffix) {
+ 'miscellaneous' => 'misc',
+ default => str_replace([' ', '-'], ['', ''], $suffix)
+ };
+ break;
+
+ case 'content':
+ $tabs = [
+ 'footer',
+ 'staticpages',
+ 'infobanner',
+ 'tiles',
+ 'slider',
+ ];
+ $suffix = match ($suffix) {
+ 'advertisement tiles' => 'tiles',
+ default => str_replace([' ', '-'], ['', ''], $suffix)
+ };
+ $section = match ($suffix) {
+ 'infobanner' => 'infobanners',
+ 'tiles', 'slider' => '',
+ default => $section,
+ };
+ break;
+
+ case 'functionality':
+ $tabs = [
+ 'courses',
+ 'administration',
+ ];
+ break;
+
+ default:
+ throw new Exception('Unrecognised theme_boost_union page "' . $page . '."');
+ }
+
+ if (!in_array($suffix, $tabs)) {
+ throw new Exception('Unrecognised theme_boost_union page "' . $page . '."');
+ }
+ return new moodle_url('/admin/settings.php?section=theme_boost_union_' . $section . '_' . $suffix);
+ }
+
+ /**
+ * Convert page names to URLs for steps like 'When I am on the "[identifier]" "[page type]" page'.
+ *
+ * Recognised page names are:
+ * | pagetype | name meaning | description |
+ * | Flavour > Preview | Flavour title | The flavour preview page (flavours/preview.php) |
+ * | Flavour > Edit | Flavour title | The flavour edit page (flavours/edit.php) |
+ * | Smart menu > Edit | Menu title | The smart menu edit page (smartmenus/edit.php) |
+ * | Smart menu > Items | Menu title | The smart menu items page (smartmenus/items.php) |
+ * | Smart menu item | Menu title > Item title | The smart menu item edit page (smartmenus/edit_items.php) |
+ * | Course completion | Course identifier | The course completion form |
+ *
+ * @param string $type identifies which type of page this is, e.g. 'Smart menu item'.
+ * @param string $identifier identifies the particular page, e.g. 'Menu 1 > Item 1'.
+ * @return moodle_url the corresponding URL.
+ * @throws Exception with a meaningful error message if the specified page cannot be found.
+ */
+ protected function resolve_page_instance_url(string $type, string $identifier): moodle_url {
+ $parts = explode('>', strtolower($type));
+ $pagetype = trim($parts[0]);
+
+ switch ($pagetype) {
+ case 'flavour':
+ $page = trim($parts[1]);
+ if (!in_array($page, ['preview', 'edit'])) {
+ throw new Exception('Unrecognised theme_boost_union page type "' . $type . '."');
+ }
+ return new moodle_url(
+ '/theme/boost_union/flavours/' . $page . '.php',
+ [
+ 'id' => $this->get_flavour_id_by_title($identifier),
+ 'sesskey' => $this->get_sesskey(),
+ ]
+ );
+
+ case 'smart menu':
+ $page = trim($parts[1]);
+ if (!in_array($page, ['edit', 'items'])) {
+ throw new Exception('Unrecognised theme_boost_union page type "' . $type . '."');
+ }
+ $idparam = $page == 'edit' ? 'id' : 'menu';
+ return new moodle_url(
+ '/theme/boost_union/smartmenus/' . $page . '.php',
+ [
+ $idparam => $this->get_smartmenu_id_by_title($identifier),
+ 'sesskey' => $this->get_sesskey(),
+ ]
+ );
+
+ case 'smart menu item':
+ $idparts = explode('>', $identifier);
+ $menutitle = trim($idparts[0]);
+ $itemtitle = trim($idparts[1]);
+ $menuid = $this->get_smartmenu_id_by_title($menutitle);
+ return new moodle_url(
+ '/theme/boost_union/smartmenus/edit_items.php',
+ [
+ 'id' => $this->get_smartmenu_item_id_by_title($menuid, $itemtitle),
+ 'sesskey' => $this->get_sesskey(),
+ ]
+ );
+
+ case 'course completion':
+ return new moodle_url(
+ '/course/completion.php',
+ [
+ 'id' => $this->get_course_id($identifier),
+ ]
+ );
+
+ default:
+ throw new Exception('Unrecognised theme_boost_union page type "' . $type . '."');
+ }
+ }
+
+ /**
+ * Return named selectors for use with steps like `the following "locator" "identifier" should exist`.
+ *
+ * Supported selectors:
+ * - "Smart menu" - The menu button for a smart menu. Locator = Smart menu title.
+ * - "Smart menu item" - The menu button for a smart menu item. Locator = Item title.
+ * - "Main menu smart menu" - The submenu for a smart menu within the main menu. Locator = Smart menu title.
+ * - "Main menu smart menu item" - A smart menu item within the main menu. Locator = Item title.
+ * - "Menu bar smart menu" - The submenu for a smart menu within top menu bar. Locator = Smart menu title.
+ * - "Menu bar smart menu item" - A smart menu item within top menu bar. Locator = Item title.
+ * - "User menu smart menu" - The submenu for a smart menu within top user menu. Locator = Smart menu title.
+ * - "User menu smart menu item" - A smart menu item within a user menu submenu. Locator = Item title.
+ * - "Bottom bar smart menu" - The submenu for a smart menu within bottom menu bar. Locator = Smart menu title.
+ * - "Bottom bar smart menu item" - A smart menu item within bottom menu bar. Locator = Item title.
+ *
+ * @return array|behat_component_named_selector[]
+ */
+ public static function get_exact_named_selectors(): array {
+ return [
+ new behat_component_named_selector(
+ 'Smart menu',
+ [".//a[@role = 'menuitem'][contains(text(), %locator%)]"],
+ ),
+ new behat_component_named_selector(
+ 'Smart menu item',
+ [".//a[contains(@class, 'boost-union-smartmenuitem')][contains(text(), %locator%)]"],
+ ),
+ new behat_component_named_selector(
+ 'Main menu smart menu',
+ [
+ ".//div[contains(@class, 'primary-navigation')]//li[contains(@class, 'boost-union-smartmenu')]" .
+ "/a[contains(text(), %locator%)]/../div[@role = 'menu']",
+ ],
+ ),
+ new behat_component_named_selector(
+ 'Main menu smart menu item',
+ [
+ ".//div[contains(@class, 'primary-navigation')]" .
+ "//a[contains(@class, 'boost-union-smartmenuitem')][contains(text(), %locator%)]",
+ ],
+ ),
+ new behat_component_named_selector(
+ 'Menu bar smart menu',
+ [
+ ".//nav[contains(@class, 'boost-union-menubar')]//li[contains(@class, 'boost-union-smartmenu')]" .
+ "/a[contains(text(), %locator%)]/../div[@role = 'menu']",
+ ],
+ ),
+ new behat_component_named_selector(
+ 'Menu bar smart menu item',
+ [
+ ".//nav[contains(@class, 'boost-union-menubar')]" .
+ "//a[contains(@class, 'boost-union-smartmenuitem')][contains(text(), %locator%)]",
+ ],
+ ),
+ new behat_component_named_selector(
+ 'User menu smart menu',
+ [
+ ".//div[@id = 'usermenu-carousel']//div[contains(@class, 'carousel-item')][@aria-label = %locator%]",
+ ],
+ ),
+ new behat_component_named_selector(
+ 'User menu smart menu item',
+ [
+ ".//div[@id = 'usermenu-carousel']//div[contains(@class, 'carousel-item')]" .
+ "//a[contains(@class, 'boost-union-smartmenuitem')][contains(text(), %locator%)]",
+ ],
+ ),
+ new behat_component_named_selector(
+ 'Bottom bar smart menu',
+ [
+ ".//nav[contains(@class, 'boost-union-bottom-menu')]//li[contains(@class, 'boost-union-smartmenu')]" .
+ "/a[contains(text(), %locator%)]/../div[@role = 'menu']"],
+ ),
+ new behat_component_named_selector(
+ 'Bottom bar smart menu item',
+ [
+ ".//nav[contains(@class, 'boost-union-bottom-menu')]" .
+ "//a[contains(@class, 'boost-union-smartmenuitem')][contains(text(), %locator%)]",
+ ],
+ ),
+ ];
+ }
+
+ /**
+ * Given the title of a Flavour, return the ID.
+ *
+ * @param string $title
+ * @return int
+ * @throws dml_exception
+ */
+ protected function get_flavour_id_by_title(string $title): int {
+ global $DB;
+ $id = $DB->get_field('theme_boost_union_flavours', 'id', ['title' => $title]);
+ if (!$id) {
+ throw new Exception('Cannot find Boost Union flavour with title "' . $title . '"');
+ }
+ return $id;
+ }
+
+ /**
+ * Given the title of a Smart menu, return the ID.
+ *
+ * @param string $title
+ * @return int
+ * @throws dml_exception
+ */
+ protected function get_smartmenu_id_by_title(string $title): int {
+ global $DB;
+ $id = $DB->get_field('theme_boost_union_menus', 'id', ['title' => $title]);
+ if (!$id) {
+ throw new Exception('Cannot find Boost Union smart menu with title "' . $title . '"');
+ }
+ return $id;
+ }
+
+ /**
+ * Given the menu ID and title of a Smart menu item, return the item ID.
+ *
+ * @param int $menuid
+ * @param string $title
+ * @return int
+ * @throws dml_exception
+ */
+ protected function get_smartmenu_item_id_by_title(int $menuid, string $title): int {
+ global $DB;
+ $id = $DB->get_field('theme_boost_union_menuitems', 'id', ['menu' => $menuid, 'title' => $title]);
+ if (!$id) {
+ throw new Exception('Cannot find Boost Union smart menu item with title "' . $title . '"');
+ }
+ return $id;
+ }
+}
diff --git a/tests/behat/theme_boost_union_contentsettings_footer.feature b/tests/behat/theme_boost_union_contentsettings_footer.feature
index 0fd57bef7c9..521f6649e31 100644
--- a/tests/behat/theme_boost_union_contentsettings_footer.feature
+++ b/tests/behat/theme_boost_union_contentsettings_footer.feature
@@ -1,4 +1,4 @@
-@theme @theme_boost_union @theme_boost_union_contentsettings @theme_boost_union_contentsettings_footer
+@theme @theme_boost_union @theme_boost_union_contentsettings @theme_boost_union_contentsettings_footer @theme_boost_union_footer @theme_boost_union_footnote
Feature: Configuring the theme_boost_union plugin for the "Footer" tab on the "Content" page
In order to use the features
As admin
diff --git a/tests/behat/theme_boost_union_contentsettings_staticpages.feature b/tests/behat/theme_boost_union_contentsettings_staticpages.feature
index 642d0c29482..a19407798fc 100644
--- a/tests/behat/theme_boost_union_contentsettings_staticpages.feature
+++ b/tests/behat/theme_boost_union_contentsettings_staticpages.feature
@@ -1,4 +1,4 @@
-@theme @theme_boost_union @theme_boost_union_contentsettings @theme_boost_union_contentsettings_staticpages
+@theme @theme_boost_union @theme_boost_union_contentsettings @theme_boost_union_contentsettings_staticpages @theme_boost_union_footer @theme_boost_union_footnote
Feature: Configuring the theme_boost_union plugin for the "Static pages" tab on the "Content" page
In order to use the features
As admin
diff --git a/tests/behat/theme_boost_union_feelsettings_blocks.feature b/tests/behat/theme_boost_union_feelsettings_blocks.feature
index df420de0534..7cf3b6ea9bb 100644
--- a/tests/behat/theme_boost_union_feelsettings_blocks.feature
+++ b/tests/behat/theme_boost_union_feelsettings_blocks.feature
@@ -20,10 +20,8 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
- @javascript
Scenario Outline: Setting: Enable additional block regions (on a course page and the frontpage where all regions are offered)
- When I log in as "admin"
- And I am on site homepage
+ When I am on the "Acceptance test site" "Course" page logged in as "admin"
And I turn editing mode on
Then "#theme-block-region-" "css_element" should not exist
And the following config values are set as admin:
@@ -31,8 +29,7 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| blockregionsforfrontpage | | theme_boost_union |
And I reload the page
Then "#theme-block-region-" "css_element" exist
- And I am on "Course 1" course homepage
- And I turn editing mode on
+ And I am on "Course 1" course homepage with editing mode on
Then "#theme-block-region-" "css_element" should not exist
And the following config values are set as admin:
| config | value | plugin |
@@ -57,10 +54,8 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| outside-top | outside-bottom | should not |
| outside-top | footer-left,footer-right | should not |
- @javascript
Scenario Outline: Setting: Enable additional block regions (on the Dashboard page where all but the content-* regions are offered)
- When I log in as "admin"
- And I follow "Dashboard"
+ When I am on the "Homepage" page logged in as "admin"
And I turn editing mode on
Then "#theme-block-region-" "css_element" should not exist
And the following config values are set as admin:
@@ -86,7 +81,6 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| outside-top | outside-bottom | should not |
| outside-top | footer-left,footer-right | should not |
- @javascript
Scenario Outline: Setting: Enable additional block regions (on the admin overview page where not all regions are offered)
When I log in as "admin"
And I follow "Site administration"
@@ -115,30 +109,18 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| outside-top | outside-bottom | should not |
| outside-top | footer-left,footer-right | should not |
- @javascript
Scenario Outline: Setting: Use additional block regions (on a course page and the frontpage where all regions are offered)
Given the following config values are set as admin:
| config | value | plugin |
| blockregionsforfrontpage | | theme_boost_union |
| blockregionsforcourse | | theme_boost_union |
- When I log in as "admin"
- And I am on site homepage
- And I turn editing mode on
- And I should see "Add a block" in the "#theme-block-region-" "css_element"
- And I click on "Add a block" "link" in the "#theme-block-region-" "css_element"
- And I should see "Online users" in the ".modal-body" "css_element"
- And I click on "Online users" "link" in the ".modal-body" "css_element"
- And I am on site homepage
- And I turn editing mode off
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | Course | Acceptance test site | site-index | |
+ | calendar_month | Course | C1 | course-view-* | |
+ When I am on the "Acceptance test site" "Course" page logged in as "admin"
Then I should see "Online users" in the "#theme-block-region-" "css_element"
- And I am on "Course 1" course homepage
- And I turn editing mode on
- And I should see "Add a block" in the "#theme-block-region-" "css_element"
- And I click on "Add a block" "link" in the "#theme-block-region-" "css_element"
- And I should see "Calendar" in the ".modal-body" "css_element"
- And I click on "Calendar" "link" in the ".modal-body" "css_element"
- And I am on "Course 1" course homepage
- And I turn editing mode off
+ When I am on "Course 1" course homepage
Then I should see "Calendar" in the "#theme-block-region-" "css_element"
Examples:
@@ -154,20 +136,14 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| content-lower | content-lower |
| header | header |
- @javascript
Scenario Outline: Setting: Use additional block regions (on the Dashboard page where all but the content-* regions are offered)
Given the following config values are set as admin:
| config | value | plugin |
| blockregionsformydashboard | | theme_boost_union |
- When I log in as "admin"
- And I follow "Dashboard"
- And I turn editing mode on
- And I should see "Add a block" in the "#theme-block-region-" "css_element"
- And I click on "Add a block" "link" in the "#theme-block-region-" "css_element"
- And I should see "Online users" in the ".modal-body" "css_element"
- And I click on "Online users" "link" in the ".modal-body" "css_element"
- And I follow "Dashboard"
- And I turn editing mode off
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | System | 1 | my-index | |
+ When I am on the "Homepage" page logged in as "admin"
Then I should see "Online users" in the "#theme-block-region-" "css_element"
Examples:
@@ -181,20 +157,15 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| footer-center | footer-center |
| header | header |
- @javascript
Scenario Outline: Setting: Use additional block regions (on the admin overview page where not all regions are offered)
Given the following config values are set as admin:
| config | value | plugin |
| blockregionsforadmin | | theme_boost_union |
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | System | 1 | admin-search | |
When I log in as "admin"
And I follow "Site administration"
- And I turn editing mode on
- And I should see "Add a block" in the "#theme-block-region-" "css_element"
- And I click on "Add a block" "link" in the "#theme-block-region-" "css_element"
- And I should see "Online users" in the ".modal-body" "css_element"
- And I click on "Online users" "link" in the ".modal-body" "css_element"
- And I follow "Site administration"
- And I turn editing mode off
Then I should see "Online users" in the "#theme-block-region-" "css_element"
Examples:
@@ -207,8 +178,7 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
@javascript
Scenario Outline: Setting: Enable and use the off-canvas block regions (Compared to the other regions, these regions are slightly different and thus they are not covered in the Scenario outlines above).
- When I log in as "admin"
- And I am on site homepage
+ When I am on the "Acceptance test site" "Course" page logged in as "admin"
Then "#theme_boost_union-offcanvas-btn" "css_element" should not exist
And "#theme_boost_union-drawers-offcanvas" "css_element" should not exist
And "#theme-block-region-offcanvas-editing" "css_element" should not be visible
@@ -239,9 +209,9 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
And "#theme-block-region-" "css_element" should exist
And "#theme-block-region-" "css_element" should be visible
And I should see "Add a block" in the "#theme-block-region-" "css_element"
- And I click on "Add a block" "link" in the "#theme-block-region-" "css_element"
- And I should see "Online users" in the ".modal-body" "css_element"
- And I click on "Online users" "link" in the ".modal-body" "css_element"
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | Course | Acceptance test site | site-index | |
And I am on site homepage
And I turn editing mode off
Then "#theme_boost_union-offcanvas-btn" "css_element" should exist
@@ -263,20 +233,14 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| offcanvas-center | offcanvas-center |
| offcanvas-left | outside-top,outside-left,outside-right,outside-bottom,footer-left,footer-right,footer-center,offcanvas-left,offcanvas-center,offcanvas-right |
- @javascript
Scenario Outline: Setting: Set capabilities to control the editability of additional block regions (for all regions except offcanvas regions)
Given the following config values are set as admin:
| config | value | plugin |
| blockregionsforcourse | | theme_boost_union |
- When I log in as "admin"
- And I am on "Course 1" course homepage
- And I turn editing mode on
- And I click on "Add a block" "link" in the "#theme-block-region-" "css_element"
- And I should see "Online users" in the ".modal-body" "css_element"
- And I click on "Online users" "link" in the ".modal-body" "css_element"
- And I log out
- And I log in as "teacher1"
- And I am on "Course 1" course homepage
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | Course | C1 | course-view-* | |
+ When I am on the "Course 1" "Course" page logged in as "teacher1"
And I turn editing mode on
Then "#theme-block-region-" "css_element" should exist
And I should see "Add a block" in the "#theme-block-region-" "css_element"
@@ -305,16 +269,10 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
Given the following config values are set as admin:
| config | value | plugin |
| blockregionsforcourse | | theme_boost_union |
- When I log in as "admin"
- And I am on "Course 1" course homepage
- And I turn editing mode on
- And I click on "#theme_boost_union-offcanvas-btn" "css_element"
- And I click on "Add a block" "link" in the "#theme-block-region-" "css_element"
- And I should see "Online users" in the ".modal-body" "css_element"
- And I click on "Online users" "link" in the ".modal-body" "css_element"
- And I log out
- And I log in as "teacher1"
- And I am on "Course 1" course homepage
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | Course | C1 | course-view-* | |
+ When I am on the "Course 1" "Course" page logged in as "teacher1"
And I turn editing mode on
And I click on "#theme_boost_union-offcanvas-btn" "css_element"
Then "#theme-block-region-" "css_element" should exist
@@ -333,20 +291,14 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| offcanvas-center | editregionoffcanvascenter |
| offcanvas-right | editregionoffcanvasright |
- @javascript
Scenario Outline: Setting: Set capabilities to control the visibility of additional block regions (for all regions except offcanvas regions)
Given the following config values are set as admin:
| config | value | plugin |
| blockregionsforcourse | | theme_boost_union |
- When I log in as "admin"
- And I am on "Course 1" course homepage
- And I turn editing mode on
- And I click on "Add a block" "link" in the "#theme-block-region-" "css_element"
- And I should see "Online users" in the ".modal-body" "css_element"
- And I click on "Online users" "link" in the ".modal-body" "css_element"
- And I log out
- And I log in as "teacher1"
- And I am on "Course 1" course homepage
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | Course | C1 | course-view-* | |
+ When I am on the "Course 1" "Course" page logged in as "teacher1"
Then "#theme-block-region-" "css_element" should exist
And I should see "Online users" in the "#theme-block-region-" "css_element"
And the following "permission overrides" exist:
@@ -374,16 +326,10 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
Given the following config values are set as admin:
| config | value | plugin |
| blockregionsforcourse | | theme_boost_union |
- When I log in as "admin"
- And I am on "Course 1" course homepage
- And I turn editing mode on
- And I click on "#theme_boost_union-offcanvas-btn" "css_element"
- And I click on "Add a block" "link" in the "#theme-block-region-" "css_element"
- And I should see "Online users" in the ".modal-body" "css_element"
- And I click on "Online users" "link" in the ".modal-body" "css_element"
- And I log out
- And I log in as "teacher1"
- And I am on "Course 1" course homepage
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | Course | C1 | course-view-* | |
+ When I am on the "Course 1" "Course" page logged in as "teacher1"
And I click on "#theme_boost_union-offcanvas-btn" "css_element"
Then "#theme-block-region-" "css_element" should exist
And I should see "Online users" in the "#theme-block-region-" "css_element"
@@ -408,8 +354,7 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| blockregionsforcourse | | theme_boost_union |
| | | theme_boost_union |
And the theme cache is purged and the theme is reloaded
- When I log in as "admin"
- And I am on "Course 1" course homepage
+ When I am on the "Course 1" "Course" page logged in as "admin"
And I turn editing mode on
And I should see "Add a block" in the "#theme-block-region-" "css_element"
Then DOM element "#theme-block-region-" should have computed style "width" ""
@@ -426,8 +371,7 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| config | value | plugin |
| blockregionsforcourse | | theme_boost_union |
| | | theme_boost_union |
- When I log in as "admin"
- And I am on "Course 1" course homepage
+ When I am on the "Course 1" "Course" page logged in as "admin"
And I turn editing mode on
And I should see "Add a block" in the "#theme-block-region-" "css_element"
Then the "class" attribute of "#theme-block-region-" "css_element" should contain "theme-block-region-outside-"
@@ -446,8 +390,7 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| config | value | plugin |
| blockregionsforcourse | footer-left | theme_boost_union |
| | | theme_boost_union |
- When I log in as "admin"
- And I am on "Course 1" course homepage
+ When I am on the "Course 1" "Course" page logged in as "admin"
And I turn editing mode on
And I should see "Add a block" in the "#theme-block-region-footer-left" "css_element"
Then the "class" attribute of "#theme-block-region-footer" "css_element" should contain "theme-block-region-footer-"
@@ -462,8 +405,7 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
Given the following config values are set as admin:
| config | value | plugin |
| outsideregionsplacement | | theme_boost_union |
- When I log in as "admin"
- And I am on site homepage
+ When I am on the "Acceptance test site" "Course" page logged in as "admin"
And I turn editing mode on
Then the "class" attribute of ".main-inner-wrapper" "css_element" should contain ""
And the "class" attribute of ".main-inner-wrapper" "css_element" should not contain ""
@@ -473,13 +415,11 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
| nextmaincontent | main-inner-outside-nextmaincontent | main-inner-outside-nearwindowedges |
| nearwindowedges | main-inner-outside-nearwindowedges | main-inner-outside-nextmaincontent |
- @javascript
Scenario: Verify orders of all block regions
Given the following config values are set as admin:
| config | value | plugin |
| blockregionsforfrontpage | outside-top,outside-left,outside-right,outside-bottom,footer-left,footer-right,footer-center,offcanvas-left,offcanvas-right,offcanvas-center,content-upper,content-lower,header | theme_boost_union |
- When I log in as "admin"
- And I am on site homepage
+ When I am on the "Acceptance test site" "Course" page logged in as "admin"
And I turn editing mode on
Then "#theme-block-region-offcanvas-editing" "css_element" should appear before "#theme-block-region-outside-top" "css_element"
And "#theme-block-region-outside-top" "css_element" should appear before "#theme-block-region-header" "css_element"
@@ -505,18 +445,10 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
Given the following config values are set as admin:
| config | value | plugin |
| showsitehomerighthandblockdraweronfirstlogin | | theme_boost_union |
- And I log in as "admin"
- And I am on site homepage
- And I turn editing mode on
- And I add the "Text" block
- And I configure the "(new text block)" block
- And I set the following fields to these values:
- | Text block title | Text on all pages |
- | Content | This is visible on all pages |
- And I press "Save changes"
- And I log out
- When I log in as "student1"
- And I am on site homepage
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | Course | Acceptance test site | site-index | side-pre |
+ When I am on the "Acceptance test site" "Course" page logged in as "student1"
Then the "class" attribute of ".drawer-right" "css_element" "show"
Examples:
@@ -528,16 +460,9 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
Given the following config values are set as admin:
| config | value | plugin |
| showsitehomerighthandblockdraweronvisit | | theme_boost_union |
- And I log in as "admin"
- And I am on site homepage
- And I turn editing mode on
- And I add the "Text" block
- And I configure the "(new text block)" block
- And I set the following fields to these values:
- | Text block title | Text on all pages |
- | Content | This is visible on all pages |
- And I press "Save changes"
- And I log out
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | Course | Acceptance test site | site-index | side-pre |
When I am on site homepage
Then the "class" attribute of ".drawer-right" "css_element" "show"
@@ -550,16 +475,9 @@ Feature: Configuring the theme_boost_union plugin for the "Blocks" tab on the "F
Given the following config values are set as admin:
| config | value | plugin |
| showsitehomerighthandblockdraweronguestlogin | | theme_boost_union |
- And I log in as "admin"
- And I am on site homepage
- And I turn editing mode on
- And I add the "Text" block
- And I configure the "(new text block)" block
- And I set the following fields to these values:
- | Text block title | Text on all pages |
- | Content | This is visible on all pages |
- And I press "Save changes"
- And I log out
+ And the following "blocks" exist:
+ | blockname | contextlevel | reference | pagetypepattern | defaultregion |
+ | online_users | Course | Acceptance test site | site-index | side-pre |
When I log in as "guest"
And I am on site homepage
Then the "class" attribute of ".drawer-right" "css_element" "show"
diff --git a/tests/behat/theme_boost_union_feelsettings_links.feature b/tests/behat/theme_boost_union_feelsettings_links.feature
index b6f7e66d56e..07441ebe05f 100644
--- a/tests/behat/theme_boost_union_feelsettings_links.feature
+++ b/tests/behat/theme_boost_union_feelsettings_links.feature
@@ -1,4 +1,4 @@
-@theme @theme_boost_union @theme_boost_union_feelsettings @theme_boost_union_feelsettings_links
+@theme @theme_boost_union @theme_boost_union_feelsettings @theme_boost_union_feelsettings_links @theme_boost_union_footnote
Feature: Configuring the theme_boost_union plugin for the "Links" tab on the "Feel" page
In order to use the features
As admin
diff --git a/tests/behat/theme_boost_union_feelsettings_navigation.feature b/tests/behat/theme_boost_union_feelsettings_navigation.feature
index ee27a3b58d4..2358ee2fd42 100644
--- a/tests/behat/theme_boost_union_feelsettings_navigation.feature
+++ b/tests/behat/theme_boost_union_feelsettings_navigation.feature
@@ -1,4 +1,4 @@
-@theme @theme_boost_union @theme_boost_union_feelsettings @theme_boost_union_feelsettings_navigation
+@theme @theme_boost_union @theme_boost_union_feelsettings @theme_boost_union_feelsettings_navigation @theme_boost_union_footer
Feature: Configuring the theme_boost_union plugin for the "Navigation" tab on the "Feel" page
In order to use the features
As admin
diff --git a/tests/behat/theme_boost_union_feelsettings_pagelayouts.feature b/tests/behat/theme_boost_union_feelsettings_pagelayouts.feature
index 919e674fc6d..de9fabf340d 100644
--- a/tests/behat/theme_boost_union_feelsettings_pagelayouts.feature
+++ b/tests/behat/theme_boost_union_feelsettings_pagelayouts.feature
@@ -1,4 +1,4 @@
-@theme @theme_boost_union @theme_boost_union_feelsettings @theme_boost_union_feelsettings_pagelayouts
+@theme @theme_boost_union @theme_boost_union_feelsettings @theme_boost_union_feelsettings_pagelayouts @theme_boost_union_footer
Feature: Configuring the theme_boost_union plugin for the "Page layouts" tab on the "Feel" page
In order to use the features
As admin
diff --git a/tests/behat/theme_boost_union_goodiesfordesigners.feature b/tests/behat/theme_boost_union_goodiesfordesigners.feature
index e616d170669..0fa731fdd7c 100644
--- a/tests/behat/theme_boost_union_goodiesfordesigners.feature
+++ b/tests/behat/theme_boost_union_goodiesfordesigners.feature
@@ -1,4 +1,4 @@
-@theme @theme_boost_union @theme_boost_union_goodiesfordesigners
+@theme @theme_boost_union @theme_boost_union_goodiesfordesigners @theme_boost_union_footnote
Feature: Using the goodies for designers in the theme_boost_union plugin
In order to use the features
As designer
diff --git a/tests/behat/theme_boost_union_smartmenusettings_menuitems_dynamiccourses.feature b/tests/behat/theme_boost_union_smartmenusettings_menuitems_dynamiccourses.feature
index be3253953b7..923ffc5f3a5 100644
--- a/tests/behat/theme_boost_union_smartmenusettings_menuitems_dynamiccourses.feature
+++ b/tests/behat/theme_boost_union_smartmenusettings_menuitems_dynamiccourses.feature
@@ -37,23 +37,19 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, usi
| student1 | C2 | student |
| student1 | C3 | student |
| student1 | C4 | student |
- And I log in as "admin"
- And I create smart menu with the following fields to these values:
- | Title | List menu |
- | Menu location(s) | Main, Menu, User, Bottom |
- | CSS class | dynamiccoursetest |
- And I set "List menu" smart menu items with the following fields to these values:
- | Title | Dynamic courses |
- | Menu item type | Dynamic courses |
+ And the following "theme_boost_union > smart menu" exists:
+ | title | List menu |
+ | location | Main navigation, Menu bar, User menu, Bottom bar |
+ | cssclass | dynamiccoursetest |
@javascript
Scenario: Smartmenus: Menu items: Dynamic courses - Check the smart menu item settings fields which are shown conditionally for dynamic courses
- When I log in as "admin"
- And I navigate to smart menus
- And I should see "List menu" in the "smartmenus" "table"
- And I click on ".action-list-items" "css_element" in the "List menu" "table_row"
- Then I should see "Dynamic courses"
- And I click on ".action-edit" "css_element" in the "Dynamic courses" "table_row"
+ Given the following "theme_boost_union > smart menu item" exists:
+ | menu | List menu |
+ | title | Dynamic courses |
+ | itemtype | Dynamic courses |
+ And I am logged in as "admin"
+ When I am on the "List menu > Dynamic courses" "theme_boost_union > smart menu item" page
And I should see "Dynamic courses: Course category"
And I should see "Dynamic courses: Enrolment role"
And I should see "Dynamic courses: Completion status"
@@ -61,34 +57,44 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, usi
@javascript
Scenario: Smartmenus: Menu items: Dynamic courses - Compose the dynamic course list based on all existing courses (without any condition)
- When I log in as "student1"
- Then I should see smart menu "List menu" item "Course 01" in location "Main, Menu, User, Bottom"
- And I should see smart menu "List menu" item "Course 02" in location "Main, Menu, User, Bottom"
- And I should see smart menu "List menu" item "Course 03" in location "Main, Menu, User, Bottom"
- And I should see smart menu "List menu" item "Course 04" in location "Main, Menu, User, Bottom"
- And I should see smart menu "List menu" item "Course 05" in location "Main, Menu, User, Bottom"
- And I should see smart menu "List menu" item "Course 06" in location "Main, Menu, User, Bottom"
+ Given the following "theme_boost_union > smart menu item" exists:
+ | menu | List menu |
+ | title | Dynamic courses |
+ | itemtype | Dynamic courses |
+ When I am logged in as "student1"
+ Then "Course 01" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Menu bar smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > User menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Bottom bar smart menu"
+ And "Course 02" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 03" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 04" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 05" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 06" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And I should see smart menu "List menu" item "Course 01" in location "Main, Menu, User, Bottom"
@javascript
Scenario Outline: Smartmenus: Menu items: Dynamic courses - Compose the dynamic course list based on a category condition
- When I log in as "admin"
- And I navigate to smart menu "List menu" items
- And I click on ".action-edit" "css_element" in the "Dynamic courses" "table_row"
- And I set the field "Dynamic courses: Course category" to ""
- And I press "Save changes"
- And I log out
- And I log in as ""
- Then I see smart menu "List menu" item "Course 01" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 02" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 03" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 04" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 05" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 06" in location "Main, Menu, User, Bottom"
+ Given the following "theme_boost_union > smart menu item" exists:
+ | menu | List menu |
+ | title | Dynamic courses |
+ | itemtype | Dynamic courses |
+ | categories | |
+ When I am logged in as "student1"
+ Then "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Menu bar smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > User menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Bottom bar smart menu"
+ And "Course 02" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 03" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 04" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 05" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 06" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
Examples:
- | category | user | course1 | course2 | course3 | course4 | course5 | course6 |
- | Category 01 | student1 | should | should | should | should not | should not | should not |
- | Category 02 | student1 | should not | should not | should not | should | should | should not |
+ | category | course1 | course2 | course3 | course4 | course5 | course6 |
+ | CAT1 | should | should | should | should not | should not | should not |
+ | CAT2 | should not | should not | should not | should | should | should not |
@javascript
Scenario Outline: Smartmenus: Menu items: Dynamic courses - Compose the dynamic course list based on a category condition (with or without subcategories)
@@ -107,18 +113,20 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, usi
| student1 | C1a | student |
| student1 | C1b | student |
| student1 | C1aa | student |
- When I log in as "admin"
- And I navigate to smart menu "List menu" items
- And I click on ".action-edit" "css_element" in the "Dynamic courses" "table_row"
- And I set the field "Dynamic courses: Course category" to "Category 01"
- And I set the field "Include subcategories" to ""
- And I press "Save changes"
- And I log out
- And I log in as "student1"
- Then I should see smart menu "List menu" item "Course 01" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 01a" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 01b" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 01aa" in location "Main, Menu, User, Bottom"
+ And the following "theme_boost_union > smart menu item" exists:
+ | menu | List menu |
+ | title | Dynamic courses |
+ | itemtype | Dynamic courses |
+ | categories | CAT1 |
+ | category_subcats | |
+ When I log in as "student1"
+ Then "Course 01" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Menu bar smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > User menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" should exist in the "List menu" "theme_boost_union > Bottom bar smart menu"
+ And "Course 01a" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 01b" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 01aa" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
Examples:
| subcat | shouldornot |
@@ -127,56 +135,50 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, usi
@javascript
Scenario Outline: Smartmenus: Menu items: Dynamic courses - Compose the dynamic course list based on a enrolment role condition
- When I log in as "admin"
# Empty menus are hidden from view. To prevent that the whole menu is missing and the test fails,
# a sample item is created.
- And I set "List menu" smart menu items with the following fields to these values:
- | Title | Info |
- | Menu item type | Heading |
- And I navigate to smart menu "List menu" items
- And I click on ".action-edit" "css_element" in the "Dynamic courses" "table_row"
- And I set the field "Dynamic courses: Enrolment role" to ""
- And I press "Save changes"
- And I log out
- And I log in as ""
- Then I see smart menu "List menu" item "Course 01" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 02" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 03" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 04" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 05" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 06" in location "Main, Menu, User, Bottom"
+ Given the following "theme_boost_union > smart menu items" exist:
+ | menu | title | itemtype | enrolmentrole |
+ | List menu | Info | Heading | |
+ | List menu | Dynamic courses | Dynamic courses | |
+ When I log in as ""
+ Then "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Menu bar smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > User menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Bottom bar smart menu"
+ And "Course 02" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 03" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 04" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 05" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 06" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
Examples:
- | role | user | course1 | course2 | course3 | course4 | course5 | course6 |
- | Non-editing teacher, Teacher | student1 | should not | should not | should not | should not | should not | should not |
- | Non-editing teacher, Teacher | teacher | should | should not | should not | should not | should | should |
- | Student | student1 | should | should | should | should | should not | should not |
- | Student | teacher | should not | should not | should not | should not | should not | should not |
+ | role | user | course1 | course2 | course3 | course4 | course5 | course6 |
+ | teacher, editingteacher | student1 | should not | should not | should not | should not | should not | should not |
+ | teacher, editingteacher | teacher | should | should not | should not | should not | should | should |
+ | student | student1 | should | should | should | should | should not | should not |
+ | student | teacher | should not | should not | should not | should not | should not | should not |
@javascript
Scenario Outline: Smartmenus: Menu items: Dynamic courses - Compose the dynamic course list based on a completion status condition
- When I log in as "admin"
- And I navigate to smart menu "List menu" items
- And I click on ".action-edit" "css_element" in the "Dynamic courses" "table_row"
- And I set the field "Dynamic courses: Completion status" to ""
- And I press "Save changes"
- And I am on "Course 01" course homepage with editing mode on
- And I navigate to "Course completion" in current page administration
- And I click on "Condition: Activity completion" "link"
+ Given the following "theme_boost_union > smart menu item" exists:
+ | menu | List menu |
+ | title | Dynamic courses |
+ | itemtype | Dynamic courses |
+ | completionstatus | |
+ And I am on the "Course 01" "theme_boost_union > Course completion" page logged in as "admin"
+ And I expand all fieldsets
And I set the following fields to these values:
| Assignment - Test assignment name1 | 1 |
| Assignment - Test assignment name2 | 1 |
And I press "Save changes"
- And I am on "Course 02" course homepage with editing mode on
- And I navigate to "Course completion" in current page administration
- And I click on "Condition: Activity completion" "link"
+ And I am on the "Course 02" "theme_boost_union > Course completion" page
+ And I expand all fieldsets
And I set the following fields to these values:
| Assignment - Test assignment name3 | 1 |
| Assignment - Test assignment name4 | 1 |
And I press "Save changes"
- And I log out
- And I log in as ""
- And I am on "Course 01" course homepage
+ And I am on the "Course 01" "course" page logged in as "student1"
And the manual completion button of "Test assignment name1" is displayed as "Mark as done"
And I toggle the manual completion state of "Test assignment name1"
And the manual completion button of "Test assignment name2" is displayed as "Mark as done"
@@ -185,87 +187,78 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, usi
And the manual completion button of "Test assignment name3" is displayed as "Mark as done"
And I toggle the manual completion state of "Test assignment name3"
And I follow "Dashboard"
- Then I see smart menu "List menu" item "Course 01" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 02" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 03" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 04" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 05" in location "Main, Menu, User, Bottom"
+ Then "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Menu bar smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > User menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Bottom bar smart menu"
+ And "Course 02" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 03" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 04" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 05" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
Examples:
- | completionstatus | user | course1 | course2 | course3 | course4 | course5 |
- | Enrolled, In progress, Completed | student1 | should | should | should | should | should not |
- | In progress, Completed | student1 | should | should | should not | should not | should not |
- | Enrolled | student1 | should not | should not | should | should | should not |
- | Completed | student1 | should | should not | should not | should not | should not |
- | In progress | student1 | should not | should | should not | should not | should not |
+ | completionstatus | course1 | course2 | course3 | course4 | course5 |
+ | Enrolled, In progress, Completed | should | should | should | should | should not |
+ | In progress, Completed | should | should | should not | should not | should not |
+ | Enrolled | should not | should not | should | should | should not |
+ | Completed | should | should not | should not | should not | should not |
+ | In progress | should not | should | should not | should not | should not |
@javascript
Scenario Outline: Smartmenus: Menu items: Dynamic courses - Compose the dynamic course list based on a date range condition
- When I log in as "admin"
- And I navigate to smart menu "List menu" items
- And I click on ".action-edit" "css_element" in the "Dynamic courses" "table_row"
- And I set the field "Dynamic courses: Date range" to ""
- And I press "Save changes"
- And I log out
- And I log in as ""
- Then I see smart menu "List menu" item "Course 01" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 02" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 03" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 04" in location "Main, Menu, User, Bottom"
+ Given the following "theme_boost_union > smart menu item" exists:
+ | menu | List menu |
+ | title | Dynamic courses |
+ | itemtype | Dynamic courses |
+ | daterange | |
+ When I log in as "student1"
+ Then "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Menu bar smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > User menu smart menu"
+ And "Course 01" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Bottom bar smart menu"
+ And "Course 02" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 03" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 04" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 05" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
Examples:
- | daterange | user | course1 | course2 | course3 | course4 | course5 |
- | Past, Present, Future | student1 | should | should | should | should | should |
- | Future | student1 | should not | should not | should | should not | should not |
- | Present | student1 | should | should not | should not | should | should |
- | Past | student1 | should not | should | should not | should not | should not |
+ | daterange | course1 | course2 | course3 | course4 | course5 |
+ | Past, Present, Future | should | should | should | should | should |
+ | Future | should not | should not | should | should not | should not |
+ | Present | should | should not | should not | should | should |
+ | Past | should not | should | should not | should not | should not |
@javascript
Scenario Outline: Smartmenus: Menu items: Dynamic courses - Compose the dynamic course list based on a course field condition
Given the following "custom field categories" exist:
| name | component | area | itemid |
| Others | core_course | course | 0 |
- And I log in as "admin"
- And I navigate to "Courses > Course custom fields" in site administration
- And I click on "Add a new custom field" "link"
- And I click on "Short text" "link"
- And I set the following fields to these values:
- | Name | Test field |
- | Short name | testfield |
- And I click on "Save changes" "button" in the "Adding a new Short text" "dialogue"
- And I follow "Dashboard"
- And I am on "Course 01" course homepage
- And I navigate to "Settings" in current page administration
- And I set the following fields to these values:
- | Test field | value1 |
- And I click on "Save and display" "button"
- And I am on "Course 02" course homepage
- And I navigate to "Settings" in current page administration
- And I set the following fields to these values:
- | Test field | value1 |
- And I click on "Save and display" "button"
- And I am on "Course 03" course homepage
- And I navigate to "Settings" in current page administration
- And I set the following fields to these values:
- | Test field | value2 |
- And I click on "Save and display" "button"
- When I log in as "admin"
- And I navigate to smart menu "List menu" items
- And I click on ".action-edit" "css_element" in the "Dynamic courses" "table_row"
- And I should see "Test field"
- And I set the field "Test field" to ""
- And I press "Save changes"
- And I log out
- And I log in as ""
- Then I see smart menu "List menu" item "Course 01" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 02" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 03" in location "Main, Menu, User, Bottom"
- And I see smart menu "List menu" item "Course 04" in location "Main, Menu, User, Bottom"
+ And the following "custom fields" exist:
+ | name | category | type | shortname |
+ | Test field | Others | text | testfield |
+ And the following "courses" exist:
+ | fullname | shortname | customfield_testfield |
+ | Course 07 | C7 | value1 |
+ | Course 08 | C8 | value1 |
+ | Course 09 | C9 | value2 |
+ And the following "theme_boost_union > smart menu item" exists:
+ | menu | List menu |
+ | title | Dynamic courses |
+ | itemtype | Dynamic courses |
+ | customfields | Test field: |
+ When I log in as "student1"
+ Then "Course 07" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 07" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Menu bar smart menu"
+ And "Course 07" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > User menu smart menu"
+ And "Course 07" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Bottom bar smart menu"
+ And "Course 08" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 09" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
+ And "Course 04" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu"
Examples:
- | value | user | course1 | course2 | course3 | course4 |
- | value1 | student1 | should | should | should not | should not |
- | value2 | student1 | should not | should not | should | should not |
+ | value | course1 | course2 | course3 | course4 |
+ | value1 | should | should | should not | should not |
+ | value2 | should not | should not | should | should not |
@javascript
Scenario Outline: Smartmenus: Menu items: Dynamic courses - Sort the course list based on the given setting
@@ -274,58 +267,52 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, usi
| AAA Course | BBB | CAT1 | CCC |
| BBB Course | AAA | CAT1 | BBB |
| CCC Course | CCC | CAT1 | AAA |
- When I log in as "admin"
- And I navigate to smart menu "List menu" items
- And I click on ".action-edit" "css_element" in the "Dynamic courses" "table_row"
- And I set the field "Dynamic courses: Course list sorting" to ""
- And I press "Save changes"
- And I log out
+ And the following "theme_boost_union > smart menu item" exists:
+ | menu | List menu |
+ | title | Dynamic courses |
+ | itemtype | Dynamic courses |
+ | listsort | |
When I log in as "student1"
- And I click on ".dynamiccoursetest" "css_element"
+ And I click on "List menu" "theme_boost_union > Smart menu"
Then "" "text" should appear before "" "text" in the ".dynamiccoursetest .dropdown-menu" "css_element"
And "" "text" should appear before "" "text" in the ".dynamiccoursetest .dropdown-menu" "css_element"
Examples:
- | sorting | thisbeforethat1 | thisbeforethat2 | thisbeforethat3 |
- # Option: Course fullname ascending
- | 0 | AAA Course | BBB Course | CCC Course |
- # Option: Course fullname descending
- | 1 | CCC Course | BBB Course | AAA Course |
- # Option: Course shortname ascending
- | 2 | BBB Course | AAA Course | CCC Course |
- # Option: Course shortname descending
- | 3 | CCC Course | AAA Course | BBB Course |
- # Option: Course ID ascending
- | 4 | AAA Course | BBB Course | CCC Course |
- # Option: Course ID descending
- | 5 | CCC Course | BBB Course | AAA Course |
- # Option: Course ID number ascending
- | 6 | CCC Course | BBB Course | AAA Course |
- # Option: Course ID number descending
- | 7 | AAA Course | BBB Course | CCC Course |
+ | sorting | thisbeforethat1 | thisbeforethat2 | thisbeforethat3 |
+ | Course fullname ascending | AAA Course | BBB Course | CCC Course |
+ | Course fullname descending | CCC Course | BBB Course | AAA Course |
+ | Course shortname ascending | BBB Course | AAA Course | CCC Course |
+ | Course shortname descending | CCC Course | AAA Course | BBB Course |
+ | Course ID ascending | AAA Course | BBB Course | CCC Course |
+ | Course ID descending | CCC Course | BBB Course | AAA Course |
+ | Course ID number ascending | CCC Course | BBB Course | AAA Course |
+ | Course ID number descending | AAA Course | BBB Course | CCC Course |
@javascript
Scenario Outline: Smartmenus: Menu items: Dynamic courses - Hide empty menus
- When I log in as "admin"
- And I navigate to smart menus
- And I click on ".action-edit" "css_element" in the "List menu" "table_row"
- And I set the field "Menu mode" to ""
- And I click on "Save and configure items" "button"
- And I click on ".action-edit" "css_element" in the "Dynamic courses" "table_row"
- And I set the field "Dynamic courses: Enrolment role" to ""
- And I set the field "Menu item mode" to ""
- And I press "Save changes"
- And I log out
- And I log in as ""
- Then I see smart menu "" in location "Main, Menu, User, Bottom"
+ And the following "theme_boost_union > smart menu" exists:
+ | title | Mode menu |
+ | location | Main navigation, Menu bar, User menu, Bottom bar |
+ | mode | |
+ And the following "theme_boost_union > smart menu item" exists:
+ | menu | Mode menu |
+ | title | Dynamic courses |
+ | itemtype | Dynamic courses |
+ | itemmode | |
+ | enrolmentrole | |
+ When I log in as ""
+ Then "" "theme_boost_union > Main menu " exist
+ And "" "theme_boost_union > Menu bar " exist
+ And "" "theme_boost_union > User menu " exist
+ And "" "theme_boost_union > Bottom bar " exist
Examples:
- | role | user | shouldornot | menutitle | menumode |
- | Non-editing teacher, Teacher | student1 | should not | List menu | Submenu |
- | Non-editing teacher, Teacher | teacher | should | List menu | Submenu |
- | Student | student1 | should | List menu | Submenu |
- | Student | teacher | should not | List menu | Submenu |
- | Non-editing teacher, Teacher | student1 | should not | Course 01 | Inline |
- | Non-editing teacher, Teacher | teacher | should | Course 01 | Inline |
- | Student | student1 | should | Course 01 | Inline |
- | Student | teacher | should not | Course 01 | Inline |
+ | role | user | shouldornot | menutitle | menumode | locator |
+ | teacher, editingteacher | student1 | should not | Mode menu | Submenu | smart menu |
+ | teacher, editingteacher | teacher | should | Mode menu | Submenu | smart menu |
+ | student | student1 | should | Mode menu | Submenu | smart menu |
+ | student | teacher | should not | Mode menu | Submenu | smart menu |
+ | teacher, editingteacher | student1 | should not | Course 01 | Inline | smart menu item |
+ | teacher, editingteacher | teacher | should | Course 01 | Inline | smart menu item |
+ | student | student1 | should | Course 01 | Inline | smart menu item |
+ | student | teacher | should not | Course 01 | Inline | smart menu item |
diff --git a/tests/behat/theme_boost_union_smartmenusettings_menuitems_presentation.feature b/tests/behat/theme_boost_union_smartmenusettings_menuitems_presentation.feature
index ad1c9b9e2b4..cefddac63a1 100644
--- a/tests/behat/theme_boost_union_smartmenusettings_menuitems_presentation.feature
+++ b/tests/behat/theme_boost_union_smartmenusettings_menuitems_presentation.feature
@@ -5,8 +5,7 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app
I need to be able to configure the theme Boost Union plugin
Background:
- Given I log in as "admin"
- And the following "courses" exist:
+ Given the following "courses" exist:
| fullname | shortname | category |
| Test course1 | C1 | 0 |
| Test course2 | C2 | 0 |
@@ -14,32 +13,33 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app
And the following "users" exist:
| username |
| user1 |
- And I create smart menu with the following fields to these values:
- | Title | Quick links |
- | Menu location(s) | Main, Menu, User, Bottom |
+ And the following "theme_boost_union > smart menu" exists:
+ | title | Quick links |
+ | location | Main navigation, Menu bar, User menu, Bottom bar |
@javascript
Scenario Outline: Smartmenus: Menu items: Presentation - Open the smart menu items in different targets
+ Given the following "theme_boost_union > smart menu item" exists:
+ | menu | Quick links |
+ | title | Available courses |
+ | itemtype | Dynamic courses |
+ | category | 0 |
+ | itemmode | Inline |
+ | target | |
When I log in as "admin"
- And I set "Quick links" smart menu items with the following fields to these values:
- | Title | Available courses |
- | Menu item type | Dynamic courses |
- | Dynamic courses: Course category | Category 1 |
- | Menu item mode | Inline |
- | Link target | |
- And I should see "Available courses" in the "smartmenus_items" "table"
# Menu items in main navigation
+ Then "Test course1" "theme_boost_union > Smart menu item" should exist in the "Quick links" "theme_boost_union > Main menu smart menu"
Then I should see smart menu "Quick links" item "Test course1" in location "Main"
And the "target" attribute of "//div[@class='primary-navigation']//a[contains(normalize-space(.), 'Test course1')]" "xpath_element"
# Menu items in user menu.
- And I should see smart menu "Quick links" item "Test course1" in location "User"
+ Then "Test course1" "theme_boost_union > Smart menu item" should exist in the "Quick links" "theme_boost_union > User menu smart menu"
And the "target" attribute of "//div[contains(@class, 'carousel-item')]//a[contains(normalize-space(.), 'Test course1')]" "xpath_element"
# Menu items in bottom menu.
- Then I should see smart menu "Quick links" item "Test course1" in location "Bottom"
+ Then "Test course1" "theme_boost_union > Smart menu item" should exist in the "Quick links" "theme_boost_union > Bottom bar smart menu"
And the "target" attribute of "//div[@class='bottom-navigation']//a[contains(normalize-space(.), 'Test course1')]" "xpath_element"
Then I change the viewport size to "large"
# Menu items in menubar.
- And I should see smart menu "Quick links" item "Test course1" in location "Menu"
+ Then "Test course1" "theme_boost_union > Smart menu item" should exist in the "Quick links" "theme_boost_union > Menu bar smart menu"
And the "target" attribute of "//nav[contains(@class, 'menubar')]//a[contains(normalize-space(.), 'Test course1')]" "xpath_element"
Examples:
@@ -49,18 +49,14 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app
@javascript
Scenario: Smartmenus: Menu items: Presentation - Include the custom css class for a smart menu item
- When I log in as "admin"
- And I set "Quick links" smart menu items with the following fields to these values:
- | Title | Resources |
- | Menu item type | Static |
- | Menu item URL | http://moodle.org |
- And I navigate to smart menu "Quick links" items
- And I click on ".action-edit" "css_element" in the "Resources" "table_row"
- And I expand all fieldsets
- And I set the field "CSS class" to "static-item-resources"
- And I click on "Save changes" "button"
- And I should see "Resources" in the "smartmenus_items" "table"
- And the "class" attribute of "//div[@class='primary-navigation']//a[contains(normalize-space(.), 'Resources')]" "xpath_element" should contain "static-item-resources"
+ Given the following "theme_boost_union > smart menu item" exists:
+ | menu | Quick links |
+ | title | Resources |
+ | itemtype | Static |
+ | url | http://moodle.org |
+ | cssclass | static-item-resources |
+ When I am on the "Quick links" "theme_boost_union > Smart menu > Items" page logged in as "admin"
+ Then the "class" attribute of "//div[@class='primary-navigation']//a[contains(normalize-space(.), 'Resources')]" "xpath_element" should contain "static-item-resources"
And the "class" attribute of "//div[contains(@class, 'carousel-item')]//a[contains(normalize-space(.), 'Resources')]" "xpath_element" should contain "static-item-resources"
And the "class" attribute of "//nav[contains(@class, 'menubar')]//a[contains(normalize-space(.), 'Resources')]" "xpath_element" should contain "static-item-resources"
And I change the viewport size to "740x900"
@@ -82,16 +78,22 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app
@javascript
Scenario Outline: Smartmenus: Menu items: Presentation - Display the different fields as smart menu item title
+ Given the following "theme_boost_union > smart menu item" exists:
+ | menu | Quick links |
+ | title | Available courses |
+ | itemtype | Dynamic courses |
+ | category | 0 |
+ | displayfield | |
+ | textcount | |
When I log in as "admin"
- And I set "Quick links" smart menu items with the following fields to these values:
- | Title | Available courses |
- | Menu item type | Dynamic courses |
- | Dynamic courses: Course category | Category 1 |
- | Dynamic courses: Course name presentation | |
- | Dynamic courses: Number of words | |
- And I should see "Available courses" in the "smartmenus_items" "table"
- And I should see smart menu "Quick links" item "" in location "Main, Menu, User, Bottom"
- And I should not see smart menu "Quick links" item "" in location "Main, Menu, User, Bottom"
+ Then "" "theme_boost_union > Smart menu item" should exist in the "Quick links" "theme_boost_union > Main menu smart menu"
+ And "" "theme_boost_union > Smart menu item" should exist in the "Quick links" "theme_boost_union > Menu bar smart menu"
+ And "" "theme_boost_union > Smart menu item" should exist in the "Quick links" "theme_boost_union > User menu smart menu"
+ And "" "theme_boost_union > Smart menu item" should exist in the "Quick links" "theme_boost_union > Bottom bar smart menu"
+ And "" "theme_boost_union > Smart menu item" should not exist in the "Quick links" "theme_boost_union > Main menu smart menu"
+ And "" "theme_boost_union > Smart menu item" should not exist in the "Quick links" "theme_boost_union > Menu bar smart menu"
+ And "" "theme_boost_union > Smart menu item" should not exist in the "Quick links" "theme_boost_union > User menu smart menu"
+ And "" "theme_boost_union > Smart menu item" should not exist in the "Quick links" "theme_boost_union > Bottom bar smart menu"
Examples:
| selectnamefield | numberofwords | showntitle | notshowntitle |
diff --git a/tests/behat/theme_boost_union_smartmenusettings_menuitems_rules.feature b/tests/behat/theme_boost_union_smartmenusettings_menuitems_rules.feature
index a19c3ae615a..f6754be91b9 100644
--- a/tests/behat/theme_boost_union_smartmenusettings_menuitems_rules.feature
+++ b/tests/behat/theme_boost_union_smartmenusettings_menuitems_rules.feature
@@ -29,22 +29,15 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app
| student2 | CH1 |
| student2 | CH2 |
| teacher | CH2 |
- And I create smart menu with the following fields to these values:
- | Title | Quick links |
- | Menu location(s) | Main, Menu, User, Bottom |
- And I set "Quick links" smart menu items with the following fields to these values:
- | Title | Resources |
- | Menu item type | Static |
- | URL | https://moodle.org |
+ And the following "theme_boost_union > smart menu" exists:
+ | title | Quick links |
+ | location | Main navigation, Menu bar, User menu, Bottom bar |
# Empty menus are hidden from view. To prevent that the whole menu is missing and the test fails,
# a sample item is created.
- And I set "Quick links" smart menu items with the following fields to these values:
- | Title | Info |
- | Menu item type | Heading |
- And the following "language packs" exist:
- | language |
- | de |
- | fr |
+ And the following "theme_boost_union > smart menu item" exists:
+ | menu | Quick links |
+ | title | Info |
+ | itemtype | Heading |
@javascript
Scenario Outline: Smartmenu: Menu items: Rules - Show smart menu item based on the user roles
@@ -61,265 +54,227 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app
And the following "roles" exist:
| name | shortname | description |
| Visitor | visitor | My visitor role |
+ And the following "theme_boost_union > smart menu item" exists:
+ | menu | Quick links |
+ | title | Resources |
+ | itemtype | Static |
+ | url | https://moodle.org |
+ | roles | |
+ | rolecontext | |
+ Given I am logged in as "admin"
And I navigate to "Users > Permissions > User policies" in site administration
And I set the field "Role for visitors" to "Visitor (visitor)"
And I press "Save changes"
- When I navigate to smart menus
- And I should see "Quick links" in the "smartmenus" "table"
- And I should see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I click on ".action-list-items" "css_element" in the "Quick links" "table_row"
- And I click on ".action-edit" "css_element" in the "Resources" "table_row"
- And I expand all fieldsets
- And I set the field "By role" to ""
- And I set the field "Context" to ""
- And I click on "Save changes" "button"
- And I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I log out
- And I log in as "coursemanager"
- Then I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I log out
- And I log in as "student1"
- Then I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I log out
- And I log in as "teacher"
- Then I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I log out
- And I log in as "systemmanager"
- Then I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I log in as "guest"
- Then I see smart menu "Quick links" item "Resources" in location "Main, Menu, Bottom"
- And I log out
- And I see smart menu "Quick links" item "Resources" in location "Main, Menu, Bottom"
+ And "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Main menu smart menu"
+ And "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Menu bar smart menu"
+ And "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > User menu smart menu"
+ And "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Bottom bar smart menu"
+ When I am logged in as "coursemanager"
+ Then "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Main menu smart menu"
+ When I am logged in as "student1"
+ Then "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Main menu smart menu"
+ When I am logged in as "teacher"
+ Then "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Main menu smart menu"
+ When I am logged in as "systemmanager"
+ Then "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Main menu smart menu"
+ When I am logged in as "guest"
+ Then "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Main menu smart menu"
+ When I log out
+ Then "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Main menu smart menu"
Examples:
- | byrole | context | student1shouldorshouldnot | teachershouldorshouldnot | managershouldorshouldnot | guestshouldorshouldnot | adminshouldorshouldnot | systemshouldorshouldnot | visitorshouldorshouldnot |
- | Manager | Any | should not | should not | should | should not | should not | should | should not |
- | Manager, Student | Any | should | should not | should | should not | should not | should | should not |
- | Manager, Student, Teacher | Any | should | should | should | should not | should not | should | should not |
- | Manager, Student, Teacher | System | should not | should not | should not | should not | should not | should | should not |
- | Authenticated user | Any | should | should | should | should not | should | should | should not |
- | Guest | Any | should not | should not | should not | should | should not | should not | should not |
- | Visitor | Any | should not | should not | should not | should not | should not | should not | should |
+ | byrole | context | student1shouldorshouldnot | teachershouldorshouldnot | managershouldorshouldnot | guestshouldorshouldnot | adminshouldorshouldnot | systemshouldorshouldnot | visitorshouldorshouldnot |
+ | Manager | Any | should not | should not | should | should not | should not | should | should not |
+ | Manager, Student | Any | should | should not | should | should not | should not | should | should not |
+ | Manager, Student, editingteacher | Any | should | should | should | should not | should not | should | should not |
+ | Manager, Student, editingteacher | System | should not | should not | should not | should not | should not | should | should not |
+ | user | Any | should | should | should | should not | should | should | should not |
+ | Guest | Any | should not | should not | should not | should | should not | should not | should not |
+ | Visitor | Any | should not | should not | should not | should not | should not | should not | should |
@javascript
Scenario Outline: Smartmenu: Menu items: Rules - Show smart menu item based on being site admin
- When I navigate to smart menus
- And I should see "Quick links" in the "smartmenus" "table"
- And I should see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I click on ".action-list-items" "css_element" in the "Quick links" "table_row"
- And I click on ".action-edit" "css_element" in the "Resources" "table_row"
- And I expand all fieldsets
- And I set the field "Show to" to ""
- And I click on "Save changes" "button"
- And I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I log out
- And I log in as "student1"
- Then I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
+ And the following "theme_boost_union > smart menu item" exists:
+ | menu | Quick links |
+ | title | Resources |
+ | itemtype | Static |
+ | url | https://moodle.org |
+ | byadmin | |
+ When I am logged in as "admin"
+ And "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Main menu smart menu"
+ And "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Menu bar smart menu"
+ And "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > User menu smart menu"
+ And "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Bottom bar smart menu"
+ When I am logged in as "student1"
+ And "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Bottom bar smart menu"
Examples:
- | byadmin | adminshouldorshouldnot | student1shouldorshouldnot |
- | 0 | should | should |
- | 1 | should | should not |
- | 2 | should not | should |
+ | byadmin | adminshouldorshouldnot | student1shouldorshouldnot |
+ | All users | should | should |
+ | Site admins only | should | should not |
+ | Non-admins only | should not | should |
@javascript
Scenario Outline: Smartmenu: Menu items: Rules - Show smart menu item based on the user assignment in single cohorts
- When I navigate to smart menus
- And I should see "Quick links" in the "smartmenus" "table"
- And I should see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I click on ".action-list-items" "css_element" in the "Quick links" "table_row"
- And I click on ".action-edit" "css_element" in the "Resources" "table_row"
- And I expand all fieldsets
- And I set the field "By cohort" to ""
- And I click on "Save changes" "button"
- And I should not see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I log out
- And I log in as "student1"
- Then I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I log out
- And I log in as "student2"
- Then I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
- And I log out
- And I log in as "teacher"
- Then I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom"
+ Given the following "theme_boost_union > smart menu item" exists:
+ | menu | Quick links |
+ | title | Resources |
+ | itemtype | Static |
+ | url | https://moodle.org |
+ | cohorts | |
+ When I am logged in as "admin"
+ And "Resources" "theme_boost_union > Smart menu item" should not exist in the "Quick links" "theme_boost_union > Main menu smart menu"
+ And "Resources" "theme_boost_union > Smart menu item" should not exist in the "Quick links" "theme_boost_union > Menu bar smart menu"
+ And "Resources" "theme_boost_union > Smart menu item" should not exist in the "Quick links" "theme_boost_union > User menu smart menu"
+ And "Resources" "theme_boost_union > Smart menu item" should not exist in the "Quick links" "theme_boost_union > Bottom bar smart menu"
+ When I am logged in as "student1"
+ Then "Resources" "theme_boost_union > Smart menu item"