MDL-87443 behat: define new Toast message named selector.

This commit is contained in:
Paul Holden
2026-01-09 12:08:02 +00:00
parent 774796cf77
commit badca8a618
2 changed files with 11 additions and 0 deletions
@@ -0,0 +1,7 @@
issueNumber: MDL-87443
notes:
core:
- message: >-
There is a new Behat `toast_message` named selector to more easily
assert the presence of Toast messages on the page
type: improved
@@ -127,6 +127,7 @@ class behat_partial_named_selector extends \Behat\Mink\Selector\PartialNamedSele
'table' => 'table',
'table_row' => 'table_row',
'text' => 'text',
'toast_message' => 'toast_message',
'xpath_element' => 'xpath_element',
'form_row' => 'form_row',
'autocomplete_selection' => 'autocomplete_selection',
@@ -279,6 +280,9 @@ XPATH
XPATH
, 'text' => <<<XPATH
.//*[contains(., %locator%) and not(.//*[contains(., %locator%)])]
XPATH
, 'toast_message' => <<<XPATH
.//*[contains(concat(' ', normalize-space(@class), ' '), ' toast-message ') and %exactTagTextMatch%]
XPATH
, 'form_row' => <<<XPATH
.//*[contains(concat(' ', @class, ' '), ' col-form-label ')]