From 86d8139f1b1da94614d771951dda8ef3293f56fd Mon Sep 17 00:00:00 2001 From: Jeffrey Guo Date: Fri, 23 May 2014 11:16:50 +1200 Subject: [PATCH] find radiobutton by its type --- src/SilverStripe/BehatExtension/Context/BasicContext.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/SilverStripe/BehatExtension/Context/BasicContext.php b/src/SilverStripe/BehatExtension/Context/BasicContext.php index 9329b84..b9ea0d0 100644 --- a/src/SilverStripe/BehatExtension/Context/BasicContext.php +++ b/src/SilverStripe/BehatExtension/Context/BasicContext.php @@ -648,9 +648,10 @@ JS; */ public function iSelectTheRadioButton($radioLabel) { $session = $this->getSession(); - $radioButton = $session->getPage()->findField($radioLabel); + $radioButton = $session->getPage()->find('named', array( + 'radio', $this->getSession()->getSelectorsHandler()->xpathLiteral($radioLabel) + )); assertNotNull($radioButton); - assertEquals('radio', $radioButton->getAttribute('type')); $session->getDriver()->click($radioButton->getXPath()); }