Skip to content

Commit b771744

Browse files
committed
Upgrade: Fix Behat test which tests the activity icon branding feature after the activity chooser restructurings on 5.1.
1 parent d843521 commit b771744

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Changes
66

77
### Unreleased
88

9+
* 2025-10-26 - Upgrade: Fix Behat test which tests the activity icon branding feature after the activity chooser restructurings on 5.1.
910
* 2025-10-26 - Upgrade: Verify the built-in SCSS snippets on 5.1.
1011
* 2025-10-26 - Upgrade: Remove the timelinetintenabled and upcomingeventstintenabled settings from Boost Union as the timeline block and the upcoming events blocks have colored icons from Moodle 5.1 on
1112
* 2025-10-26 - Upgrade: Adopt changes to settings.php from MDL-80556

tests/behat/theme_boost_union_flavourssettings_look.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,9 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi
479479
And I click on "Add content" "button" in the "New section" "section"
480480
And I click on "Activity or resource" "button" in the "New section" "section"
481481
# First, we test that the default filter is _not_ set anymore.
482-
Then DOM element ".chooser-container .activityiconcontainer.modicon_<modname> img" should not have a CSS filter close to hex color "<originalhex>"
482+
Then DOM element "[data-region=chooser-container] [data-internal=<modname>] .activityiconcontainer img" should not have a CSS filter close to hex color "<originalhex>"
483483
# And then we test if the applied filter is close enough to the hex color.
484-
And DOM element ".chooser-container .activityiconcontainer.modicon_<modname> img" should have a CSS filter close enough to hex color "<colorhex>"
484+
And DOM element "[data-region=chooser-container] [data-internal=<modname>] .activityiconcontainer img" should have a CSS filter close enough to hex color "<colorhex>"
485485

486486
# Unfortunately, we can only test 5 out of 7 purpose types as Moodle does does not ship with any activity with the
487487
# administration and interface types. But this should be an acceptable test coverage anyway.
@@ -517,9 +517,9 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi
517517
And I click on "Add content" "button" in the "New section" "section"
518518
And I click on "Activity or resource" "button" in the "New section" "section"
519519
# First, we test that the default filter is _not_ set anymore.
520-
Then DOM element ".chooser-container .activityiconcontainer.modicon_<modname> img" should not have a CSS filter close to hex color "<originalhex>"
520+
Then DOM element "[data-region=chooser-container] [data-internal=<modname>] .activityiconcontainer img" should not have a CSS filter close to hex color "<originalhex>"
521521
# And then we test if the applied filter is close enough to the hex color.
522-
And DOM element ".chooser-container .activityiconcontainer.modicon_<modname> img" should have a CSS filter close enough to hex color "<colorhex>"
522+
And DOM element "[data-region=chooser-container] [data-internal=<modname>] .activityiconcontainer img" should have a CSS filter close enough to hex color "<colorhex>"
523523

524524
# We only test 1 out of 6 purpose types as we have tested the rest already in the previous scenario.
525525
Examples:
@@ -548,9 +548,9 @@ Feature: Configuring the theme_boost_union plugin on the "Flavours" page, applyi
548548
And I click on "Add content" "button" in the "New section" "section"
549549
And I click on "Activity or resource" "button" in the "New section" "section"
550550
# First, we test that the default filter is _not_ set anymore.
551-
Then DOM element ".chooser-container .activityiconcontainer.modicon_<modname> img" should not have a CSS filter close to hex color "<originalhex>"
551+
Then DOM element "[data-region=chooser-container] [data-internal=<modname>] .activityiconcontainer img" should not have a CSS filter close to hex color "<originalhex>"
552552
# And then we test if the applied filter is close enough to the hex color.
553-
And DOM element ".chooser-container .activityiconcontainer.modicon_<modname> img" should have a CSS filter close enough to hex color "<colorhex>"
553+
And DOM element "[data-region=chooser-container] [data-internal=<modname>] .activityiconcontainer img" should have a CSS filter close enough to hex color "<colorhex>"
554554

555555
# We only test 1 out of 6 purpose types as we have tested the rest already in the previous scenario.
556556
Examples:

tests/behat/theme_boost_union_looksettings_activitybranding.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Feature: Configuring the theme_boost_union plugin for the "Activity branding" ta
2121
And I click on "Add content" "button" in the "New section" "section"
2222
And I click on "Activity or resource" "button" in the "New section" "section"
2323
# First, we test that the default filter is _not_ set anymore.
24-
Then DOM element ".chooser-container .activityiconcontainer.modicon_<modname> img" should not have a CSS filter close to hex color "<originalhex>"
24+
Then DOM element "[data-region=chooser-container] [data-internal=<modname>] .activityiconcontainer img" should not have a CSS filter close to hex color "<originalhex>"
2525
# And then we test if the applied filter is close enough to the hex color.
26-
And DOM element ".chooser-container .activityiconcontainer.modicon_<modname> img" should have a CSS filter close enough to hex color "<colorhex>"
26+
And DOM element "[data-region=chooser-container] [data-internal=<modname>] .activityiconcontainer img" should have a CSS filter close enough to hex color "<colorhex>"
2727

2828
# Unfortunately, we can only test 5 out of 7 purpose types as Moodle does does not ship with any activity with the
2929
# administration and interface types. But this should be an acceptable test coverage anyway.
@@ -77,7 +77,7 @@ Feature: Configuring the theme_boost_union plugin for the "Activity branding" ta
7777
Then DOM element ".activity.modtype_<mod> .activityiconcontainer.courseicon img" should have a CSS filter close enough to hex color "<colorhex>"
7878
And I click on "Add content" "button" in the "New section" "section"
7979
And I click on "Activity or resource" "button" in the "New section" "section"
80-
Then DOM element ".chooser-container .activityiconcontainer.modicon_<mod> img" should have a CSS filter close enough to hex color "<colorhex>"
80+
Then DOM element "[data-region=chooser-container] [data-internal=<mod>] .activityiconcontainer img" should have a CSS filter close enough to hex color "<colorhex>"
8181
And I am on the "Test name" "<mod> activity" page
8282
Then DOM element "#page-header .modicon_<mod>.activityiconcontainer img" should have a CSS filter close enough to hex color "<colorhex>"
8383
And I am on the "Course 1" "course > activities" page
@@ -107,7 +107,7 @@ Feature: Configuring the theme_boost_union plugin for the "Activity branding" ta
107107
Then DOM element ".activity.modtype_assign .activityiconcontainer.courseicon img" should have computed style "filter" "none"
108108
And I click on "Add content" "button" in the "New section" "section"
109109
And I click on "Activity or resource" "button" in the "New section" "section"
110-
Then DOM element ".chooser-container .activityiconcontainer.modicon_assign img" should have computed style "filter" "none"
110+
Then DOM element "[data-region=chooser-container] [data-internal=assign] .activityiconcontainer img" should have computed style "filter" "none"
111111
And I am on the "Test name" "assign activity" page
112112
Then DOM element "#page-header .modicon_assign.activityiconcontainer img" should have computed style "filter" "none"
113113
And I am on the "Course 1" "course > activities" page

0 commit comments

Comments
 (0)