量角器版本5.0 Http-backend-proxy失败

时间:2017-03-02 19:24:45

标签: protractor selenium-chromedriver angularjs-e2e httpbackend ngmocke2e

我从量角器版本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];
                });
        }    

1 个答案:

答案 0 :(得分:0)

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