From cc43b63037c31cb18733eeb8ffc3820e148301b1 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Wed, 6 Jun 2018 16:22:00 -0700 Subject: [PATCH] Improve test to ensure click is processed and move to apply to all drivers --- lib/capybara/spec/session/node_spec.rb | 6 ++++++ lib/capybara/spec/views/tables.erb | 2 +- spec/shared_selenium_session.rb | 5 ----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/capybara/spec/session/node_spec.rb b/lib/capybara/spec/session/node_spec.rb index bacb6252..ca73b07e 100644 --- a/lib/capybara/spec/session/node_spec.rb +++ b/lib/capybara/spec/session/node_spec.rb @@ -370,6 +370,12 @@ Capybara::SpecHelper.spec "node" do expect(locations[:x].to_f).to be_within(1).of(5) expect(locations[:y].to_f).to be_within(1).of(5) end + + it "should be able to click a table row", requires: [:js] do + @session.visit('/tables') + tr = @session.find(:css, '#agent_table tr:first-child').click + expect(tr).to have_css('label', text: 'Clicked') + end end describe '#double_click', requires: [:js] do diff --git a/lib/capybara/spec/views/tables.erb b/lib/capybara/spec/views/tables.erb index 12c11194..4a1f798e 100644 --- a/lib/capybara/spec/views/tables.erb +++ b/lib/capybara/spec/views/tables.erb @@ -3,7 +3,7 @@ - + diff --git a/spec/shared_selenium_session.rb b/spec/shared_selenium_session.rb index 1ed971d2..6a0c949e 100644 --- a/spec/shared_selenium_session.rb +++ b/spec/shared_selenium_session.rb @@ -247,11 +247,6 @@ RSpec.shared_examples "Capybara::Session" do |session, mode| session.find(:link, 'Go to root').click expect(session).to have_current_path('/') end - - it "should be able to click a table row" do - session.visit('/tables') - expect { session.find(:css, '#agent_table tr:first-child').click }.not_to raise_error - end end context "Windows" do
Agent