diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 7820fa9..c532214 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -1749,12 +1749,19 @@ protected function drupalProcessAjaxResponse($content, array $ajax_response, arr $wrapperNode = NULL; // When a command doesn't specify a selector, use #ajax['wrapper_selector']. if (!isset($command['selector'])) { - $command['selector'] = $ajax_settings['wrapper_selector']; + $selector_type = substr($ajax_settings['wrapper_selector'], 0, 1); + $selector = substr($ajax_settings['wrapper_selector'], 1); + if ($selector_type === '#') { + $wrapperNode = $xpath->query('//*[@id="' . $selector . '"]')->item(0); + } + else { + $wrapperNode = $xpath->query('//*[@class="' . $selector . '"]')->item(0); + } } // @todo Ajax commands can target any jQuery selector, but these are // hard to fully emulate with XPath. For now, just handle 'head' // and 'body', since these are used by the Ajax renderer. - if (in_array($command['selector'], array('head', 'body'))) { + elseif (in_array($command['selector'], array('head', 'body'))) { $wrapperNode = $xpath->query('//' . $command['selector'])->item(0); } if ($wrapperNode) {