Unverified Commit 12246b4b authored by boklm's avatar boklm
Browse files

Add details about selenium tests in report

parent 0986c7aa
......@@ -207,7 +207,10 @@ sub mozmill_run {
sub selenium_run {
my ($test) = @_;
return unless $options->{selenium};
my $result_file = $ENV{SELENIUM_TEST_RESULT_FILE} =
"$options->{tbbinfos}{'results-dir'}/$test->{name}.json";
system("$FindBin::Bin/selenium-tests/run_test", $test->{name});
$test->{results} = decode_json(read_file($result_file));
}
sub run_tests {
......@@ -229,6 +232,10 @@ sub is_success {
&& $tests->{$test}{results}{results}->[0]->{failed}) {
return 0;
}
if (defined $tests->{$test}{results}{success} &&
!$tests->{$test}{results}{success}) {
return 0;
}
}
return 1;
}
......
......@@ -30,19 +30,36 @@
<ul>
<li><b>Test type:</b> [% test.type %]</li>
[% IF test.type == 'mozmill' %]
<li><b>Status:</b>
[% IF test.results.results.0.failed == 0 %]
<span class="test_ok">OK</span>
[% ELSE %]
<span class="test_notok">NOT OK</span>
[% END %]
</li>
<li><b>Passed tests:</b>
[% GET test.results.results.0.passed %]/[% GET test.results.results.0.passed + test.results.results.0.failed %]
</li>
<li><a href="results-[% tbbfile %]/[% test.name %].json">json results</a></li>
<li><b>Status:</b>
[% IF test.results.results.0.failed == 0 %]
<span class="test_ok">OK</span>
[% ELSE %]
<span class="test_notok">NOT OK</span>
[% END %]
</li>
<li><b>Passed tests:</b>
[% GET test.results.results.0.passed %]/[% GET test.results.results.0.passed + test.results.results.0.failed %]
</li>
<li><a href="results-[% tbbfile %]/[% test.name %].json">json results</a></li>
[% ELSIF test.type == 'selenium' %]
<li><b>Status:</b>
[% IF test.results.success %]
<span class="test_ok">OK</span>
[% ELSE %]
<span class="test_notok">NOT OK</span>
[% END %]
</li>
[% SET stests = test.results.total_tests - test.results.failed.size %]
<li><b>Passed tests:</b> [% stests %]/[% test.results.total_tests %]</li>
<li><a href="results-[% tbbfile %]/[% test.name %].json">json results</a></li>
[% END %]
</ul>
[% IF test.type == 'selenium' && test.results.failed %]
[% FOREACH f IN test.results.failed %]
<b>Failed test:</b> [% f.id %]<br />
<pre>[% f.error %]</pre><br />
[% END %]
[% END %]
[% END %]
<hr>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment