Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.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
Angularjs 量角器未等待ui路由器更改状态_Angularjs_Protractor_Angular Ui Router - Fatal编程技术网

Angularjs 量角器未等待ui路由器更改状态

Angularjs 量角器未等待ui路由器更改状态,angularjs,protractor,angular-ui-router,Angularjs,Protractor,Angular Ui Router,我正在使用量角器来测试我的ui路由器SPA应用程序。 根据我对文档的理解,量角器应该在angular播放之前/期间等待事件发生。 例如,当用户单击按钮时,我正在更改状态。所以我想- $('#addProductButton button').click(); 然后- expect(browser.getLocationAbsUrl()).toContain('#/products/new'); 但它失败了。 要解决这个问题,我正在使用浏览器。请等到位置合适。但这太臭了。 是否有人知道为什么量

我正在使用量角器来测试我的ui路由器SPA应用程序。 根据我对文档的理解,量角器应该在angular播放之前/期间等待事件发生。 例如,当用户单击按钮时,我正在更改状态。所以我想-

$('#addProductButton button').click();
然后-

expect(browser.getLocationAbsUrl()).toContain('#/products/new');
但它失败了。 要解决这个问题,我正在使用浏览器。请等到位置合适。但这太臭了。 是否有人知道为什么量角器没有等待。

p、 尝试使用浏览器。waitForAngular()不工作。

发现问题。 我使用$Provider.decorator为$httpbackend提供一些值,同时使用setTimeout而不是$timeout。 setTimeout把我带出了有角度的世界,量角器并没有等那个

哎呀