/**
  * @covers Mage_Selenium_TestConfiguration::getConfigFixtures
  */
 public function testGetConfigFixtures()
 {
     $instance = Mage_Selenium_TestConfiguration::getInstance();
     $sameValue = $instance->getConfigFixtures();
     $this->assertEquals($sameValue, $instance->getConfigFixtures());
     $this->assertInternalType('array', $sameValue);
     $this->assertNotEmpty($sameValue);
     $this->assertInternalType('array', current($sameValue));
     $this->assertNotEmpty(current($sameValue));
 }
Beispiel #2
0
 /**
  * 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();
 }
Beispiel #3
0
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    tests
 * @package     selenium2
 * @subpackage  runner
 * @author      Magento Core Team <*****@*****.**>
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
require_once '../framework/bootstrap.php';
define('SELENIUM_TESTS_BASEDIR', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'selenium2');
//define('SELENIUM_TESTS_SCREENSHOTDIR',getenv('SELENIUM_TESTS_SCREENSHOTDIR'));
//define('SELENIUM_TESTS_SCREENSHOTURL',getenv('SELENIUM_TESTS_SCREENSHOTURL'));
set_include_path(implode(PATH_SEPARATOR, array(realpath(SELENIUM_TESTS_BASEDIR . DIRECTORY_SEPARATOR . 'framework'), realpath(SELENIUM_TESTS_BASEDIR . DIRECTORY_SEPARATOR . 'testsuite'), get_include_path())));
require_once 'Mage/Selenium/Autoloader.php';
Mage_Selenium_Autoloader::register();
require_once 'functions.php';
Mage_Selenium_TestConfiguration::getInstance();
Mage_Listener_EventListener::autoAttach(SELENIUM_TESTS_BASEDIR . implode(DIRECTORY_SEPARATOR, array('', 'framework', 'Mage', 'Listener', 'Observers', '*.php')));
 /**
  * @covers Mage_Selenium_TestConfiguration::getTestHelperClassNames
  */
 public function testGetTestHelperClassNames()
 {
     $instance = Mage_Selenium_TestConfiguration::getInstance();
     $helperClassNames = $instance->getTestHelperClassNames();
     $this->assertInternalType('array', $helperClassNames);
     $this->assertGreaterThan(0, count($helperClassNames));
     foreach ($helperClassNames as $name) {
         $this->assertContains('_Helper', $name);
     }
 }
Beispiel #5
0
 /**
  * Class constructor
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $this->_config = Mage_Selenium_TestConfiguration::getInstance();
 }
Beispiel #6
0
 /**
  * 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'];
 }