Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface 为casperjs创建用户界面_User Interface_Casperjs - Fatal编程技术网

User interface 为casperjs创建用户界面

User interface 为casperjs创建用户界面,user-interface,casperjs,User Interface,Casperjs,我已经在我的mac上创建了casperjs测试,我使用命令行在我的机器上本地运行并调用每个测试。我想做的是创建一个用户界面(即摆脱命令行),这样任何人都可以从我编写的测试中选择任意数量的测试,并在UI上获得测试的输出。我真的不介意UI是python程序、JSHTML还是其他什么。我只是希望它足够灵活,可以按要求执行。有谁能告诉我一些好的消息来源,我可以从中得到一些想法吗?我还看到,执行shell命令并在UI上获得输出变得非常棘手。还有什么建议吗?这是如何使用一个非常简单的HTML/PHP页面来实

我已经在我的mac上创建了casperjs测试,我使用命令行在我的机器上本地运行并调用每个测试。我想做的是创建一个用户界面(即摆脱命令行),这样任何人都可以从我编写的测试中选择任意数量的测试,并在UI上获得测试的输出。我真的不介意UI是python程序、JSHTML还是其他什么。我只是希望它足够灵活,可以按要求执行。有谁能告诉我一些好的消息来源,我可以从中得到一些想法吗?我还看到,执行shell命令并在UI上获得输出变得非常棘手。还有什么建议吗?

这是如何使用一个非常简单的HTML/PHP页面来实现的。它发送一个要执行的shell命令,然后(当整个测试完成时)显示输出。确保使用
--无颜色
,因为ascii码符号会使输出难以读取

<html>
<head>
</head>
<body>
    <?php
        $user_input = $_POST['user_input'];

        putenv("PHANTOMJS_EXECUTABLE=/path/to/phantomjs");
        exec('/path/to/casperjs test --no-colors /path/to/casperTest.js $user_input 2>&1',$output);

        foreach ($output as $value) {
          echo "$value <br>";
        }
    ?>
</body>