MDL-72032 core: Add roles to items

- Part of: MDL-69588
This commit is contained in:
Peter Dias
2021-07-08 08:02:48 +08:00
committed by Mathew May
parent 9f40dcae9a
commit dfefc86393
12 changed files with 63 additions and 31 deletions
-1
View File
@@ -59,5 +59,4 @@ Feature: Block appearances
| Visible | No |
And I press "Save changes"
And I press "Turn editing off"
And I follow "Test book name"
Then I should not see "Comments"
+2 -2
View File
@@ -45,7 +45,7 @@
}
}}
<nav class="moremenu">
<ul id="moremenu-{{ uniqid }}" {{#tabs}}role="tablist"{{/tabs}} class="nav more-nav {{navbarstyle}}">
<ul id="moremenu-{{ uniqid }}" {{#tabs}}role="tablist"{{/tabs}} {{^tabs}}role="menu"{{/tabs}}class="nav more-nav {{navbarstyle}}">
{{#nodecollection}}
{{#children}}
{{> core/moremenu_children}}
@@ -54,7 +54,7 @@
{{#nodearray}}
{{> core/moremenu_children}}
{{/nodearray}}
<li class="nav-item dropdown dropdownmoremenu d-none" data-region="morebutton">
<li class="nav-item dropdown dropdownmoremenu d-none" data-region="morebutton" role="menuitem">
<a class="dropdown-toggle nav-link" href="#" id="moremenu-dropdown{{ uniqid }}" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{#str}}moremenu, core{{/str}}
</a>
+2 -2
View File
@@ -31,7 +31,7 @@
}
}}
{{#haschildren}}
<li class="dropdown nav-item" data-forceintomoremenu="{{#forceintomoremenu}}true{{/forceintomoremenu}}{{^forceintomoremenu}}false{{/forceintomoremenu}}">
<li class="dropdown nav-item" role="menuitem" data-forceintomoremenu="{{#forceintomoremenu}}true{{/forceintomoremenu}}{{^forceintomoremenu}}false{{/forceintomoremenu}}">
<a class="dropdown-toggle nav-link" id="drop-down-{{uniqid}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#" {{#title}}title="{{{title}}}"{{/title}} aria-controls="drop-down-menu-{{uniqid}}">
{{{text}}}
</a>
@@ -48,7 +48,7 @@
</li>
{{/haschildren}}
{{^haschildren}}
<li class="nav-item" data-forceintomoremenu="{{#forceintomoremenu}}true{{/forceintomoremenu}}{{^forceintomoremenu}}false{{/forceintomoremenu}}">
<li class="nav-item" role="menuitem" data-forceintomoremenu="{{#forceintomoremenu}}true{{/forceintomoremenu}}{{^forceintomoremenu}}false{{/forceintomoremenu}}">
{{#tab}}
<a class="nav-link {{#isactive}}active{{/isactive}} {{#classes}}{{.}} {{/classes}}" href="{{tab}}" role="tab" data-toggle="tab" aria-selected="false" tabindex="-1">{{{text}}}
</a>
+14
View File
@@ -41,6 +41,20 @@ use Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException;
*/
class behat_navigation extends behat_base {
/**
* Checks whether a navigation node is active within the block navigation.
*
* @Given i should see :name is active in navigation
*
* @throws ElementNotFoundException
* @param string $element The name of the nav elemnent to look for.
* @return void
*/
public function i_should_see_is_active_in_navigation($element) {
$this->execute("behat_general::assert_element_contains_text",
[$element, '.block_navigation .active_tree_node', 'css_element']);
}
/**
* Helper function to get a navigation nodes text element given its text from within the navigation block.
*
@@ -57,7 +57,6 @@ Feature: Saving, using and deleting feedback templates
And I press "Use this template"
And I should see "this is a multiple choice 1"
And I press "Save changes"
And I follow "Edit questions"
And I should see "this is a multiple choice 1"
# Make sure this template is not available in another course
And I am on the "Learning experience course 2" "feedback activity" page
@@ -85,7 +84,6 @@ Feature: Saving, using and deleting feedback templates
And I press "Use this template"
And I set the field "Append new items" to "1"
And I press "Save changes"
And I follow "Edit questions"
Then "What is your favourite subject" "text" should appear before "this is a multiple choice 1" "text"
# Import template replacing items
And I follow "Templates"
@@ -110,7 +108,6 @@ Feature: Saving, using and deleting feedback templates
And I press "Use this template"
Then I should see "this is a multiple choice 1"
And I press "Save changes"
And I follow "Edit questions"
And I should see "this is a multiple choice 1"
Scenario: Teacher can delete course templates but can not delete public templates
@@ -54,6 +54,7 @@ Feature: View activity completion in the quiz activity
And user "student1" has attempted "Test quiz name" with responses:
| slot | response |
| 1 | False |
And I am on "Course 1" course homepage
And I follow "Test quiz name"
And the "View" completion condition of "Test quiz name" is displayed as "done"
And the "Make attempts: 1" completion condition of "Test quiz name" is displayed as "done"
@@ -62,6 +62,7 @@ Feature: View activity completion information in the Workshop activity
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I change phase in workshop "Music history" to "Grading evaluation phase"
And I am on "Course 1" course homepage
And I follow "Music history"
And I click on "Re-calculate grades" "button"
And I change phase in workshop "Music history" to "Closed"
+16 -16
View File
@@ -35,14 +35,14 @@ Feature: View the user page for the outline report
And I am on "Course 1" course homepage
# We want to view this multiple times, to make sure the count is working.
And I follow "Folder name"
And I follow "Folder name"
And I follow "Folder name"
And I follow "Folder name"
And I am on "Course 1" course homepage
And I reload the page
And I reload the page
And I reload the page
# We want to view this multiple times, to make sure the count is working.
And I am on "Course 1" course homepage
And I follow "URL name"
And I follow "URL name"
And I follow "URL name"
And I reload the page
And I reload the page
And I follow "Profile" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
When I follow "Outline report"
@@ -63,14 +63,14 @@ Feature: View the user page for the outline report
And I am on "Course 1" course homepage
# We want to view this multiple times, to make sure the count is working.
And I follow "Folder name"
And I follow "Folder name"
And I follow "Folder name"
And I follow "Folder name"
And I reload the page
And I reload the page
And I reload the page
And I am on "Course 1" course homepage
# We want to view this multiple times, to make sure the count is working.
And I follow "URL name"
And I follow "URL name"
And I follow "URL name"
And I reload the page
And I reload the page
And I follow "Profile" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
When I follow "Outline report"
@@ -93,14 +93,14 @@ Feature: View the user page for the outline report
And I am on "Course 1" course homepage
# We want to view this multiple times, to make sure the count is working.
And I follow "Folder name"
And I follow "Folder name"
And I follow "Folder name"
And I follow "Folder name"
And I reload the page
And I reload the page
And I reload the page
And I am on "Course 1" course homepage
# We want to view this multiple times, to make sure the count is working.
And I follow "URL name"
And I follow "URL name"
And I follow "URL name"
And I reload the page
And I reload the page
And I follow "Profile" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
When I follow "Outline report"
@@ -31,6 +31,19 @@ use Behat\Mink\Exception\ExpectationException as ExpectationException;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_theme_boost_behat_navigation extends behat_navigation {
/**
* Checks whether a node is active in the navbar.
*
* @override i should see :name is active in navigation
*
* @throws ElementNotFoundException
* @param string $element The name of the nav elemnent to look for.
* @return void
*/
public function i_should_see_is_active_in_navigation($element) {
$this->execute("behat_general::assert_element_contains_text",
[$element, '.navbar .nav-link.active', 'css_element']);
}
/**
* Checks whether the language selector menu is present in the navbar.
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2021052503;
$plugin->version = 2021052504;
$plugin->requires = 2021052500;
$plugin->component = 'theme_boost';
+12 -5
View File
@@ -11,6 +11,9 @@ Feature: Set the site home page and dashboard as the default home page
And the following "users" exist:
| username | firstname | lastname | email |
| user1 | User | One | user1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| user1 | C1 | student |
Scenario: Admin sets the site page and then the dashboard as the default home page
# This functionality does not work without the administration block.
@@ -28,14 +31,16 @@ Feature: Set the site home page and dashboard as the default home page
And I am on site homepage
And I follow "Make this my home page"
And I should not see "Make this my home page"
And I am on "Course 1" course homepage
And "Home" "text" should exist in the ".breadcrumb" "css_element"
# The following lines should be changed once MDL-72110 is resolved.
# And I am on "Course 1" course homepage
# And "Home" "text" should exist in the ".breadcrumb" "css_element"
And I am on site homepage
And I follow "Dashboard"
And I follow "Make this my home page"
And I should not see "Make this my home page"
And I am on "Course 1" course homepage
Then "Dashboard" "text" should exist in the ".breadcrumb" "css_element"
# The following lines should be changed once MDL-72110 is resolved.
# And I am on "Course 1" course homepage
# Then "Dashboard" "text" should exist in the ".breadcrumb" "css_element"
Scenario: User cannot configure their preferred default home page unless allowed by admin
Given I log in as "user1"
@@ -53,7 +58,9 @@ Feature: Set the site home page and dashboard as the default home page
And I follow "Home page"
And I set the field "Home page" to "<preference>"
And I press "Save changes"
Then "<breadcrumb>" "text" should exist in the ".breadcrumb" "css_element"
And I log out
And I log in as "user1"
Then I should see "<breadcrumb>" is active in navigation
Examples:
| preference | breadcrumb |
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2021082000.02; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2021082000.03; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.0dev (Build: 20210820)'; // Human-friendly version name