Example #1
0
/**
 * 创建遗漏用例列表
 * FIXME: 需要过滤package类型,考虑使用js名称同名目录存在进行过滤或者白名单
 */
function _srcOnlyList()
{
    require 'case.class.php';
    $list = Kiss::listSrcOnly(false);
    $len = sizeof($list);
    $flag = "<table cellspacing='0' style='border: 1px solid black; " . "color: #fff; background-color: #0d3349; " . "text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; " . "text-align: center;'><thead><tr><th>遗漏列表:总计{$len,未过滤无需用例的package类型}</th></tr><tr><td>";
    $flag .= implode("</td></tr><tr><td>", $list);
    $flag .= "</tr></table>";
    return $flag;
}
Example #2
0
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: dongyancen
 * Date: 13-10-10
 * Time: 上午1:17
 * To change this template use File | Settings | File Templates.
 */
header("Content-type: text/html; charset=utf-8");
header("Cache-Control: no-cache, max-age=10, must-revalidate");
if (!array_key_exists('quirk', $_GET)) {
    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
}
require_once "caseSource.php";
$c = new Kiss($_GET['case']);
$title = $c->name;
$cov = array_key_exists('cov', $_GET);
?>
<html>
<head>
    <title>Jasmine Spec Runner</title>

    <link rel="shortcut icon" type="image/png" href="lib/jasmine-1.3.0/jasmine_favicon.png">
    <link rel="stylesheet" type="text/css" href="lib/jasmine-1.3.0/jasmine.css">
    <script type="text/javascript" src="lib/jasmine-1.3.0/jasmine.js"></script>
    <script type="text/javascript" src="lib/jasmine-1.3.0/jasmine-html.js"></script>
    <script type="text/javascript" src="js/ext_jasmine.js"></script>
    <?php 
$c->print_js($cov);
?>
Example #3
0
<?php

header("Content-type: text/html; charset=utf-8");
header("Cache-Control: no-cache, max-age=10, must-revalidate");
if (!array_key_exists('quirk', $_GET)) {
    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
}
require_once "case.class.php";
$c = new Kiss('../../../', $_GET['case']);
$title = $c->name;
$cov = array_key_exists('cov', $_GET);
?>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title><?php 
print "run case {$title}";
?>
</title>
    <?php 
$c->print_all_js($cov);
?>
</head>
<body>
<h1 id="qunit-header"><?php 
print $c->name;
?>
</h1>

<h2 id="qunit-banner"></h2>
Example #4
0
            onclick="$('div#id_testlist').slideToggle('slow');"> 折叠用例 </span> </a>
    <a id="id_srconly" class="button"><span
            onclick="$('#id_showSrcOnly').slideToggle('slow');">折叠缺失</span> </a>
    <a id="id_srconly" class="button"><span
            onclick="$('#id_runningarea').slideToggle('slow');">折叠执行</span> </a>
</div>
<div id="id_rerun" onclick="run($('#id_rerun').html());return false;"></div>
<div style="clear: both"></div>
<div id="id_testlist" class="testlist">
<?php 
/*分析所有源码与测试代码js文件一一对应的文件并追加到当前列表中*/
require_once "case.class.php";
Kiss::listcase($filter, $filterRun);
?>
    <div style="clear: both; overflow: hidden"></div>
</div>
<div id="id_runningarea" class="runningarea"
     style="border: solid; display: none"></div>
<div id="id_reportarea" class="reportarea" style="display: none;"></div>
<div class='clear'></div>
<div id="id_showSrcOnly" class="testlist" style="display: none;">
<?php 
require_once "case.class.php";
//if(array_key_exists("showsrconly", $_GET))
Kiss::listSrcOnly(true);
?>
    <div class="clear"></div>
</div>
</body>
</html>
Example #5
0
File: run.php Project: eou/Magic
<?php

