-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
2.7
-
MOODLE_27_STABLE
This issue is about overwriting the default behat named selectors (http://mink.behat.org/#named-selectors) which are using contains() rather than an equals comparison (https://github.com/Behat/Mink/blob/v1.5.0/src/Behat/Mink/Selector/NamedSelector.php#L20) which leads to misleading results when we can't point to the node we want to point and another one containing the text (+ other texts) that appears before in the DOM is selected rather than the one that matches exactly the same value.
I've created this issue following Tim's comment: https://tracker.moodle.org/browse/MDL-44534?focusedCommentId=276667&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-276667
Before changing something like the named selectors, that is part of the base of behat, I want to be completely sure that we are not missing something important as to me it makes a lot more sense to matches($asd) values rather than contains($asd).
The technical solution is not specially a problem as we can overwrite them (I haven't tried it, it is what it seems though) in lib/behat/classes/behat_selectors.php using $session->getSelectorsHandler()>getSelector('named')>registerNamedXpath($name, $xpath)
- duplicates
-
MDL-46891 Upgrade to behat 3.x
-
- Closed
-
- has a non-specific relationship to
-
MDL-44534 Problems with question behat tests
-
- Closed
-
- is duplicated by
-
MDL-44593 'I press "BUTTON_STRING"' step finds (and clicks) non-button links that contain the BUTTON_STRING
-
- Closed
-
- will help resolve
-
MDL-46664 Issues with behat tests for HTML block
-
- Closed
-