/**
  * Constructor
  *
  * @param null|string $name
  * @param array $data
  * @param string $dataName
  * @param array $browser
  * @return void
  */
 function __construct($name = NULL, array $data = array(), $dataName = '', array $browser = array())
 {
     parent::__construct($name, $data, $dataName, $browser);
     if (defined('CC_SELENIUM_OPT_CaptureScreenshotOnFailure')) {
         $this->captureScreenshotOnFailure = CC_SELENIUM_OPT_CaptureScreenshotOnFailure;
         $this->screenshotPath = CC_SELENIUM_OPT_ScreenshotPath;
         $this->screenshotUrl = CC_SELENIUM_OPT_ScreenshotUrl;
     }
     $this->setBrowser("*firefox");
     $this->setBrowserUrl(CC_SELENIUM_OPT_URL);
 }
Beispiel #2
0
 public function __construct($name = NULL, array $data = array(), $dataName = '', array $browser = array())
 {
     $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
     $seleniumConfig = $this->bootstrap->getOption('selenium');
     $browser['host'] = $seleniumConfig['host'];
     $browser['port'] = (int) $seleniumConfig['port'];
     $browser['timeout'] = (int) $seleniumConfig['timeout'];
     parent::__construct($name, $data, $dataName);
     $this->setupSpecificBrowser($browser);
     return $this;
 }
 public function __construct($name = NULL, array $data = array(), $dataName = '', array $browser = array())
 {
     $this->testId = md5(uniqid(rand(), TRUE));
     if (Kwf_Registry::get('config')->server->testBrowser) {
         $browsers = Kwf_Registry::get('config')->server->testBrowser->toArray();
         if (count($browsers) != 1) {
             throw new Kwf_Exception("only a single browser is supported");
         }
         $browser = reset($browsers);
         $browser = array('host' => $browser['host'], 'port' => (int) $browser['port'], 'browser' => $browser['browser']);
     }
     parent::__construct($name, $data, $dataName, $browser);
 }
 /**
  *  Constructor.
  *
  *  Because we are overriding the parent class constructor, we
  *  need to show the same arguments as exist in the constructor of
  *  PHPUnit_Framework_TestCase, since
  *  PHPUnit_Framework_TestSuite::createTest() creates a
  *  ReflectionClass of the Test class and checks the constructor
  *  of that class to decide how to set up the test.
  *
  * @param string $name
  * @param array $data
  * @param string $dataName
  * @param array $browser
  */
 public function __construct($name = NULL, array $data = array(), $dataName = '', array $browser = array())
 {
     parent::__construct($name, $data, $dataName, $browser);
     $this->loggedInAs = NULL;
     $this->settings = new CiviSeleniumSettings();
     if (property_exists($this->settings, 'serverStartupTimeOut') && $this->settings->serverStartupTimeOut) {
         global $CiviSeleniumTestCase_polled;
         if (!$CiviSeleniumTestCase_polled) {
             $CiviSeleniumTestCase_polled = TRUE;
             CRM_Utils_Network::waitForServiceStartup($this->drivers[0]->getHost(), $this->drivers[0]->getPort(), $this->settings->serverStartupTimeOut);
         }
     }
     // autoload
     require_once 'CRM/Core/ClassLoader.php';
     CRM_Core_ClassLoader::singleton()->register();
     // also initialize a connection to the db
     // FIXME: not necessary for most tests, consider moving into functions that need this
     $config = CRM_Core_Config::singleton();
 }
Beispiel #5
0
 public function __construct($name = null, array $data = array(), $data_name = '')
 {
     parent::__construct($name, $data, $data_name);
     $this->config = new TestConfig($this, dirname(__FILE__) . '/config.php');
 }
 public function __construct($name = NULL, array $data = array(), $dataName = '', array $browser = array())
 {
     parent::__construct($name, $data, $dataName, $browser);
     $this->scenario = new PHPUnit_Extensions_Story_Scenario($this);
 }
