【问题标题】:Protractor version 5.0 Http-backend-proxy failing量角器 5.0 版 Http-backend-proxy 失败
【发布时间】:2017-03-02 19:24:45
【问题描述】:

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

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2016-03-09
      • 2013-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多