An attempt at making the codeception plugin a little more complete.
Codeception JS plugin and theme changes. Improvements to the display. Extra total information plus some test file locations. Close #588
This commit is contained in:
parent
209454c5f6
commit
408eb5b974
|
@ -172,6 +172,7 @@ Services</a> του Bitbucket αποθετηρίου σας.',
|
||||||
'codeception_errors' => 'Λάθη Codeception',
|
'codeception_errors' => 'Λάθη Codeception',
|
||||||
'phpmd_warnings' => 'Προειδοποιήσεις PHPMD',
|
'phpmd_warnings' => 'Προειδοποιήσεις PHPMD',
|
||||||
'phpcs_warnings' => 'Προειδοποιήσεις PHPCS ',
|
'phpcs_warnings' => 'Προειδοποιήσεις PHPCS ',
|
||||||
|
'codeception_errors' => 'Λάθη Codeception',
|
||||||
'phpcs_errors' => 'Λάθη PHPCS',
|
'phpcs_errors' => 'Λάθη PHPCS',
|
||||||
'phplint_errors' => 'Λάθη Lint',
|
'phplint_errors' => 'Λάθη Lint',
|
||||||
'phpunit_errors' => 'Λάθη PHPUnit ',
|
'phpunit_errors' => 'Λάθη PHPUnit ',
|
||||||
|
|
|
@ -190,6 +190,12 @@ PHPCI',
|
||||||
'technical_debt' => 'Technical Debt',
|
'technical_debt' => 'Technical Debt',
|
||||||
'behat' => 'Behat',
|
'behat' => 'Behat',
|
||||||
|
|
||||||
|
'codeception_feature' => 'Feature',
|
||||||
|
'codeception_suite' => 'Suite',
|
||||||
|
'codeception_time' => 'Time',
|
||||||
|
'codeception_synopsis' => '<strong>%1$d</strong> tests carried out in <strong>%2$f</strong> seconds.
|
||||||
|
<strong>%3$d</strong> failures.',
|
||||||
|
|
||||||
'file' => 'File',
|
'file' => 'File',
|
||||||
'line' => 'Line',
|
'line' => 'Line',
|
||||||
'class' => 'Class',
|
'class' => 'Class',
|
||||||
|
|
|
@ -9,50 +9,76 @@
|
||||||
|
|
||||||
namespace PHPCI\Plugin;
|
namespace PHPCI\Plugin;
|
||||||
|
|
||||||
use PHPCI;
|
|
||||||
use PHPCI\Builder;
|
use PHPCI\Builder;
|
||||||
use PHPCI\Helper\Lang;
|
use PHPCI\Helper\Lang;
|
||||||
use PHPCI\Model\Build;
|
use PHPCI\Model\Build;
|
||||||
use PHPCI\Plugin\Util\TapParser;
|
use PHPCI\Plugin\Util\TestResultParsers\Codeception as Parser;
|
||||||
|
use Psr\Log\LogLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Codeception Plugin - Enables full acceptance, unit, and functional testing
|
* Codeception Plugin - Enables full acceptance, unit, and functional testing.
|
||||||
*
|
|
||||||
* @author Don Gilbert <don@dongilbert.net>
|
* @author Don Gilbert <don@dongilbert.net>
|
||||||
* @author Igor Timoshenko <contact@igortimoshenko.com>
|
* @author Igor Timoshenko <contact@igortimoshenko.com>
|
||||||
|
* @author Adam Cooper <adam@networkpie.co.uk>
|
||||||
* @package PHPCI
|
* @package PHPCI
|
||||||
* @subpackage Plugins
|
* @subpackage Plugins
|
||||||
*/
|
*/
|
||||||
class Codeception implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
|
class Codeception implements \PHPCI\Plugin, \PHPCI\ZeroConfigPlugin
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $args = '';
|
protected $args = '';
|
||||||
|
|
||||||
/**
|
/** @var Builder */
|
||||||
* @var Build
|
protected $phpci;
|
||||||
*/
|
|
||||||
|
/** @var Build */
|
||||||
protected $build;
|
protected $build;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Builder
|
* @var string $ymlConfigFile The path of a yml config for Codeception
|
||||||
*/
|
*/
|
||||||
protected $phpci;
|
protected $ymlConfigFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|string[] The path (or array of paths) of an yml config for Codeception
|
* @var string $path The path to the codeception tests folder.
|
||||||
*/
|
*/
|
||||||
protected $configFile;
|
protected $path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string The path where the reports and logs are stored
|
* @param $stage
|
||||||
|
* @param Builder $builder
|
||||||
|
* @param Build $build
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected $logPath = 'tests/_output';
|
public static function canExecute($stage, Builder $builder, Build $build)
|
||||||
|
{
|
||||||
|
if ($stage == 'test' && !is_null(self::findConfigFile($builder->buildPath))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Try and find the codeception YML config file.
|
||||||
|
* @param $buildPath
|
||||||
|
* @return null|string
|
||||||
|
*/
|
||||||
|
public static function findConfigFile($buildPath)
|
||||||
|
{
|
||||||
|
if (file_exists($buildPath . 'codeception.yml')) {
|
||||||
|
return 'codeception.yml';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file_exists($buildPath . 'codeception.dist.yml')) {
|
||||||
|
return 'codeception.dist.yml';
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up the plugin, configure options, etc.
|
* Set up the plugin, configure options, etc.
|
||||||
*
|
|
||||||
* @param Builder $phpci
|
* @param Builder $phpci
|
||||||
* @param Build $build
|
* @param Build $build
|
||||||
* @param array $options
|
* @param array $options
|
||||||
|
@ -61,104 +87,96 @@ class Codeception implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
|
||||||
{
|
{
|
||||||
$this->phpci = $phpci;
|
$this->phpci = $phpci;
|
||||||
$this->build = $build;
|
$this->build = $build;
|
||||||
|
$this->path = 'tests/';
|
||||||
|
|
||||||
if (isset($options['config'])) {
|
if (empty($options['config'])) {
|
||||||
$this->configFile = $options['config'];
|
$this->ymlConfigFile = self::findConfigFile($this->phpci->buildPath);
|
||||||
|
}
|
||||||
|
if (isset($options['config'])) {
|
||||||
|
$this->ymlConfigFile = $options['config'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['args'])) {
|
if (isset($options['args'])) {
|
||||||
$this->args = (string) $options['args'];
|
$this->args = (string) $options['args'];
|
||||||
}
|
}
|
||||||
|
if (isset($options['path'])) {
|
||||||
if (isset($options['log_path'])) {
|
$this->path = $options['path'];
|
||||||
$this->logPath = $options['log_path'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* Runs Codeception tests, optionally using specified config file(s).
|
||||||
*/
|
*/
|
||||||
public function execute()
|
public function execute()
|
||||||
{
|
{
|
||||||
|
if (empty($this->ymlConfigFile)) {
|
||||||
|
$this->phpci->logFailure('No configuration file found');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$success = true;
|
$success = true;
|
||||||
|
|
||||||
$this->phpci->logExecOutput(false);
|
// Run any config files first. This can be either a single value or an array.
|
||||||
|
$success &= $this->runConfigFile($this->ymlConfigFile);
|
||||||
// Run any config files first. This can be either a single value or an array
|
|
||||||
if ($this->configFile !== null) {
|
|
||||||
$success &= $this->runConfigFile($this->configFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
$tapString = file_get_contents(
|
|
||||||
$this->phpci->buildPath . $this->logPath . DIRECTORY_SEPARATOR . 'report.tap.log'
|
|
||||||
);
|
|
||||||
|
|
||||||
try {
|
|
||||||
$tapParser = new TapParser($tapString);
|
|
||||||
$output = $tapParser->parse();
|
|
||||||
} catch (\Exception $ex) {
|
|
||||||
$this->phpci->logFailure($tapString);
|
|
||||||
|
|
||||||
throw $ex;
|
|
||||||
}
|
|
||||||
|
|
||||||
$failures = $tapParser->getTotalFailures();
|
|
||||||
|
|
||||||
$this->build->storeMeta('codeception-errors', $failures);
|
|
||||||
$this->build->storeMeta('codeception-data', $output);
|
|
||||||
|
|
||||||
$this->phpci->logExecOutput(true);
|
|
||||||
|
|
||||||
return $success;
|
return $success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* Run tests from a Codeception config file.
|
||||||
*/
|
* @param $configPath
|
||||||
public static function canExecute($stage, Builder $builder, Build $build)
|
|
||||||
{
|
|
||||||
return $stage === 'test';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Run tests from a Codeception config file
|
|
||||||
*
|
|
||||||
* @param string $configPath
|
|
||||||
* @return bool|mixed
|
* @return bool|mixed
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
protected function runConfigFile($configPath)
|
protected function runConfigFile($configPath)
|
||||||
{
|
{
|
||||||
if (is_array($configPath)) {
|
if (is_array($configPath)) {
|
||||||
return $this->recurseArg($configPath, array($this, 'runConfigFile'));
|
return $this->recurseArg($configPath, array($this, 'runConfigFile'));
|
||||||
} else {
|
} else {
|
||||||
|
$this->phpci->logExecOutput(false);
|
||||||
|
|
||||||
$codecept = $this->phpci->findBinary('codecept');
|
$codecept = $this->phpci->findBinary('codecept');
|
||||||
|
|
||||||
$cmd = 'cd "%s" && ' . $codecept . ' run -c "%s" --tap ' . $this->args;
|
if (!$codecept) {
|
||||||
|
$this->phpci->logFailure(Lang::get('could_not_find', 'codecept'));
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$cmd = 'cd "%s" && ' . $codecept . ' run -c "%s" --xml ' . $this->args;
|
||||||
if (IS_WIN) {
|
if (IS_WIN) {
|
||||||
$cmd = 'cd /d "%s" && ' . $codecept . ' run -c "%s" --tap ' . $this->args;
|
$cmd = 'cd /d "%s" && ' . $codecept . ' run -c "%s" --xml ' . $this->args;
|
||||||
}
|
}
|
||||||
|
|
||||||
$configPath = $this->phpci->buildPath . $configPath;
|
$configPath = $this->phpci->buildPath . $configPath;
|
||||||
$success = $this->phpci->executeCommand($cmd, $this->phpci->buildPath, $configPath);
|
$success = $this->phpci->executeCommand($cmd, $this->phpci->buildPath, $configPath);
|
||||||
|
|
||||||
return $success;
|
|
||||||
}
|
$this->phpci->log(
|
||||||
|
'Codeception XML path: '. $this->phpci->buildPath . $this->path . '_output/report.xml',
|
||||||
|
Loglevel::DEBUG
|
||||||
|
);
|
||||||
|
$xml = file_get_contents($this->phpci->buildPath . $this->path . '_output/report.xml', false);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$parser = new Parser($this->phpci, $xml);
|
||||||
|
$output = $parser->parse();
|
||||||
|
} catch (\Exception $ex) {
|
||||||
|
throw $ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
$meta = array(
|
||||||
* @param array $array
|
'tests' => $parser->getTotalTests(),
|
||||||
* @param \Callback $callable
|
'timetaken' => $parser->getTotalTimeTaken(),
|
||||||
* @return bool|mixed
|
'failures' => $parser->getTotalFailures()
|
||||||
*/
|
);
|
||||||
protected function recurseArg(array $array, $callable)
|
|
||||||
{
|
|
||||||
$success = true;
|
|
||||||
|
|
||||||
foreach ($array as $subItem) {
|
$this->build->storeMeta('codeception-meta', $meta);
|
||||||
$success &= call_user_func($callable, $subItem);
|
$this->build->storeMeta('codeception-data', $output);
|
||||||
}
|
$this->build->storeMeta('codeception-errors', $parser->getTotalFailures());
|
||||||
|
|
||||||
|
$this->phpci->logExecOutput(true);
|
||||||
|
|
||||||
return $success;
|
return $success;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
108
PHPCI/Plugin/Util/TestResultParsers/Codeception.php
Normal file
108
PHPCI/Plugin/Util/TestResultParsers/Codeception.php
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PHPCI\Plugin\Util\TestResultParsers;
|
||||||
|
|
||||||
|
use PHPCI\Builder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Codeception
|
||||||
|
*
|
||||||
|
* @author Adam Cooper <adam@networkpie.co.uk>
|
||||||
|
* @package PHPCI\Plugin\Util\TestResultParsers
|
||||||
|
*/
|
||||||
|
class Codeception implements ParserInterface
|
||||||
|
{
|
||||||
|
protected $phpci;
|
||||||
|
protected $resultsXml;
|
||||||
|
|
||||||
|
protected $results;
|
||||||
|
|
||||||
|
protected $totalTests;
|
||||||
|
protected $totalTimeTaken;
|
||||||
|
protected $totalFailures;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Builder $phpci
|
||||||
|
* @param $resultsXml
|
||||||
|
*/
|
||||||
|
public function __construct(Builder $phpci, $resultsXml)
|
||||||
|
{
|
||||||
|
$this->phpci = $phpci;
|
||||||
|
$this->resultsXml = $resultsXml;
|
||||||
|
|
||||||
|
$this->totalTests = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array An array of key/value pairs for storage in the plugins result metadata
|
||||||
|
*/
|
||||||
|
public function parse()
|
||||||
|
{
|
||||||
|
$rtn = array();
|
||||||
|
|
||||||
|
$this->results = new \SimpleXMLElement($this->resultsXml);
|
||||||
|
|
||||||
|
// calculate total results
|
||||||
|
foreach ($this->results->testsuite as $testsuite) {
|
||||||
|
$this->totalTests += (int) $testsuite['tests'];
|
||||||
|
$this->totalTimeTaken += (float) $testsuite['time'];
|
||||||
|
$this->totalFailures += (int) $testsuite['failures'];
|
||||||
|
|
||||||
|
foreach ($testsuite->testcase as $testcase) {
|
||||||
|
$testresult = array(
|
||||||
|
'suite' => (string) $testsuite['name'],
|
||||||
|
'file' => str_replace($this->phpci->buildPath, '/', (string) $testcase['file']),
|
||||||
|
'name' => (string) $testcase['name'],
|
||||||
|
'feature' => (string) $testcase['feature'],
|
||||||
|
'assertions' => (int) $testcase['assertions'],
|
||||||
|
'time' => (float) $testcase['time']
|
||||||
|
);
|
||||||
|
|
||||||
|
if (isset($testcase['class'])) {
|
||||||
|
$testresult['class'] = (string) $testcase['class'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($testcase->failure)) {
|
||||||
|
$testresult['pass'] = false;
|
||||||
|
$testresult['message'] = (string) $testcase->failure;
|
||||||
|
} else {
|
||||||
|
$testresult['pass'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$rtn[] = $testresult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $rtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the total number of tests performed.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getTotalTests()
|
||||||
|
{
|
||||||
|
return $this->totalTests;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The time take to complete all tests
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getTotalTimeTaken()
|
||||||
|
{
|
||||||
|
return $this->totalTimeTaken;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A count of the test failures
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getTotalFailures()
|
||||||
|
{
|
||||||
|
return $this->totalFailures;
|
||||||
|
}
|
||||||
|
}
|
16
PHPCI/Plugin/Util/TestResultParsers/ParserInterface.php
Normal file
16
PHPCI/Plugin/Util/TestResultParsers/ParserInterface.php
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PHPCI\Plugin\Util\TestResultParsers;
|
||||||
|
|
||||||
|
interface ParserInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array An array of key/value pairs for storage in the plugins result metadata
|
||||||
|
*/
|
||||||
|
public function parse();
|
||||||
|
|
||||||
|
public function getTotalTests();
|
||||||
|
public function getTotalTimeTaken();
|
||||||
|
public function getTotalFailures();
|
||||||
|
}
|
2
public/assets/css/bootstrap-theme.min.css
vendored
2
public/assets/css/bootstrap-theme.min.css
vendored
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap v3.1.1 (http://getbootstrap.com)
|
* Bootstrap v3.2.0 (http://getbootstrap.com)
|
||||||
* Copyright 2011-2014 Twitter, Inc.
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
2
public/assets/css/bootstrap.min.css
vendored
2
public/assets/css/bootstrap.min.css
vendored
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* Bootstrap v3.1.1 (http://getbootstrap.com)
|
* Bootstrap v3.2.0 (http://getbootstrap.com)
|
||||||
* Copyright 2011-2014 Twitter, Inc.
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
8
public/assets/js/bootstrap.min.js
vendored
8
public/assets/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,39 +1,45 @@
|
||||||
var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
|
var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
|
||||||
id: 'build-codeception-errors',
|
id: 'build-codeception-errors',
|
||||||
css: 'col-lg-6 col-md-12 col-sm-12 col-xs-12',
|
css: 'col-lg-12 col-md-12 col-sm-12 col-xs-12',
|
||||||
title: Lang.get('codeception'),
|
title: Lang.get('codeception'),
|
||||||
lastData: null,
|
lastData: null,
|
||||||
|
lastMeta: null,
|
||||||
displayOnUpdate: false,
|
displayOnUpdate: false,
|
||||||
box: true,
|
box: true,
|
||||||
rendered: false,
|
rendered: false,
|
||||||
|
|
||||||
register: function() {
|
register: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
var query = ActiveBuild.registerQuery('codeception-data', -1, {key: 'codeception-data'})
|
var query_data = ActiveBuild.registerQuery('codeception-data', -1, {key: 'codeception-data'});
|
||||||
|
var query_meta_data = ActiveBuild.registerQuery('codeception-meta', -1, {key: 'codeception-meta'});
|
||||||
|
|
||||||
$(window).on('codeception-data', function(data) {
|
$(window).on('codeception-data', function(data) {
|
||||||
self.onUpdate(data);
|
self.onUpdateData(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(window).on('codeception-meta', function(data) {
|
||||||
|
self.onUpdateMeta(data);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).on('build-updated', function() {
|
$(window).on('build-updated', function() {
|
||||||
if (!self.rendered) {
|
if (!self.rendered) {
|
||||||
self.displayOnUpdate = true;
|
self.displayOnUpdate = true;
|
||||||
query();
|
query_data();
|
||||||
|
query_meta_data();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|
||||||
return $('<table class="table" id="codeception-data">' +
|
return $('<table class="table" id="codeception-data">' +
|
||||||
'<thead>' +
|
'<thead>' +
|
||||||
'<tr>' +
|
'<tr><th>'+Lang.get('codeception_suite')+'</th>' +
|
||||||
' <th>'+Lang.get('test')+'</th>' +
|
'<th>'+Lang.get('codeception_feature')+'</th>' +
|
||||||
'</tr>' +
|
'<th>'+Lang.get('codeception_time')+'</th></tr>' +
|
||||||
'</thead><tbody></tbody></table>');
|
'</thead><tbody></tbody><tfoot></tfoot></table>');
|
||||||
},
|
},
|
||||||
|
|
||||||
onUpdate: function(e) {
|
onUpdateData: function(e) {
|
||||||
if (!e.queryData) {
|
if (!e.queryData) {
|
||||||
$('#build-codeception-errors').hide();
|
$('#build-codeception-errors').hide();
|
||||||
return;
|
return;
|
||||||
|
@ -53,22 +59,54 @@ var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
|
||||||
|
|
||||||
for (var i in tests) {
|
for (var i in tests) {
|
||||||
|
|
||||||
var row = $('<tr>' +
|
var rows = $('<tr data-toggle="collapse" data-target="#collapse'+i+'">' +
|
||||||
'<td><strong>'+tests[i].suite+'' +
|
'<td><strong>'+tests[i].suite+'</strong</td>' +
|
||||||
'::'+tests[i].test+'</strong><br>' +
|
'<td>'+tests[i].feature+'</td>' +
|
||||||
''+(tests[i].message || '')+'</td>' +
|
'<td>'+tests[i].time+'</td>'+
|
||||||
|
'</tr>' +
|
||||||
|
'<tr id="collapse'+i+'" class="collapse" >' +
|
||||||
|
'<td></td><td colspan="2">' +
|
||||||
|
'<small><strong>'+Lang.get('name')+':</strong> '+tests[i].name+'</small><br />' +
|
||||||
|
'<small><strong>'+Lang.get('file')+':</strong> '+tests[i].file+'</small><br />' +
|
||||||
|
(tests[i].message
|
||||||
|
? '<small><strong>'+Lang.get('message')+':</strong> '+tests[i].message+'</small>'
|
||||||
|
: '') +
|
||||||
|
'</td>' +
|
||||||
'</tr>');
|
'</tr>');
|
||||||
|
|
||||||
if (!tests[i].pass) {
|
if (!tests[i].pass) {
|
||||||
row.addClass('danger');
|
rows.first().addClass('danger');
|
||||||
} else {
|
} else {
|
||||||
row.addClass('success');
|
rows.first().addClass('success');
|
||||||
}
|
}
|
||||||
|
|
||||||
tbody.append(row);
|
tbody.append(rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#build-codeception-errors').show();
|
$('#build-codeception-errors').show();
|
||||||
|
},
|
||||||
|
|
||||||
|
onUpdateMeta: function(e) {
|
||||||
|
if (!e.queryData) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#build-codeception-errors').show();
|
||||||
|
$('#build-codeception-errors td').tooltip();
|
||||||
|
|
||||||
|
this.lastMeta = e.queryData;
|
||||||
|
|
||||||
|
var data = this.lastMeta[0].meta_value;
|
||||||
|
var tfoot = $('#codeception-data tfoot');
|
||||||
|
tfoot.empty();
|
||||||
|
|
||||||
|
var row = $('<tr>' +
|
||||||
|
'<td colspan="3">' +
|
||||||
|
Lang.get('codeception_synopsis', data.tests, data.timetaken, data.failures) +
|
||||||
|
'</td>' +
|
||||||
|
'</tr>');
|
||||||
|
|
||||||
|
tfoot.append(row);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue