Sha256: 0dd55ddbab0f082454e61512613cc031d2c48cbf2665fa16406f80aee3a6485c

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 KB

Contents

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

describe "Navigation" do
  let(:wait) { Selenium::WebDriver::Wait.new :timeout => 10 }

  not_compliant_on :browser => :safari do
    it "should navigate back and forward" do
      form_title   = "We Leave From Here"
      result_title = "We Arrive Here"
      form_url     = url_for "formPage.html"
      result_url   = url_for "resultPage.html"

      driver.navigate.to form_url
      driver.title.should == form_title

      driver.find_element(:id, 'imageButton').submit
      wait.until { driver.title != form_title }

      driver.current_url.should include(result_url)
      driver.title.should == result_title

      driver.navigate.back

      driver.current_url.should include(form_url)
      driver.title.should == form_title

      driver.navigate.forward
      driver.current_url.should include(result_url)
      driver.title.should == result_title
    end

    it "should refresh the page" do
      changed_title = "Changed"

      driver.navigate.to url_for("javascriptPage.html")
      driver.find_element(:link_text, "Change the page title!").click
      driver.title.should == changed_title

      driver.navigate.refresh
      wait.until { driver.title != changed_title }

      driver.title.should == "Testing Javascript"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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