MDL-75081 behat: define new heading named selector.

Co-authored-by: Jun Pataleta <jun@moodle.com>
This commit is contained in:
Paul Holden 2024-02-06 16:56:25 +00:00 committed by Jun Pataleta
parent 3a8a8c8463
commit e36e40f530
No known key found for this signature in database
GPG Key ID: F83510526D99E2C7
3 changed files with 10 additions and 4 deletions

View File

@ -27,8 +27,8 @@ Feature: Confirm that we can open multiple browser tabs
# Switch between all the tabs and confirm their different contents.
Then I should see "No courses"
And I switch to "CourseViewer2" tab
And I should see "Course 3" in the "h1" "css_element"
And "Course 3" "heading" should exist
And I switch to "CourseViewer1" tab
And I should see "Course 2" in the "h1" "css_element"
And "Course 2" "heading" should exist
And I switch to the main tab
And I should see "Course 1" in the "h1" "css_element"
And "Course 1" "heading" should exist

View File

@ -104,6 +104,7 @@ class behat_partial_named_selector extends \Behat\Mink\Selector\PartialNamedSele
'group_message_tab' => 'group_message_tab',
'group_message_list_area' => 'group_message_list_area',
'group_message_message_content' => 'group_message_message_content',
'heading' => 'heading',
'icon_container' => 'icon_container',
'icon' => 'icon',
'link' => 'link',
@ -205,6 +206,9 @@ XPATH
XPATH
, 'group_message_message_content' => <<<XPATH
.//*[@data-region='message-drawer']//*[@data-region='message' and @data-message-id and contains(., %locator%)]
XPATH
, 'heading' => <<<XPATH
.//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6][contains(normalize-space(.), %locator%)]
XPATH
, 'icon_container' => <<<XPATH
.//span[contains(@data-region, concat(%locator%,'-icon-container'))]

View File

@ -1,8 +1,10 @@
This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.
=== 4.1.8 ===
=== 4.1.9
* New Behat `heading` named selector to more easily assert the presence of H1-H6 elements on the page
=== 4.1.8 ===
* The current page language is available in new `core/config` language property for Javascript modules
=== 4.1.7 ===