From df2d59df1c293cd968c5de22cc28dceb0becd802 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 30 Nov 2013 13:27:20 +0100 Subject: [PATCH] Use more solid getValue() in Behat assertions getAttribute('value') behaves inconsistently with Selenium drivers (fails on Travis and TeamCity, but works locally). Selenium2Driver in Mink provides a JS wrapper for getting the value, which is more reliable. This fixes "insert a link" failures, see https://travis-ci.org/silverstripe/silverstripe-cms/jobs/14281251 --- .../SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e6cccdf27..274f6aad6 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php @@ -92,7 +92,7 @@ class CmsFormsContext extends BehatContext { $element = $page->findField($locator); assertNotNull($element, sprintf('HTML field "%s" not found', $locator)); - $actual = $element->getAttribute('value'); + $actual = $element->getValue(); $regex = '/'.preg_quote($html, '/').'/ui'; if (!preg_match($regex, $actual)) { $message = sprintf(