Beispiel #7
0
 public function __construct($name = NULL, array $data = array(), $dataName = '', array $browser = array()) {
   parent::__construct($name, $data, $dataName, $browser);
   $this->fixtureLoader = new OBM_FixtureLoader();
   $this->dataset = new OBM_Database_CsvDataSet(';');
 }
 /**
  * Constructor
  *
  * @param   string  $name 
  * @param   array   $data 
  * @param   string  $dataName 
  */
 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     $this->CI =& get_instance();
     log_message('debug', get_class($this) . ' WetbTest initialized');
 }
 /**
  * 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 (PHPUnit ONLY) (by default = array())
  * @param  string $dataName Name of Data set (PHPUnit ONLY) (by default = '')
  * @param  array  $browser Array of browser configuration settings: 'name', 'browser', 'host', 'port', 'timeout',
  * 'httpTimeout' (by default = array())
  *
  * @throws InvalidArgumentException
  */
 public function __construct($name = null, array $data = array(), $dataName = '', array $browser = array())
 {
     $this->_testConfig = Mage_Selenium_TestConfiguration::initInstance();
     $this->_dataHelper = $this->_testConfig->getDataHelper();
     $this->_dataGenerator = $this->_testConfig->getDataGenerator();
     $this->_applicationHelper = $this->_testConfig->getApplicationHelper();
     $this->_pageHelper = $this->_testConfig->getPageHelper($this, $this->_applicationHelper);
     $this->_uimapHelper = $this->_testConfig->getUimapHelper();
     if ($name !== null) {
         $this->name = $name;
     }
     $this->data = $data;
     $this->dataName = $dataName;
     $path = 'browsers/default/browserTimeoutPeriod';
     $this->_browserTimeoutPeriod = !is_bool($this->_testConfig->getConfigValue($path)) ? $this->_testConfig->getConfigValue($path) : $this->_browserTimeoutPeriod;
     parent::__construct($name, $data, $dataName, $browser);
 }
Beispiel #10
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();
 }
 public function __construct($name = null, array $data = array(), $data_name = '')
 {
     parent::__construct($name, $data, $data_name);
     $this->config = $this->getConfig();
 }
 function __construct($name)
 {
     parent::__construct($name);
     $this->configure();
 }
Beispiel #13
0
 /**
  * Constructor
  *
  * @access public
  * @see    ____func_see____
  * @since  1.0.0
  */
 public function __construct($name = NULL, array $data = array(), $dataName = '', array $browser = array())
 {
     $this->browserName = isset($browser['name']) ? $browser['name'] : 'unknown';
     /*
     $this->coverageScriptUrl = defined('SELENIUM_COVERAGE_URL')
         ? SELENIUM_COVERAGE_URL . '/phpunit_coverage.php'
         : SELENIUM_SOURCE_URL . '/phpunit_coverage.php';
     */
     if (defined('SELENIUM_SCREENSHOTS_PATH') && defined('SELENIUM_SCREENSHOTS_URL')) {
         $this->captureScreenshotOnFailure = true;
         $this->screenshotPath = SELENIUM_SCREENSHOTS_PATH;
         $this->screenshotUrl = SELENIUM_SCREENSHOTS_URL;
     }
     if (defined('W3C_VALIDATION')) {
         $this->validatePage = true;
     }
     parent::__construct($name, $data, $dataName, $browser);
     $this->testConfig = $this->getTestConfigOptions();
 }
Beispiel #14
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'];
 }
 /**
  * @param  string $name
  * @param  array  $data
  * @param  string $dataName
  * @param  array  $browser
  * @throws InvalidArgumentException
  */
 public final function __construct($name = NULL, array $data = array(), $dataName = '', array $browser = array())
 {
     parent::__construct($name, $data, $dataName, $browser);
     $this->init();
     $this->loadSeleneseFiles();
     // $this->verifySetup();
     // SpecialCentralNoticeTestCase::$seleneseDirectory = $this->unitTestBasePath . '/selenium/selenese';
 }