/** * Get all test helper class names * @return array */ public function getTestHelperClassNames() { if (!empty($this->_testHelperClassNames)) { return $this->_testHelperClassNames; } //Get initial path to test helpers $frameworkConfig = $this->_configHelper->getConfigFramework(); $initialPath = SELENIUM_TESTS_BASEDIR . DIRECTORY_SEPARATOR . $frameworkConfig['testsuite_base_path']; //Get test helpers sequence $fallbackOrderHelper = $this->_configHelper->getHelpersFallbackOrder(); $facade = new File_Iterator_Facade(); foreach ($fallbackOrderHelper as $codePoolName) { $projectPath = $initialPath . DIRECTORY_SEPARATOR . $codePoolName; if (!is_dir($projectPath)) { continue; } $files = $facade->getFilesAsArray($projectPath, 'Helper.php'); foreach ($files as $file) { $className = str_replace($initialPath . DIRECTORY_SEPARATOR, '', $file); $className = str_replace(DIRECTORY_SEPARATOR, '_', str_replace('.php', '', $className)); $array = explode('_', str_replace('_Helper', '', $className)); $helperName = end($array); $this->_testHelperClassNames[$helperName] = $className; } } return $this->_testHelperClassNames; }
/** * Constructs a test case with the given name and browser to test execution * * @param string $name Test case name(by default = null) * @param array $data Test case data array(by default = array()) * @param string $dataName Name of Data set(by default = '') */ public function __construct($name = null, array $data = array(), $dataName = '') { $this->_testConfig = Mage_Selenium_TestConfiguration::getInstance(); $this->_configHelper = $this->_testConfig->getHelper('config'); $this->_uimapHelper = $this->_testConfig->getHelper('uimap'); $this->_dataHelper = $this->_testConfig->getHelper('data'); $this->_paramsHelper = $this->_testConfig->getHelper('params'); $this->_dataGeneratorHelper = $this->_testConfig->getHelper('dataGenerator'); $this->frameworkConfig = $this->_configHelper->getConfigFramework(); parent::__construct($name, $data, $dataName); $this->captureScreenshotOnFailure = $this->frameworkConfig['captureScreenshotOnFailure']; $this->_saveHtmlPageOnFailure = $this->frameworkConfig['saveHtmlPageOnFailure']; $this->coverageScriptUrl = $this->frameworkConfig['coverageScriptUrl']; $this->screenshotPath = $this->screenshotUrl = $this->getDefaultScreenshotPath(); }
/** * Constructs a test case with the given name and browser to test execution * * @param string $name Test case name(by default = null) * @param array $data Test case data array(by default = array()) * @param string $dataName Name of Data set(by default = '') * @param array $browser Array of browser configuration settings: 'name', 'browser', 'host', 'port', 'timeout', * 'httpTimeout' (by default = array()) */ public function __construct($name = null, array $data = array(), $dataName = '', array $browser = array()) { $this->_testConfig = Mage_Selenium_TestConfiguration::getInstance(); $this->_configHelper = $this->_testConfig->getHelper('config'); $this->_uimapHelper = $this->_testConfig->getHelper('uimap'); $this->_dataHelper = $this->_testConfig->getHelper('data'); $this->_paramsHelper = $this->_testConfig->getHelper('params'); $this->_dataGeneratorHelper = $this->_testConfig->getHelper('dataGenerator'); parent::__construct($name, $data, $dataName, $browser); if (isset($browser['timeout'])) { $this->_browserTimeoutPeriod = $browser['timeout'] * 1000; } $config = $this->_configHelper->getConfigFramework(); $this->captureScreenshotOnFailure = $config['captureScreenshotOnFailure']; $this->screenshotPath = $this->screenshotUrl = $this->_configHelper->getScreenshotDir(); $this->_saveHtmlPageOnFailure = $config['saveHtmlPageOnFailure']; $this->coverageScriptUrl = $config['coverageScriptUrl']; }