Sha256: 6e2eb9a3798fb38d85f203fafa2485d052d83688966165b44b43b0b12580d67b

Contents?: true

Size: 1.57 KB

Versions: 15

Compression:

Stored size: 1.57 KB

Contents

require "watirspec_helper"

describe "Element" do
  bug "Actions Endpoint Not Yet Implemented", :firefox do
    context "drag and drop" do
      before { browser.goto WatirSpec.url_for("drag_and_drop.html") }

      let(:draggable) { browser.div id: "draggable" }
      let(:droppable) { browser.div id: "droppable" }

      not_compliant_on :safari do
        it "can drag and drop an element onto another" do
          expect(droppable.text).to eq 'Drop here'
          draggable.drag_and_drop_on droppable
          expect(droppable.text).to eq 'Dropped!'
        end

        bug "http://code.google.com/p/selenium/issues/detail?id=3075", :ff_legacy do
          it "can drag and drop an element onto another when draggable is out of viewport" do
            reposition "draggable"
            perform_drag_and_drop_on_droppable
          end

          it "can drag and drop an element onto another when droppable is out of viewport" do
            reposition "droppable"
            perform_drag_and_drop_on_droppable
          end
        end

        it "can drag an element by the given offset" do
          expect(droppable.text).to eq 'Drop here'
          draggable.drag_and_drop_by 200, 50
          expect(droppable.text).to eq 'Dropped!'
        end

        def reposition(what)
          browser.button(id: "reposition#{what.capitalize}").click
        end

        def perform_drag_and_drop_on_droppable
          expect(droppable.text).to eq "Drop here"
          draggable.drag_and_drop_on droppable
          expect(droppable.text).to eq 'Dropped!'
        end
      end

    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
watir-6.5.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.4.3 spec/watirspec/drag_and_drop_spec.rb
watir-6.4.2 spec/watirspec/drag_and_drop_spec.rb
watir-6.4.1 spec/watirspec/drag_and_drop_spec.rb
watir-6.4.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.4.0.rc2 spec/watirspec/drag_and_drop_spec.rb
watir-6.4.0.rc1 spec/watirspec/drag_and_drop_spec.rb
watir-6.3.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.2.1 spec/watirspec/drag_and_drop_spec.rb
watir-6.2.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.1.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.0.3 spec/watirspec/drag_and_drop_spec.rb
watir-6.0.2 spec/watirspec/drag_and_drop_spec.rb
watir-6.0.1 spec/watirspec/drag_and_drop_spec.rb
watir-6.0.0 spec/watirspec/drag_and_drop_spec.rb