mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 19:36:41 +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',
|
'table' => 'table',
|
||||||
'field' => 'field',
|
'field' => 'field',
|
||||||
'fieldset' => 'fieldset',
|
'fieldset' => 'fieldset',
|
||||||
|
'text' => 'text',
|
||||||
'css_element' => 'css_element',
|
'css_element' => 'css_element',
|
||||||
'xpath_element' => 'xpath_element'
|
'xpath_element' => 'xpath_element'
|
||||||
);
|
);
|
||||||
|
@ -83,7 +84,10 @@ class behat_selectors {
|
||||||
* @var XPaths for moodle elements.
|
* @var XPaths for moodle elements.
|
||||||
*/
|
*/
|
||||||
protected static $moodleselectors = array(
|
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
|
//div[contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue ') and
|
||||||
normalize-space(descendant::div[
|
normalize-space(descendant::div[
|
||||||
contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue-hd ')
|
contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue-hd ')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue