mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-45165 behat: Adding text selector
Same behaviour than I should see step, it looks for the text in the node + descendants, but, to get the lower level match discards the nodes with children that also contains the same text.
This commit is contained in:
parent
6dac47a69c
commit
689451731c
1 changed files with 5 additions and 1 deletions
|
@ -70,6 +70,7 @@ class behat_selectors {
|
|||
'table' => 'table',
|
||||
'field' => 'field',
|
||||
'fieldset' => 'fieldset',
|
||||
'text' => 'text',
|
||||
'css_element' => 'css_element',
|
||||
'xpath_element' => 'xpath_element'
|
||||
);
|
||||
|
@ -83,7 +84,10 @@ class behat_selectors {
|
|||
* @var XPaths for moodle elements.
|
||||
*/
|
||||
protected static $moodleselectors = array(
|
||||
'dialogue' => <<<XPATH
|
||||
'text' => <<<XPATH
|
||||
//*[contains(., %locator%)][count(./descendant::*[contains(., %locator%)]) = 0]
|
||||
XPATH
|
||||
, 'dialogue' => <<<XPATH
|
||||
//div[contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue ') and
|
||||
normalize-space(descendant::div[
|
||||
contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue-hd ')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue