Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/462.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.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_Node.js_Google Chrome_Nightwatch.js - Fatal编程技术网

Javascript 在夜视测试期间在同一窗口中打开新选项卡

Javascript 在夜视测试期间在同一窗口中打开新选项卡,javascript,node.js,google-chrome,nightwatch.js,Javascript,Node.js,Google Chrome,Nightwatch.js,我想用Nightwatch.js框架编写一个测试脚本,其中一部分包括打开一个Google Chrome浏览器窗口,然后在同一窗口中打开第二个选项卡。下面是我正在尝试运行的.js代码片段 module.exports=new(函数(){ var testCases=这个; 描述('testsuite',函数(){ this.tags=['4']; it('演示登录测试',功能(浏览器){ }); }); var-webrtc=chrome://webrtc-internals'; 函数newTa

我想用Nightwatch.js框架编写一个测试脚本,其中一部分包括打开一个Google Chrome浏览器窗口,然后在同一窗口中打开第二个选项卡。下面是我正在尝试运行的.js代码片段

module.exports=new(函数(){
var testCases=这个;
描述('testsuite',函数(){
this.tags=['4'];
it('演示登录测试',功能(浏览器){
});
});
var-webrtc=chrome://webrtc-internals';
函数newTab(){
打开(webrtc,“_blank”);
}
testCases['打开浏览器并转到url']=函数(客户端,浏览器){
客户
.url(“http://localhost/nextcloud/index.php/call/7wocr9ht")
.waitForElementVisible('body',1000)
。单击('按钮[data-v-036a2cad]')
.暂停(2000年);
浏览器
.execute(函数(url1,window1){
url1=”chrome://webrtc-internals";
window1=“_blank”;
window.open(url1,window1);
},[URL1,WINDOW1]);
客户
.暂停(60000);
}
testCases.after=函数(客户端){
client.end();
}

})();
你确定函数
测试用例['open browser and go to url']=函数(客户端,浏览器){
有两个参数吗?快速查看一下Nightwatch文档就会发现只有一个参数,它是
浏览器
,所以试试
浏览器。url(…)。单击(…)。暂停(…)。执行(functi…)。暂停(…)