Skip to content
Browse files

MDL-44837 Behat: 'dialogue' selector only works for confirm dialogues

The dialogue selector in Behat (used only in one place) didn't work for
other types of standard Moodle notification dialogue.
  • Loading branch information...
1 parent 18b388e commit d0434cb119c4a464a5f7103d6cc5cddee8b57bdd @sammarshallou sammarshallou committed Mar 27, 2014
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/behat/classes/behat_selectors.php
View
7 lib/behat/classes/behat_selectors.php
@@ -83,7 +83,12 @@ class behat_selectors {
*/
protected static $moodleselectors = array(
'dialogue' => <<<XPATH
-//div[contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue ')]/descendant::h1[normalize-space(.) = %locator%]/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue ')] | //div[contains(concat(' ', normalize-space(@class), ' '), ' yui-dialog ')]/descendant::div[@class='hd'][normalize-space(.) = %locator%]/parent::div
+//div[contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue ') and
+ normalize-space(descendant::div[
+ contains(concat(' ', normalize-space(@class), ' '), ' moodle-dialogue-hd ')
+ ]) = %locator%] |
+//div[contains(concat(' ', normalize-space(@class), ' '), ' yui-dialog ') and
+ normalize-space(descendant::div[@class='hd']) = %locator%]
XPATH
, 'block' => <<<XPATH
//div[contains(concat(' ', normalize-space(@class), ' '), concat(' ', %locator%, ' '))] | //div[contains(concat(' ', normalize-space(@class), ' '), ' block ')]/descendant::h2[normalize-space(.) = %locator%]/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' block ')]

0 comments on commit d0434cb

Please sign in to comment.
Something went wrong with that request. Please try again.