这是我的代码
describe "my page", :type => :feature, :js => true do
before(:each) do
visit EnvConfig.get :app_url
end
it { expect(page).to match_expectation }
end
尝试添加gem并使用它https://github.com/rprt/rspec-page-regression
错误
Failures:
1) my page should match expectation
Failure/Error: it { expect(page).to match_expectation }
ArgumentError:
wrong number of arguments (given 1, expected 0)
# ./spec/features/login_spec.rb:7:in `block (2 levels) in <top (required)>'
Finished in 3.24 seconds (files took 0.90062 seconds to load)
1 example, 1 failure
Failed examples:
rspec ./spec/features/login_spec.rb:7 # my page should match expectation
spec_helper.rb文件有下一个要求
require 'capybara'
require 'capybara/dsl'
require 'capybara/rspec'
require 'rspec'
require 'rspec/page-regression'
require 'selenium-webdriver'
require 'site_prism'
require 'env_config'
require 'active_support/all'
以及config.javascript_driver =:selenium