芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/cepali/lib/behat/classes/partial_named_selector.php
. /** * Moodle-specific selectors. * * @package core * @category test * @copyright 2013 David Monllaó * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** * Moodle selectors manager. * * @package core * @category test * @copyright 2013 David Monllaó * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class behat_partial_named_selector extends \Behat\Mink\Selector\PartialNamedSelector { // Use the named selector trait. use behat_named_selector; /** * Creates selector instance. */ public function __construct() { foreach (self::$customselectors as $alias => $selectors) { $this->registerNamedXpath($alias, implode(' | ', $selectors)); } foreach (static::$moodleselectors as $name => $xpath) { $this->registerNamedXpath($name, $xpath); } foreach (self::$customreplacements as $from => $tos) { $this->registerReplacement($from, implode(' or ', $tos)); } $this->registerReplacement('%iconMatch%', "(contains(concat(' ', @class, ' '), ' icon ') or name() = 'img')"); $this->registerReplacement('%imgAltMatch%', './/*[%iconMatch% and (%altMatch% or %titleMatch%)]'); parent::__construct(); } /** * @var array Allowed types when using text selectors arguments. */ protected static $allowedtextselectors = array( 'activity' => 'activity', 'block' => 'block', 'css_element' => 'css_element', 'dialogue' => 'dialogue', 'fieldset' => 'fieldset', 'icon' => 'icon', 'list_item' => 'list_item', 'question' => 'question', 'region' => 'region', 'section' => 'section', 'table' => 'table', 'table_row' => 'table_row', 'xpath_element' => 'xpath_element', 'form_row' => 'form_row', 'group_message_header' => 'group_message_header', 'group_message' => 'group_message', 'autocomplete' => 'autocomplete', ); /** * @var array Allowed types when using selector arguments. */ protected static $allowedselectors = array( 'activity' => 'activity', 'block' => 'block', 'button' => 'button', 'checkbox' => 'checkbox', 'css_element' => 'css_element', 'dialogue' => 'dialogue', 'field' => 'field', 'fieldset' => 'fieldset', 'file' => 'file', 'filemanager' => 'filemanager', 'group_message' => 'group_message', 'group_message_conversation' => 'group_message_conversation', 'group_message_header' => 'group_message_header', 'group_message_member' => 'group_message_member', 'group_message_tab' => 'group_message_tab', 'group_message_list_area' => 'group_message_list_area', 'group_message_message_content' => 'group_message_message_content', 'icon_container' => 'icon_container', 'icon' => 'icon', 'link' => 'link', 'link_or_button' => 'link_or_button', 'list_item' => 'list_item', 'optgroup' => 'optgroup', 'option' => 'option', 'question' => 'question', 'radio' => 'radio', 'region' => 'region', 'section' => 'section', 'select' => 'select', 'table' => 'table', 'table_row' => 'table_row', 'text' => 'text', 'xpath_element' => 'xpath_element', 'form_row' => 'form_row', 'autocomplete_selection' => 'autocomplete_selection', 'autocomplete_suggestions' => 'autocomplete_suggestions', 'autocomplete' => 'autocomplete', ); /** * Behat by default comes with XPath, CSS and named selectors, * named selectors are a mapping between names (like button) and * xpaths that represents that names and includes a placeholder that * will be replaced by the locator. These are Moodle's own xpaths. * * @var array XPaths for moodle elements. */ protected static $moodleselectors = array( 'activity' => <<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
<<
[ 'upstream' => <<
<<
<<
[ 'upstream' => '%idOrNameMatch% or %valueMatch% or %titleMatch%', 'aria' => '%ariaLabelMatch%', ], '%ariaLabelMatch%' => [ 'moodle' => 'contains(./@aria-label, %locator%)', ], ]; /** @var List of deprecated selectors */ protected static $deprecatedselectors = [ 'group_message' => 'core_message > Message', 'group_message_member' => 'core_message > Message member', 'group_message_tab' => 'core_message > Message tab', 'group_message_list_area' => 'core_message > Message list area', 'group_message_message_content' => 'core_message > Message content', ]; /** * Allowed selectors getter. * * @return array */ public static function get_allowed_selectors() { return static::$allowedselectors; } /** * Allowed text selectors getter. * * @return array */ public static function get_allowed_text_selectors() { return static::$allowedtextselectors; } }