/** * 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']; }