本文整理汇总了PHP中PHPUnit_Extensions_SeleniumTestCase::runTest方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Extensions_SeleniumTestCase::runTest方法的具体用法?PHP PHPUnit_Extensions_SeleniumTestCase::runTest怎么用?PHP PHPUnit_Extensions_SeleniumTestCase::runTest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Extensions_SeleniumTestCase
的用法示例。
在下文中一共展示了PHPUnit_Extensions_SeleniumTestCase::runTest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runTest
protected function runTest()
{
parent::runTest();
try {
$this->stop();
} catch (RuntimeException $e) {
}
}
示例2: runTest
/**
* Run this test's scenario.
*
* @return mixed
* @throws RuntimeException
*/
protected function runTest()
{
$autostop = $this->autoStop;
$this->autoStop = FALSE;
try {
$testResult = parent::runTest();
$this->scenario->run($this->world);
$this->autoStop = $autostop;
} catch (Exception $e) {
$this->autoStop = $autostop;
throw $e;
}
return $testResult;
}
示例3: runTest
/**
* Run test
*
* @return void
* @access protected
* @see ____func_see____
* @since 1.0.0
*/
protected function runTest()
{
try {
$shortName = lcfirst(substr($this->getName(), 4));
if (self::$testsRange && !in_array($shortName, self::$testsRange)) {
$this->markTestSkipped();
} elseif ($this->temporarySkipped) {
$this->markTestSkipped('Temporary skipped - fix test ASAP!');
} else {
parent::runTest();
}
} catch (\Exception $exception) {
if (isset($this->drivers[0]) && $this->drivers[0]->getSessionId()) {
try {
$location = preg_replace('/[^\\w]/Ss', '-', $this->getLocation());
$location = preg_replace('/-+/Ss', '-', $location);
$html = $this->getHtmlSource();
$trace = array();
if (!defined('DEPLOYMENT_TEST')) {
$trace = \XLite\Core\Operator::getInstance()->getBackTrace();
}
file_put_contents(TESTS_LOG_DIR . 'selenium.' . $location . '.' . date('Ymd-His') . '.html', '<!--' . PHP_EOL . 'Exception: ' . $exception->getMessage() . ';' . PHP_EOL . ($trace ? 'Back trace: ' . var_export($trace, true) . PHP_EOL : '') . '-->' . PHP_EOL . $html);
} catch (\RuntimeException $e) {
}
}
$backtrace = array();
foreach ($exception->getTrace() as $t) {
$b = null;
if (isset($t['file'])) {
$b = $t['file'] . ' : ' . $t['line'];
} elseif (isset($t['function'])) {
$b = 'function ' . $t['function'] . '()';
if (isset($t['line'])) {
$b .= ' : ' . $t['line'];
}
}
if ($b) {
$backtrace[] = $b;
}
}
file_put_contents(TESTS_LOG_DIR . 'selenium.' . date('Ymd-His') . '.backtrace', 'Exception: ' . $exception->getMessage() . ';' . PHP_EOL . PHP_EOL . 'Backtrace: ' . PHP_EOL . implode(PHP_EOL, $backtrace) . PHP_EOL);
throw $exception;
}
}
示例4: runTest
protected function runTest()
{
$this->autoStop = false;
try {
parent::runTest();
} catch (Exception $e) {
$this->screenshot(null);
// try {
// $this->stop();
// } catch (RuntimeException $e) {}
throw $e;
}
try {
$this->stop();
} catch (RuntimeException $e) {
}
}