summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/selenium
diff options
context:
space:
mode:
authorwei <>2006-01-06 04:37:22 +0000
committerwei <>2006-01-06 04:37:22 +0000
commit3b11f3555426a50664e130148fa37e18b8098e28 (patch)
treed1bcba66c8d2fc0a7cfbbde92975b9e972fa7aab /tests/FunctionalTests/selenium
parent2d5b96ba9878ec36df7bb2af3493bb771c85b032 (diff)
Diffstat (limited to 'tests/FunctionalTests/selenium')
-rw-r--r--tests/FunctionalTests/selenium/html-xpath/html-xpath-patched.js2
-rw-r--r--tests/FunctionalTests/selenium/php/results.php22
-rw-r--r--tests/FunctionalTests/selenium/php/selenium.php31
-rw-r--r--tests/FunctionalTests/selenium/prado-functional-test.js4
4 files changed, 23 insertions, 36 deletions
diff --git a/tests/FunctionalTests/selenium/html-xpath/html-xpath-patched.js b/tests/FunctionalTests/selenium/html-xpath/html-xpath-patched.js
index 4b9e05f6..d135e879 100644
--- a/tests/FunctionalTests/selenium/html-xpath/html-xpath-patched.js
+++ b/tests/FunctionalTests/selenium/html-xpath/html-xpath-patched.js
@@ -602,7 +602,7 @@ if (isIe)
{
var attribute = node.attributes[i];
var attributeValue = attribute.nodeValue;
- if (attributeValue && attribute.specified)
+ if (attributeValue && (attribute.specified || attribute.nodeName == 'value'))
{
var domAttribute = dom.createAttribute(attribute.nodeName);
domAttribute.value = attributeValue;
diff --git a/tests/FunctionalTests/selenium/php/results.php b/tests/FunctionalTests/selenium/php/results.php
index 2ad9c56b..77dab43b 100644
--- a/tests/FunctionalTests/selenium/php/results.php
+++ b/tests/FunctionalTests/selenium/php/results.php
@@ -45,9 +45,9 @@ class SeleniumTestResult
$case->commands = $test['commands'];
for($i = 0; $i < count($case->commands); $i++)
{
- $trace = $case->commands[$i]['trace'];
- $trace = html_entity_decode($trace);
- $case->commands[$i]['trace'] = @unserialize($trace);
+ //$trace = $case->commands[$i]['trace'];
+ //$trace = html_entity_decode($trace);
+ //$case->commands[$i]['trace'] = @unserialize($trace);
if($case->commands[$i]['result'] == 'failed')
{
$case->result = 'failed';
@@ -126,33 +126,27 @@ EOD;
foreach($test->suites as $suite)
{
foreach($suite->failures as $error)
- $contents .= $this->getErrorMsg($error, $count++);
+ $contents .= $this->getErrorMsg($suite, $error, $count++);
}
return $contents;
}
- protected function getErrorMsg($info, $count)
+ protected function getErrorMsg($suite, $info, $count)
{
- $args = array();
- foreach($info['trace']['args'] as $arg)
- $args[] = "'{$arg}'";
- $args = implode(",", $args);
$parity = $count%2==0 ? 'even' : 'odd';
+ $command = explode("|",$info['command']);
$msg = <<<EOD
<div class="error_msg {$parity}">
<strong>#{$count}.</strong>
&quot;<span class="msg">{$info['msg']}</span>&quot; in
<span class="function">
- {$info['trace']['class']}::{$info['trace']['function']}({$args})
- </span>
- near
- <span class="file">
- {$info['trace']['file']}:({$info['trace']['line']})
+ {$suite->name}::{$command[1]}('{$command[2]}');
</span>
</div>
EOD;
+
return $msg;
}
diff --git a/tests/FunctionalTests/selenium/php/selenium.php b/tests/FunctionalTests/selenium/php/selenium.php
index a06a6eab..33dc8801 100644
--- a/tests/FunctionalTests/selenium/php/selenium.php
+++ b/tests/FunctionalTests/selenium/php/selenium.php
@@ -142,9 +142,9 @@ class SeleniumTestTrace
{
$group = array_pop($trace);
$info = $trace[3];
- $test = $group['args'][0]->getTestStack();
+ $test = $group['args'][0]->getTestList();
$i = count($test);
- $name = $test[1].'::'.$test[$i-1];
+ $name = $test[$i-2].'::'.$test[$i-1];
$suite = $test[0];
unset($info['object']);
for($i = 0; $i < count($info['args']); $i++)
@@ -158,14 +158,6 @@ class SeleniumTestTrace
}
}
-class SeleniumReporter extends SimpleReporter
-{
- function getTestStack()
- {
- return $this->_test_stack;
- }
-}
-
class SimpleSeleniumProxyServer// extends SeleniumProxyServer
{
protected $runner;
@@ -250,8 +242,7 @@ class SeleniumTestSuiteWriter
$contents = <<<EOD
<html>
<head>
-<meta content="text/html; charset=ISO-8859-1"
-http-equiv="content-type">
+<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Test Suite</title>
</head>
@@ -287,19 +278,18 @@ EOD;
foreach($this->suites as $name => $suite)
{
$name = $name;
- $contents .= "prado_trace['{$name}'] = new Array();\n";
+ $contents .= "prado_trace['{$name}'] = [";
+ $cases = array();
foreach($suite as $testcase)
- {
- $trace = addslashes(htmlspecialchars(serialize($testcase['trace'])));
- $contents .= "prado_trace['{$name}'].push('{$trace}')\n";
- }
+ $cases[] = "'".addslashes(htmlspecialchars(serialize($testcase['trace'])))."'";
+ $contents .= implode(",\n", $cases)."];\n\n";
}
return $contents;
}
protected function renderFooter()
{
- $trace = $this->getJsTraceInfo();
+ $trace = '';//$this->getJsTraceInfo();
$contents = <<<EOD
</tbody>
</table>
@@ -333,7 +323,7 @@ class SeleniumTestCaseWriter
<html>
<head>
<title>{$this->case}</title>
- <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1" id=TABLE1>
@@ -351,6 +341,8 @@ EOD;
foreach($this->tests as $test)
{
$t = explode('|', $test['test']);
+ if($t[1] == "open")
+ $t[2] = "<a href=\"{$t[2]}\" target=\"_blank\">{$t[2]}</a>";
echo "<tr>\n";
echo "<td>{$t[1]}</td>\n";
echo "<td>{$t[2]}</td>\n";
@@ -464,6 +456,7 @@ class SeleniumTestCase extends UnitTestCase
$server = SimpleSeleniumProxyServer::getInstance();
if(!is_null($server))
$this->selenium = $server->proxy();
+ parent::__construct();
}
public function initPage($file)
diff --git a/tests/FunctionalTests/selenium/prado-functional-test.js b/tests/FunctionalTests/selenium/prado-functional-test.js
index 1d0ef39a..37e26516 100644
--- a/tests/FunctionalTests/selenium/prado-functional-test.js
+++ b/tests/FunctionalTests/selenium/prado-functional-test.js
@@ -148,7 +148,7 @@ function parse_resultCell(resultCell,rowNum,form)
form.createHiddenField("tests["+rowNum+"][testcase]",testname);
- var trace = window.testSuiteFrame.prado_trace[testname];
+ //var trace = window.testSuiteFrame.prado_trace[testname];
for(var i = 1; i<table.rows.length; i++)
{
@@ -161,7 +161,7 @@ function parse_resultCell(resultCell,rowNum,form)
form.createHiddenField(id+"[command]", "|"+action+"|"+target+"|"+param+"|");
form.createHiddenField(id+"[result]", result);
form.createHiddenField(id+"[msg]", msg);
- form.createHiddenField(id+"[trace]", trace[i-1]);
+ //form.createHiddenField(id+"[trace]", trace[i-1]);
}
}