2

我从量角器版本 4.0.14 升级到版本 5.0.0,现在我的测试失败了。我使用http-backend-proxy来模拟后端。

测试在 4.0.14 版上运行良好,但在我升级到 5.0 版时失败并出现 InvalidElementState 错误:

E/launcher - invalid element state: Failed to execute 'querySelector' on 'Document': The provided selector is empty.
  (Session info: chrome=56.0.2924.87)
  (Driver info: chromedriver=2.26.436421 (6c1a3ab469ad86fd49c8d97ede4a6b96a49ca5f6),platform=Mac OS X 10.11.4 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 36 milliseconds

它失败了(在响应行):

  afterLoadLogin: function( ) {
            httpBackend
                .when('POST', this.URL + 'user/login')
                .respond( function() {
                    return [$httpBackend.context.loginStatus, $httpBackend.context.login];
                });
        }    
4

1 回答 1

0

Protractor 将此标记为要修复的错误,并在此处提供了解决方法: https ://github.com/angular/protractor/issues/4249

于 2017-06-28T19:59:10.517 回答