权限被拒绝访问属性“调用”

时间:2017-01-16 18:45:23

标签: ruby-on-rails selenium angular

我正在运行Rails 5 / Angular 2集成测试并收到以下错误:

  

硒::的webdriver ::错误::不明错误:

     

拒绝访问属性的权限“invoke”

我不确定哪里开始调试。任何帮助将不胜感激。

堆栈追踪:

1) Books list page                                                                                                                [88/1823]
   Failure/Error: expect(page).to have_content('Books')

 Selenium::WebDriver::Error::UnknownError:
   Permission denied to access property "invoke"
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/selenium-webdriver-3.0.5/lib/selenium/webdriver/remote/response.rb:69:in `assert_ok'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/selenium-webdriver-3.0.5/lib/selenium/webdriver/remote/response.rb:32:in `initialize'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/selenium-webdriver-3.0.5/lib/selenium/webdriver/remote/http/common.rb:85:in `new'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/selenium-webdriver-3.0.5/lib/selenium/webdriver/remote/http/common.rb:85:in `create_response'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/selenium-webdriver-3.0.5/lib/selenium/webdriver/remote/http/default.rb:107:in `request'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/selenium-webdriver-3.0.5/lib/selenium/webdriver/remote/http/common.rb:63:in `call'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/selenium-webdriver-3.0.5/lib/selenium/webdriver/remote/w3c_bridge.rb:640:in `raw_execute'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/selenium-webdriver-3.0.5/lib/selenium/webdriver/remote/w3c_bridge.rb:615:in `execute'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/selenium-webdriver-3.0.5/lib/selenium/webdriver/remote/w3c_bridge.rb:345:in `execute_script'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/selenium-webdriver-3.0.5/lib/selenium/webdriver/common/driver.rb:215:in `execute_script'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/selenium/node.rb:9:in `all_text'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/node/element.rb:61:in `block in text'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/node/base.rb:81:in `synchronize'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/node/element.rb:59:in `text'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/node/document.rb:24:in `text'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/queries/text_query.rb:81:in `text'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/queries/text_query.rb:60:in `build_message'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/queries/text_query.rb:25:in `failure_message'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/node/matchers.rb:562:in `block in assert_text'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/node/matchers.rb:650:in `block in _verify_text'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/node/base.rb:85:in `synchronize'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/node/matchers.rb:648:in `_verify_text'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/node/matchers.rb:560:in `assert_text'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/session.rb:721:in `block (2 levels) in <class:Session>'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/rspec/matchers.rb:93:in `block in matches?'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/rspec/matchers.rb:24:in `wrap_matches?'
 # /Users/jasonswett/.rvm/gems/ruby-2.3.1/gems/capybara-2.11.0/lib/capybara/rspec/matchers.rb:93:in `matches?'
 # ./spec/features/books_spec.rb:6:in `block (2 levels) in <top (required)>'

功能测试代码:

require 'rails_helper'

feature 'Books', js: true do
  scenario 'list page' do
    visit '/'
    expect(page).to have_content('Books')
  end
end

1 个答案:

答案 0 :(得分:0)

更新您的UI组件依赖项(package.json)以依赖zone.js版本0.8.7或更高版本

{
    "zone.js": ">=0.8.7"
}

Source issue on angular github