1
スクリプトを実行する待機条件を作成しようとしています。待機する必要があるかどうかによって戻り値に基づいて決定されます。 私は分度器のexecuteScript機能とブラウザの待機を使用しています:プロトラクターブラウザーがブール値を待機する条件
this.activeConnections = function(jsl) {
console.log("Inside Active Connections");
switch (jsl) {
case checkEnum.jQuery:
console.log("Jquery Enum");
return browser.executeScript("return jQuery.active;").then(function(count) {
console.log("The count is "+count);
return count == 0;
});
default:
browser.logger.info("No asynchronous check performed.");
break;
}
};
私がtrueに評価されます実行されるスクリプトまで待機する待機状態を期待していたが、それは
this.waitForActiveConnections = function() {
console.log("Inside Wait for Active Connections");
var condition = until.and(this.activeConnections(checkEnum.jQuery),false);
console.log("Whats this condition "+ condition);
return browser.wait(condition,30000);
};
は簡易版で働いて、それを手に入れた: 'this.waitForActiveConnections =機能(){ はconsole.log( "インサイドはアクティブ接続を待ちます"); return browser.wait(function(){ //条件がtrueになるまで待ちます。 return browser.executeScript( "return jQuery.active;")then(function(count){ console.log + count); 戻りカウント== 1; }); }、3000); }; ' –