Celerity/Culerity drag and drop is broken

Added some more specs for it to prove how it's
broken. The exisiting spec was checking for
driver.find('...').nil? but driver.find returns
an array, so it always passed, even when the
drag/drop actually did nothing.
This commit is contained in:
Jonas Nicklas 2010-07-10 16:36:40 +02:00
parent db6d67741a
commit 7f6531c126
2 changed files with 22 additions and 1 deletions

View File

@ -88,10 +88,11 @@ shared_examples_for "driver with javascript support" do
describe '#drag_to' do
it "should drag and drop an object" do
pending "drag/drop is currently broken under celerity/culerity" if @driver.is_a?(Capybara::Driver::Celerity)
draggable = @driver.find('//div[@id="drag"]').first
droppable = @driver.find('//div[@id="drop"]').first
draggable.drag_to(droppable)
@driver.find('//div[contains(., "Dropped!")]').should_not be_nil
@driver.find('//div[contains(., "Dropped!")]').should_not be_empty
end
end

View File

@ -7,6 +7,26 @@ shared_examples_for "session with javascript support" do
after do
Capybara.default_wait_time = 0
end
describe '#drag' do
it "should drag and drop an object" do
pending "drag/drop is currently broken under celerity/culerity" if @session.driver.is_a?(Capybara::Driver::Celerity)
@session.visit('/with_js')
@session.drag('//div[@id="drag"]', '//div[@id="drop"]')
@session.locate('//div[contains(., "Dropped!")]').should_not be_nil
end
end
describe 'Node#drag_to' do
it "should drag and drop an object" do
pending "drag/drop is currently broken under celerity/culerity" if @session.driver.is_a?(Capybara::Driver::Celerity)
@session.visit('/with_js')
element = @session.locate('//div[@id="drag"]')
target = @session.locate('//div[@id="drop"]')
element.drag_to(target)
@session.find('//div[contains(., "Dropped!")]').should_not be_nil
end
end
describe '#find' do
it "should allow triggering of custom JS events" do