MDL-75081 behat: define new heading named selector.

Co-authored-by: Jun Pataleta <[email protected]>
This commit is contained in:
Paul Holden
2024-02-06 17:06:50 +00:00
co-authored by Jun Pataleta
parent 3932499ea6
commit 437738f488
3 changed files with 8 additions and 3 deletions
+3 -3
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 "You're not enrolled in any course"
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
@@ -108,6 +108,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',
@@ -232,6 +233,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'))]
+1
View File
@@ -4,6 +4,7 @@ information provided here is intended especially for developers.
=== 4.3.3 ===
* The `html_writer::select_time` method has a `$timezone` parameter to use when formatting the time parameter
* New Behat `heading` named selector to more easily assert the presence of H1-H6 elements on the page
=== 4.3.2 ===