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 0ffc737a4..c18b7c0d9 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php @@ -383,7 +383,7 @@ class CmsUiContext extends BehatContext { assertNotNull($controls, 'Preview controls not found'); $label = $controls->find('xpath', sprintf( - './/label[(@for="%s")]', + './/*[count(*)=0 and contains(text(), \'%s\')]', $mode )); assertNotNull($label, 'Preview mode switch not found');