Sha256: dd4804d702ae40d1d61a8fbb1a5a24128f61fd718ecdaa1cc0e6f00aba95feb8

Contents?: true

Size: 1.56 KB

Versions: 3

Compression:

Stored size: 1.56 KB

Contents

require File.expand_path("../spec_helper", __FILE__)

module Selenium
  module WebDriver
    describe Mouse do

      not_compliant_on :browser => [:android, :iphone, :safari] do
        it "clicks an element" do
          driver.navigate.to url_for("formPage.html")
          driver.mouse.click driver.find_element(:id, "imageButton")
        end

        it "can drag and drop" do
          driver.navigate.to url_for("droppableItems.html")

          draggable = long_wait.until {
            driver.find_element(:id => "draggable")
          }

          droppable = driver.find_element(:id => "droppable")

          driver.mouse.down    draggable
          driver.mouse.move_to droppable
          driver.mouse.up      droppable

          text = droppable.find_element(:tag_name => "p").text
          text.should == "Dropped!"
        end

        it "double clicks an element" do
          driver.navigate.to url_for("javascriptPage.html")
          element = driver.find_element(:id, 'doubleClickField')

          driver.mouse.double_click element

          wait(5).until {
            element.attribute(:value) == 'DoubleClicked'
          }
        end

        not_compliant_on :browser => :phantomjs do
          it "context clicks an element" do
            driver.navigate.to url_for("javascriptPage.html")
            element = driver.find_element(:id, 'doubleClickField')

            driver.mouse.context_click element

            wait(5).until {
              element.attribute(:value) == 'ContextClicked'
            }
          end
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
browserstack-webdriver-2.40.1 spec/integration/selenium/webdriver/mouse_spec.rb
browserstack-webdriver-0.0.22 spec/integration/selenium/webdriver/mouse_spec.rb
browserstack-webdriver-0.0.1 spec/integration/selenium/webdriver/mouse_spec.rb