From 8cf38720b5de1133c676a12d3f878b8c2a74d418 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 20 Apr 2016 13:52:51 +1200 Subject: [PATCH] Fix Chosen.js selector for Behat feature The recent upgrade to Chosen.js 1.5 changes the generated markup: It still renders an tag, but without the "href" attribute. This attribute isn't actually required to uniquely identify the link in this structure. --- .../SilverStripe/Framework/Test/Behaviour/CmsUiContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php index d942e1da3..5ab8a9b8e 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php @@ -490,7 +490,7 @@ class CmsUiContext extends BehatContext { assertNotNull($container, 'Chosen.js field container not found'); // Click on newly expanded list element, indirectly setting the dropdown value - $linkEl = $container->find('xpath', './/a[./@href]'); + $linkEl = $container->find('xpath', './/a'); assertNotNull($linkEl, 'Chosen.js link element not found'); $this->getSession()->wait(100); // wait for dropdown overlay to appear $linkEl->click();