mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-66550 behat: Add ability to transform a specific selector
This commit is contained in:
parent
700682dc40
commit
b983ae4ab8
@ -197,6 +197,18 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
|
||||
* @return array The selector, locator, and container to search within
|
||||
*/
|
||||
public function normalise_selector(string $selector, $locator, Element $container): array {
|
||||
// Check for specific transformations for this selector type.
|
||||
$transformfunction = "transform_find_for_{$selector}";
|
||||
if (method_exists('behat_selectors', $transformfunction)) {
|
||||
// A selector-specific transformation exists.
|
||||
// Perform initial transformation of the selector within the current container.
|
||||
[
|
||||
'selector' => $selector,
|
||||
'locator' => $locator,
|
||||
'container' => $container,
|
||||
] = behat_selectors::{$transformfunction}($this, $locator, $container);
|
||||
}
|
||||
|
||||
// Normalise the css and xpath selector types.
|
||||
if ('css_element' === $selector) {
|
||||
$selector = 'css';
|
||||
|
Loading…
x
Reference in New Issue
Block a user