diff --git a/tests/behat/theme_boost_union_smartmenusettings_menuitems_dynamiccourses.feature b/tests/behat/theme_boost_union_smartmenusettings_menuitems_dynamiccourses.feature index be3253953b7..eae56aa4002 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 01a" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Main menu smart menu" + And "Course 01a" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Menu bar smart menu" + And "Course 01a" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > User menu smart menu" + And "Course 01a" "theme_boost_union > Smart menu item" exist in the "List menu" "theme_boost_union > Bottom bar 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,82 +187,73 @@ 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 "" + 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 | @@ -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_rules.feature b/tests/behat/theme_boost_union_smartmenusettings_menuitems_rules.feature index 992b849d7de..916d8b2a366 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,244 +54,205 @@ 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 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" exist in the "Quick links" "theme_boost_union > Bottom bar smart menu" + When I am logged in as "student2" + Then "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 "teacher" + Then "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Bottom bar smart menu" Examples: | bycohort | student1shouldorshouldnot | student2shouldorshouldnot | teachershouldorshouldnot | - | Cohort 1 | should | should | should not | - | Cohort 2 | should not | should | should | + | CH1 | should | should | should not | + | CH2 | should not | should | should | @javascript Scenario Outline: Smartmenu: Menu items: Rules - Show smart menu item based on the user assignment in multiple 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 set the field "Operator" 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 | | + | operator | | + 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" exist in the "Quick links" "theme_boost_union > Bottom bar smart menu" + When I am logged in as "student2" + Then "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 "teacher" + Then "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Bottom bar smart menu" Examples: - | bycohorts | operator | student1shouldorshouldnot | student2shouldorshouldnot | teachershouldorshouldnot | - | Cohort 1, Cohort 2 | Any | should | should | should | - | Cohort 1, Cohort 2 | All | should not | should | should not | + | bycohorts | operator | student1shouldorshouldnot | student2shouldorshouldnot | teachershouldorshouldnot | + | CH1, CH2 | Any | should | should | should | + | CH1, CH2 | All | should not | should | should not | @javascript Scenario Outline: Smartmenu: Menu items: Rules - Show smart menu item based on the user's prefered language - When I log in as "teacher" - And I follow "Preferences" in the user menu - And I click on "Preferred language" "link" - And I set the field "Preferred language" to "Deutsch ‎(de)‎" - And I press "Save changes" - And I log out - And I log in as "student1" - And I follow "Preferences" in the user menu - And I click on "Preferred language" "link" - And I set the field "Preferred language" to "English ‎(en)‎" - And I press "Save changes" - And I log out - And I log in as "student2" - And I follow "Preferences" in the user menu - And I click on "Preferred language" "link" - And I set the field "Preferred language" to "Français ‎(fr)‎" - And I press "Save changes" - And I log out - When I log in as "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 "By language" to "" - And I click on "Save changes" "button" - And I log out - And I log in as "student1" - And I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom" - And I log out - And I log in as "student2" - And I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom" - And I log out - And I log in as "teacher" - And I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom" + Given the following "language packs" exist: + | language | + | de | + | fr | + And the following "theme_boost_union > smart menu item" exists: + | menu | Quick links | + | title | Resources | + | itemtype | Static | + | url | https://moodle.org | + | languages | | + 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" + 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 "student2" + And I follow "Language" in the user menu + And I click on "Français" "link" + Then "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 "teacher" + And I follow "Language" in the user menu + And I click on "Deutsch" "link" + Then "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Bottom bar smart menu" Examples: - | bylanguage | student1shouldorshouldnot | student2shouldorshouldnot | teachershouldorshouldnot | - | English | should | should not | should not | - | English, Deutsch | should | should not | should | + | bylanguage | student1shouldorshouldnot | student2shouldorshouldnot | teachershouldorshouldnot | + | en | should | should not | should not | + | en, de | should | should not | should | @javascript Scenario Outline: Smartmenu: Menu items: Rules - Show smart menu item based on the custom date range - 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 following fields to these values: - | id_start_date_enabled | | - | id_end_date_enabled | | - | id_start_date_day | | - | id_start_date_month | | - | id_start_date_year | | - | id_end_date_day | | - | id_end_date_month | | - | id_end_date_year | | - And I click on "Save changes" "button" - And I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom" - Then I log out - And I log in as "student1" - And I see smart menu "Quick links" item "Resources" in location "Main, Menu, User, Bottom" - And I log out - When I log in as "teacher" - And 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 | + | start_date | | + | end_date | | + When I am logged in as "admin" + Then "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" + 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" Examples: - | startenabled |endenabled | start_day | start_month | start_year | end_day | end_month | end_year | menushouldorshouldnot | - | 1 | 1 | 1 | January | 2023 | 1 | January | 2050 | should | - | 1 | 1 | 1 | January | 2049 | 1 | January | 2050 | should not | - | 1 | 1 | 1 | January | 2023 | 1 | December | 2023 | should not | - | 1 | 0 | 1 | January | 2023 | 1 | 1 | 2023 | should | - | 1 | 0 | 1 | January | 2049 | 1 | 1 | 2023 | should not | - | 0 | 1 | 1 | January | 2023 | 1 | December | 2050 | should | - | 0 | 1 | 1 | January | 2023 | 1 | December | 2023 | should not | + | start_date | end_date | menushouldorshouldnot | + | ## 1 January 2023 ## | ## 1 January 2050 ## | should | + | ## 1 January 2049 ## | ## 1 January 2050 ## | should not | + | ## 1 January 2023 ## | ## 1 December 2023 ## | should not | + | ## 1 January 2023 ## | | should | + | ## 1 January 2049 ## | | should not | + | | ## 1 December 2050 ## | should | + | | ## 1 December 2023 ## | should not | @javascript Scenario Outline: Smartmenu: Menu items: Rules - Show smart menu item based on multiple conditions - When I log in as "teacher" - And I follow "Preferences" in the user menu - And I click on "Preferred language" "link" - And I set the field "Preferred language" to "Deutsch ‎(de)‎" - And I press "Save changes" - And I log out - And I log in as "student1" - And I follow "Preferences" in the user menu - And I click on "Preferred language" "link" - And I set the field "Preferred language" to "English ‎(en)‎" - And I press "Save changes" - And I log out - And I log in as "student2" - And I follow "Preferences" in the user menu - And I click on "Preferred language" "link" - And I set the field "Preferred language" to "Français ‎(fr)‎" - And I press "Save changes" - And I log out - When I log in as "admin" - And 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 "By cohort" to "" - And I set the field "By language" to "" - And I click on "Save changes" "button" - 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 "language packs" exist: + | language | + | de | + | fr | + And the following "theme_boost_union > smart menu item" exists: + | menu | Quick links | + | title | Resources | + | itemtype | Static | + | url | https://moodle.org | + | roles | | + | cohorts | | + | languages | | + 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" + 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 "student2" + And I follow "Language" in the user menu + And I click on "Français" "link" + Then "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 "teacher" + And I follow "Language" in the user menu + And I click on "Deutsch" "link" + Then "Resources" "theme_boost_union > Smart menu item" exist in the "Quick links" "theme_boost_union > Bottom bar smart menu" Examples: - | byrole | bycohort | bylanguage | student1shouldorshouldnot | student2shouldorshouldnot | teachershouldorshouldnot | - | Manager, Student | Cohort 1 | English | should | should not | should not | - | Manager, Student, Teacher | Cohort 1, Cohort 2 | English, Deutsch | should | should not | should | + | byrole | bycohort | bylanguage | student1shouldorshouldnot | student2shouldorshouldnot | teachershouldorshouldnot | + | Manager, Student | CH1 | en | should | should not | should not | + | Manager, Student, editingteacher | CH1, CH2 | en, de | should | should not | should | @javascript Scenario: Smartmenu: Menu items: Rules - Deleting a cohort used for a rule removes it from the rule - Given I navigate to smart menus - And I should see "Quick links" in the "smartmenus" "table" - 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 "Cohort 1, Cohort 2" - And I set the field "Operator" to "Any" - And I click on "Save changes" "button" + Given the following "theme_boost_union > smart menu item" exists: + | menu | Quick links | + | title | Resources | + | itemtype | Static | + | url | https://moodle.org | + | cohorts | CH1, CH2 | + And I am on the "Quick links" "theme_boost_union > Smart menu > Items" page logged in as "admin" And I should see "Cohort 1" in the "Resources" "table_row" And I should see "Cohort 2" in the "Resources" "table_row" When I navigate to "Users > Cohorts" in site administration And I open the action menu in "Cohort 1" "table_row" And I choose "Delete" in the open action menu And I click on "Delete" "button" in the "Delete selected" "dialogue" - And I navigate to smart menus - And I click on ".action-list-items" "css_element" in the "Quick links" "table_row" - And I should not see "Cohort 1" in the "Resources" "table_row" + And I am on the "Quick links" "theme_boost_union > Smart menu > Items" page + Then I should not see "Cohort 1" in the "Resources" "table_row" And I should see "Cohort 2" in the "Resources" "table_row" @javascript @@ -307,20 +261,18 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app | shortname | name | | test1 | Test role 1 | | test2 | Test role 2 | - And I navigate to smart menus - And I should see "Quick links" in the "smartmenus" "table" - 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 "Test role 1, Test role 2" - And I set the field "Operator" to "Any" - And I click on "Save changes" "button" + And the following "theme_boost_union > smart menu item" exists: + | menu | Quick links | + | title | Resources | + | itemtype | Static | + | url | https://moodle.org | + | roles | test1, test2 | + And I am on the "Quick links" "theme_boost_union > Smart menu > Items" page logged in as "admin" And I should see "Test role 1" in the "Resources" "table_row" And I should see "Test role 2" in the "Resources" "table_row" When I navigate to "Users > Define roles" in site administration And I click on "Delete" "link" in the "Test role 1" "table_row" And I press "Yes" - And I navigate to smart menus - And I click on ".action-list-items" "css_element" in the "Quick links" "table_row" - And I should not see "Test role 1" in the "Resources" "table_row" + And I am on the "Quick links" "theme_boost_union > Smart menu > Items" page + Then I should not see "Test role 1" in the "Resources" "table_row" And I should see "Test role 2" in the "Resources" "table_row"