You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: tests/behat/theme_boost_union_smartmenusettings_menus_presentation.feature
+67
Original file line number
Diff line number
Diff line change
@@ -424,3 +424,70 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app
424
424
| 1 | 0 | 0 | after | before | after |
425
425
| 0 | 0 | 2 | before | after | after |
426
426
| 0 | 1 | 2 | before | after | before |
427
+
428
+
@javascript
429
+
Scenario: Smartmenu: Menus: Presentation - Verify that the correct menu item is displayed as active when viewing the main menu item's page.
430
+
Given I log in as "admin"
431
+
And I create smart menu with the following fields to these values:
432
+
| Title | Quicklinks |
433
+
| Menulocation(s) | Main |
434
+
| Menumode | Inline |
435
+
And I set "Quick links" smart menu items with the following fields to these values:
436
+
| Title | Testnode |
437
+
| Menuitemtype | Static |
438
+
| URL | /admin/tool/dataprivacy/summary.php |
439
+
| CSSclass | testnode01 |
440
+
When I am on site homepage
441
+
Then the "class" attribute of ".primary-navigation [data-key='home'] a""css_element" should contain "active"
442
+
And the "class" attribute of ".primary-navigation .testnode01 a""css_element" should not contain "active"
443
+
And "//a[@aria-current = 'true']""xpath" should exist in the ".primary-navigation [data-key='home']""css_element"
444
+
And "//a[@aria-current = 'true']""xpath" should not exist in the ".primary-navigation .testnode01""css_element"
445
+
And I click on "Test node""link" in the ".primary-navigation""css_element"
446
+
Then the "class" attribute of ".primary-navigation [data-key='home'] a""css_element" should not contain "active"
447
+
And the "class" attribute of ".primary-navigation .testnode01 a""css_element" should contain "active"
448
+
And "//a[@aria-current = 'true']""xpath" should not exist in the ".primary-navigation [data-key='home']""css_element"
449
+
And "//a[@aria-current = 'true']""xpath" should exist in the ".primary-navigation .testnode01""css_element"
450
+
451
+
@javascript
452
+
Scenario: Smartmenu: Menus: Presentation - Verify that the correct menu item is displayed as active when viewing the submenu item's page.
453
+
Given I log in as "admin"
454
+
And I create smart menu with the following fields to these values:
455
+
| Title | Quicklinks |
456
+
| Menulocation(s) | Main |
457
+
| Menumode | Submenu |
458
+
| CSSclass | testnode01 |
459
+
And I set "Quick links" smart menu items with the following fields to these values:
460
+
| Title | Testnode |
461
+
| Menuitemtype | Static |
462
+
| URL | /admin/tool/dataprivacy/summary.php |
463
+
When I am on site homepage
464
+
Then the "class" attribute of ".primary-navigation [data-key='home'] a""css_element" should contain "active"
465
+
And the "class" attribute of ".primary-navigation .testnode01 a""css_element" should not contain "active"
466
+
And "//a[@aria-current = 'true']""xpath" should exist in the ".primary-navigation [data-key='home']""css_element"
467
+
And "//a[@aria-current = 'true']""xpath" should not exist in the ".primary-navigation .testnode01""css_element"
468
+
And I click on "Quick links""link" in the ".primary-navigation""css_element"
469
+
And I click on "Test node""link" in the ".primary-navigation""css_element"
470
+
Then the "class" attribute of ".primary-navigation [data-key='home'] a""css_element" should not contain "active"
471
+
And the "class" attribute of ".primary-navigation .testnode01 a""css_element" should contain "active"
472
+
And "//a[@aria-current = 'true']""xpath" should not exist in the ".primary-navigation [data-key='home']""css_element"
473
+
And "//a[@aria-current = 'true']""xpath" should exist in the ".primary-navigation .testnode01""css_element"
474
+
475
+
@javascript
476
+
Scenario: Smartmenu: Menus: Presentation - Verify that the correct _custom_ menu item is displayed as active when viewing the custom menu item's page (Moodle core behaviour which must not be broken by the smart menus)
477
+
Given I log in as "admin"
478
+
And I navigate to "Appearance > Advanced theme settings" in site administration
479
+
And I set the field "Custom menu items" to multiline:
480
+
"""
481
+
Test node|/admin/tool/dataprivacy/summary.php
482
+
"""
483
+
And I click on "Save changes""button"
484
+
When I am on site homepage
485
+
Then the "class" attribute of ".primary-navigation [data-key='home'] a""css_element" should contain "active"
486
+
And the "class" attribute of ".primary-navigation .nav-item:nth-child(5) a""css_element" should not contain "active"
487
+
And "//a[@aria-current = 'true']""xpath" should exist in the ".primary-navigation [data-key='home']""css_element"
488
+
And "//a[@aria-current = 'true']""xpath" should not exist in the ".primary-navigation .nav-item:nth-child(5)""css_element"
489
+
And I click on "Test node""link" in the ".primary-navigation""css_element"
490
+
Then the "class" attribute of ".primary-navigation [data-key='home'] a""css_element" should not contain "active"
491
+
And the "class" attribute of ".primary-navigation .nav-item:nth-child(5) a""css_element" should contain "active"
492
+
And "//a[@aria-current = 'true']""xpath" should not exist in the ".primary-navigation [data-key='home']""css_element"
493
+
And "//a[@aria-current = 'true']""xpath" should exist in the ".primary-navigation .nav-item:nth-child(5)""css_element"
0 commit comments