/** * Helper method that returns the content block of a page * @param Page $parent * @return \Behat\Mink\Element\NodeElement * @throws \Exception */ public static function getContentBlock(Page $parent) { $contentBlocks = ['emotion' => 'div#content > div.inner', 'responsive' => 'div.content-main--inner']; foreach ($contentBlocks as $locator) { $block = $parent->find('css', $locator); if ($block) { return $block; } } self::throwException('No content block found!'); }
/** * Helper function to get the current language ('de' or 'en') * @param Page $page * @return string */ public static function getCurrentLanguage(Page $page) { $shop = null; $meta = $page->find('css', 'meta[name=application-name]'); $shop = $meta->getAttribute('content'); if ($shop === 'English') { return 'en'; } return 'de'; }