Improve test to ensure click is processed and move to apply to all drivers

This commit is contained in:
Thomas Walpole 2018-06-06 16:22:00 -07:00
parent 3aed7fe3e6
commit cc43b63037
3 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -3,7 +3,7 @@
<table id="agent_table">
<caption>Agent</caption>
<tr>
<tr onclick="this.querySelector('td label').innerHTML = 'Clicked'">
<td>
<label for="form_agent_name">Name</label>
</td>

View File

@ -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