diff --git a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php index 5ae293d9a..459c8ebb6 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php @@ -184,17 +184,24 @@ var editor = jQuery('#$inputFieldId').entwine('ss').getEditor(), sel = editor.getInstance().selection, rng = document.createRange(), matched = false; + jQuery(doc).find('body *').each(function() { - if(!matched && this.firstChild && this.firstChild.nodeValue && this.firstChild.nodeValue.match('$text')) { - rng.setStart(this.firstChild, this.firstChild.nodeValue.indexOf('$text')); - rng.setEnd(this.firstChild, this.firstChild.nodeValue.indexOf('$text') + '$text'.length); - sel.setRng(rng); - editor.getInstance().nodeChanged(); - matched = true; + if(!matched) { + for(var i=0;igetSession()->evaluateScript($js); + + $this->getSession()->executeScript($js); } /**