From 5a7d25e530e62cec7f8656d68819efd1cecc8d87 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 13 Feb 2014 18:08:28 +1300 Subject: [PATCH] FIX: Use executeScript() because we discard the return value. evaluateScript() injects 'return ' into the executed script, which often breaks multi-line code. executeScript() is better --- src/SilverStripe/BehatExtension/Context/BasicContext.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SilverStripe/BehatExtension/Context/BasicContext.php b/src/SilverStripe/BehatExtension/Context/BasicContext.php index 6fc55b5..0f8d35e 100644 --- a/src/SilverStripe/BehatExtension/Context/BasicContext.php +++ b/src/SilverStripe/BehatExtension/Context/BasicContext.php @@ -386,7 +386,8 @@ if(input.closest('.ss-uploadfield-item-info').length) { while(!input.parent().is('.ss-uploadfield-item-info')) input = input.unwrap(); } JS; - $this->getSession()->evaluateScript($js); + + $this->getSession()->executeScript($js); $this->getSession()->wait(1000); return new Step\Given(sprintf('I attach the file "%s" to "%s"', $path, $field));