Selenium RSpec、水豚和硒与Rails 4
我已经将我的应用程序从Rails 3.2升级到Rails 4。我正在使用RSpec、Capybara和seleniumwebdriver 我所有的测试用例都是用Rails 3.2运行的,但我一升级Rails,我的集成测试就停止运行了。所有控制器和模型测试运行良好 这是我的密码Selenium RSpec、水豚和硒与Rails 4,selenium,ruby-on-rails-4,capybara,rspec-rails,Selenium,Ruby On Rails 4,Capybara,Rspec Rails,我已经将我的应用程序从Rails 3.2升级到Rails 4。我正在使用RSpec、Capybara和seleniumwebdriver 我所有的测试用例都是用Rails 3.2运行的,但我一升级Rails,我的集成测试就停止运行了。所有控制器和模型测试运行良好 这是我的密码 require 'spec_helper' describe "Describe your business to the system (Sunny Day Scenario)", :js => true do
require 'spec_helper'
describe "Describe your business to the system (Sunny Day Scenario)", :js => true do
before do
FactoryGirl.create(:feature_industry)
FactoryGirl.create(:feature_synonym)
visit simulation_path
end
it "Fill out the intro page form" do
attributes = saucey_cranberry
click_start_test_button(true)
expect(page).to have_content "See what a business loan through CAN Capital can do:"
fill_in "reported_business_industry_selected", with: "food"
sleep(2)
page.execute_script(%Q[$(".dropdown_list_sic:first").trigger('mouseenter').click();])
fill_in "desired_funding_amount", with: attributes[:desired_funding_amount]
fill_in "funding_reason", with: attributes[:funding_reason]
fill_in "get_reported_business_name", with: attributes[:reported_business_name]
fill_in "reported_monthly_income", with: attributes.fetch(:reported_monthly_income)
select(attributes[:time_in_business], from: 'time_in_business')
click_button 'Get Started'
page.current_path.should eq('/enroll/business-loan-calculator')
#have_content 'Enter your gross monthly sales'
end
end
当我运行集成测试时,Selenium会在Mozilla浏览器中运行它们,并成功执行所有步骤。当它到达行
page.current\u path.should eq(“/enroll/business loan calculator”)
时,或者如果我将page.should有内容('some content…)
,这些语句不会执行。浏览器会自动关闭(应该关闭),但我看不到测试是否通过检查您之前的语句是否通过
fill_in "reported_monthly_income", with: attributes.fetch(:reported_monthly_income)
select(attributes[:time_in_business], from: 'time_in_business')
click_button 'Get Started'
如果它没有过去,那么前面的事情就行不通了