From 924664527b14d9e50bc313363192b931199790b8 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 7 Jun 2013 15:46:05 +0200 Subject: [PATCH] Less assumptions in "HTML field contains" step Not using the loose idea of a "field name" in the NamedSelector sense of the word as "field with id exists". --- .../Framework/Test/Behaviour/CmsFormsContext.php | 6 +++++- 1 file changed, 5 insertions(+), 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 1907a4b8d..8183a7948 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php @@ -96,7 +96,11 @@ class CmsFormsContext extends BehatContext $inputField = $page->findField($field); assertNotNull($inputField, sprintf('HTML field "%s" not found', $field)); - $this->getMainContext()->assertElementContains('#' . $inputField->getAttribute('id'), $value); + $this->getMainContext()->assertSession()->elementContains( + 'named', + $field, + str_replace('\\"', '"', $value) // emulates fixStepArgument() + ); } /**