Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/447.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
是否可以从javascript文件中将量角器作为模块运行?_Javascript_Angularjs_Protractor - Fatal编程技术网

是否可以从javascript文件中将量角器作为模块运行?

是否可以从javascript文件中将量角器作为模块运行?,javascript,angularjs,protractor,Javascript,Angularjs,Protractor,我想通过发送http请求触发量角器测试,响应包含测试结果,如下面的代码片段所示。是否可以使用量角器作为一个模块来允许我这样做 var http = require('http'); http.createServer(function(request,response) { //call to execute protractor test response.writeHead(200); response.write("This should contain the

我想通过发送http请求触发量角器测试,响应包含测试结果,如下面的代码片段所示。是否可以使用量角器作为一个模块来允许我这样做

var http = require('http');

http.createServer(function(request,response)
{
    //call to execute protractor test
    response.writeHead(200);
    response.write("This should contain the test results");
    response.end();
}
).listen(8080);

console.log("Listening on port 8080");

您可以将其作为子shell进程运行

以下是文件:


但是带有许多E2E测试的量角器运行非常慢(在我的例子中大约4分钟)。您确定要坐下来等待结果吗。我建议以异步方式组织此过程。因此,请求将只安排运行的量角器并返回作业ID,您可以随时获取作业ID状态。

感谢Igor,我注意到量角器测试也非常慢,异步组织是一个好主意。我将尝试子进程跟踪。