header("Content-type: text/html; charset=utf-8");
header("Cache-Control: no-cache, max-age=10, must-revalidate");
if (!array_key_exists('quirk', $_GET)) {
    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
}
require_once "case.class.php";
$c = new Kiss('../../../', $_GET['case']);
if ($c->fileunexist) {
    echo '该接口无用例<script type="text/javascript">if(parent && parent.testDoneCallBack){parent.testDoneCallBack({});}</script>';
    return;
}
$title = $c->name;
$cov = array_key_exists('cov', $_GET);
$release = array_key_exists('release', $_GET);
$dep = array_key_exists('dep', $_GET) ? $_GET['dep'] : false;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php 
print "run case {$title}";
?>
</title>
<?php 
$c->print_js($cov, $release, $dep);
?>
</head>
<body>
<h1 id="qunit-header"><span><a href="<?php 
Example #6
0
    public $projroot;
    public $name;
    public $srcPath;
    public $testPath;
    function __construct($name = '')
    {
        $this->projroot = Config::$projroot;
        $this->srcPath = Config::$projroot . Config::$src_PATH;
        $this->testPath = Config::$projroot . Config::$test_PATH;
        $this->name = $name;
    }
    public function print_js()
    {
        /* load case source*/
        $importurl = "./import.php";
        print "<script type='text/javascript' src='" . $importurl . "' ></script>\n";
        /* load case and case dependents*/
        $ps = explode('/', $this->name);
        //读取helper
        foreach (Config::$helperFiles as $f) {
            array_pop($ps);
            array_push($ps, $f);
            if (file_exists($this->testPath . implode('/', $ps))) {
                print '<script type="text/javascript" src="' . $this->testPath . implode('/', $ps) . '"></script>' . "\n";
            }
        }
        print '<script type="text/javascript" src="' . $this->testPath . $this->name . '.js"></script>' . "\n";
    }
}
$a = new Kiss();
$a->print_js();
Example #7
0
 public static function listcase($matcher = "*", $projroot = '../../../')
 {
     $srcpath = $projroot . 'src/';
     $testpath = $projroot . 'test/';
     require_once 'filehelper.php';
     $caselist = getSameFile($srcpath, $testpath, '');
     foreach ($caselist as $caseitem) {
         /*将文件名替换为域名方式,替换/为.,移除.js*/
         $name = str_replace('/', '.', substr($caseitem, 0, -3));
         $c = new Kiss($projroot, $name);
         if ($c->empty) {
             continue;
         }
         if ($c->match($matcher)) {
             print "<a href=\"run.php?case={$name}\" id=\"{$c->case_id}\" path=\"{$caseitem}\"" . "class=\"jsframe_qunit\" target=\"_blank\" title=\"{$name}\" >" . substr($name, 6) . "</a>\n";
         }
     }
 }
Example #8
0
<?php

ini_set("error_reporting", E_ALL ^ E_NOTICE);
header("Content-type: text/html; charset=utf-8");
header("Cache-Control: no-cache, max-age=10, must-revalidate");
if (!array_key_exists('quirk', $_GET)) {
    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
}
require_once "case.class.php";
$c = new Kiss('../../../', $_GET['case']);
$title = $c->name;
$cov = array_key_exists('cov', $_GET);
$release = array_key_exists('release', $_GET);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php 
print "run case {$title}";
?>
</title>
<?php 
$c->print_js($cov, $release);
?>
<link rel="stylesheet" type="text/css" href="../qa/Public/tools/CodeMirror-2.24/lib/codemirror.css">
<link rel="stylesheet" type="text/css" href="../qa/Public/tools/CodeMirror-2.24/theme/blackboard.css">

<script type="text/javascript" src="../qa/Public/tools/CodeMirror-2.24/lib/codemirror.js"></script>
<script src="../qa/Public/tools/CodeMirror-2.24/mode/javascript/javascript.js"></script>
</head>
<body>
 public static function listcase($matcher = "*", $projroot = '../../../')
 {
     $srcpath = $projroot . '_src/';
     $testpath = $projroot . '_test/';
     require_once 'filehelper.php';
     $caselist = getSameFile($srcpath, $testpath, '');
     //默认取src和test下的同名文件
     foreach (Config::$special_Case as $s_caseitem => $s_source) {
         //设置在源码路径下没有同名文件对应的测试文件
         array_push($caselist, $s_caseitem);
     }
     sort($caselist, SORT_STRING);
     foreach ($caselist as $caseitem) {
         /*将文件名替换为域名方式,替换/为.,移除.js*/
         //$name = str_replace( '/' , '.' , substr( $caseitem , 0 , -3 ) );
         $name = substr($caseitem, 0, -3);
         //为了支持xx.xx.js类型的文件名而修改 田丽丽
         $c = new Kiss($projroot, $name);
         if ($c->empty) {
             continue;
         }
         if ($c->match($matcher)) {
             $newName = explode('\\.', $name);
             $newName = $newName[count($newName) - 1];
             print "<a href=\"run.php?case={$name}\" id=\"{$c->case_id}\" class=\"jsframe_qunit\" target=\"_blank\" title=\"{$name}\" onclick=\"run('{$name}');\$('#id_rerun').html('{$name}');return false;\">" . $newName . "</a>\n";
         }
     }
 }
