Sha256: d772b35d0ea561eced8dec618af048ef5521cbf9042b3efb796f1d7cab377ca1

Contents?: true

Size: 1.54 KB

Versions: 22

Compression:

Stored size: 1.54 KB

Contents

require "watirspec_helper"

describe "Element" do
  not_compliant_on %i(remote firefox) do
    bug "Safari does not strip text", :safari 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" }

        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

        not_compliant_on :headless, :firefox 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

22 entries across 22 versions & 1 rubygems

Version Path
watir-6.13.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.12.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.11.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.11.0.beta2 spec/watirspec/drag_and_drop_spec.rb
watir-6.11.0.beta1 spec/watirspec/drag_and_drop_spec.rb
watir-6.10.3 spec/watirspec/drag_and_drop_spec.rb
watir-6.10.2 spec/watirspec/drag_and_drop_spec.rb
watir-6.10.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.9.1 spec/watirspec/drag_and_drop_spec.rb
watir-6.9.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.8.4 spec/watirspec/drag_and_drop_spec.rb
watir-6.8.3 spec/watirspec/drag_and_drop_spec.rb
watir-6.8.2 spec/watirspec/drag_and_drop_spec.rb
watir-6.8.1 spec/watirspec/drag_and_drop_spec.rb
watir-6.8.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.7.3 spec/watirspec/drag_and_drop_spec.rb
watir-6.7.2 spec/watirspec/drag_and_drop_spec.rb
watir-6.7.1 spec/watirspec/drag_and_drop_spec.rb
watir-6.7.0 spec/watirspec/drag_and_drop_spec.rb
watir-6.6.3 spec/watirspec/drag_and_drop_spec.rb