/** * Presses the requested named button * @param Page|Element|HelperSelectorInterface $parent * @param string $key */ public static function pressNamedButton(HelperSelectorInterface $parent, $key) { $locatorArray = $parent->getNamedSelectors(); if ($parent instanceof Page) { $parent = self::getContentBlock($parent); } $parent->pressButton($locatorArray[$key][self::$language]); }
/** * Presses the requested named button * @param Page|Element|HelperSelectorInterface $parent * @param string $key * @param string $language */ public static function pressNamedButton(HelperSelectorInterface $parent, $key, $language = '') { $locatorArray = $parent->getNamedSelectors(); if (empty($language)) { if ($parent instanceof Page) { $language = self::getCurrentLanguage($parent); } else { self::throwException('For elements the language has to be set!', self::EXCEPTION_PENDING); } } if ($parent instanceof Page) { $parent = self::getContentBlock($parent); } $parent->pressButton($locatorArray[$key][$language]); }