Example #10
0
	public static function listcase($matcher="*", $projroot = '../../../'){
		$srcpath = $projroot.'src/';
		$testpath = $projroot.'test/';
		require_once 'filehelper.php';
		$caselist = getSameFile($srcpath, $testpath, '');
		foreach($caselist as $caseitem){
			/*将文件名替换为域名方式,替换/为.,移除.js*/
			$name = str_replace('/','.',substr($caseitem,0, -3));
			$c = new Kiss($projroot, $name);
			if($c->empty)
			continue;
			if($c->match($matcher)){
				print("<a href=\"run.php?case=$name\" id=\"$c->case_id\" path=\"$caseitem\""
				."class=\"jsframe_qunit\" target=\"_blank\" title=\"$name\" >"

				/*过长的时候屏蔽超出20的部分,因为隐藏的处理,所有用例不能
				 * 直接使用标签a中的innerHTML,而应该使用title
				 */
				.substr($name, 6)."</a>\n");
			}
		}
	}
Example #11
0
 public static function listcase($matcher = "*", $cov)
 {
     require_once 'fileHelper.php';
     /*get files both in src path and test path*/
     $caselist = getSameFile(Config::$projroot . Config::$src_PATH, Config::$projroot . Config::$test_PATH, '');
     sort($caselist, SORT_STRING);
     foreach ($caselist as $caseitem) {
         /*remove '.js' */
         $name = substr($caseitem, 0, -3);
         $c = new Kiss($name);
         if ($c->empty) {
             continue;
         }
         if ($c->match($matcher)) {
             $newName = explode('\\.', $name);
             $newName = $newName[count($newName) - 1];
             if ($cov) {
                 $covMsg = "&cov=true";
             } else {
                 $covMsg = "";
             }
             print "<a href=\"run.php?case={$name}" . $covMsg . "\" id=\"{$c->case_id}\"  target=\"_blank\" title=\"{$name}\" onclick=\"run('{$name}');return false;\">" . $newName . "</a>";
         }
     }
 }
Example #12
0
<?php

ini_set("error_reporting", E_ALL ^ E_NOTICE);
header("Content-type: text/html; charset=utf-8");
header("Cache-Control: no-cache, max-age=10, must-revalidate");
if (!array_key_exists('quirk', $_GET)) {
    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
}
require_once "case.class.php";
$c = new Kiss('../../../', $_GET['case']);
if ($c->fileunexist) {
    echo '该接口无用例<script type="text/javascript">if(parent && parent.testDoneCallBack){parent.testDoneCallBack({});}</script>';
    return;
}
$title = $c->name;
$cov = array_key_exists('cov', $_GET);
$release = array_key_exists('release', $_GET);
$compatible = array_key_exists('compatible', $_GET);
$download = array_key_exists('download', $_GET);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php 
print "run case {$title}";
?>
</title>
<?php 
$c->print_js($cov, $release, $compatible, $download);
?>
Example #13
0
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: dongyancen
 * Date: 13-10-10
 * Time: 上午1:17
 * To change this template use File | Settings | File Templates.
 */
header("Content-type: text/html; charset=utf-8");
header("Cache-Control: no-cache, max-age=10, must-revalidate");
if (!array_key_exists('quirk', $_GET)) {
    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
}
require_once "caseSource.php";
$c = new Kiss($_GET['case']);
$title = $c->name;
//$cov = array_key_exists( 'cov' , $_GET );
?>
<html>
<head>
    <title>Jasmine Spec Runner</title>

    <link rel="shortcut icon" type="image/png" href="lib/jasmine-1.3.0/jasmine_favicon.png">
    <link rel="stylesheet" type="text/css" href="lib/jasmine-1.3.0/jasmine.css">
    <script type="text/javascript" src="lib/jasmine-1.3.0/jasmine.js"></script>
    <script type="text/javascript" src="lib/jasmine-1.3.0/jasmine-html.js"></script>

    <?php 
$c->print_js();
?>