Sha256: 1e878d45efb4ea34626ec5b19ca01062e09d809fe0bc0bcef0065e41d2e5176b

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

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


module Selenium::WebDriver::DriverExtensions
  describe "HasApplicationCache" do

    compliant_on :browser => nil do
      it "gets the app cache status" do
        driver.application_cache.status.should == :uncached

        driver.online = false
        driver.navigate.to url_for("html5Page.html")

        browser.application_cache.status.should == :idle
      end

      it "loads from cache when offline" do
        driver.get url_for("html5Page.html")
        driver.get url_for("formPage.html")

        driver.online = false

        driver.get url_for("html5Page.html")
        driver.title.should == "HTML5"
      end

      it "gets the app cache entries" do
        # dependant on spec above?!

        driver.get url_for("html5Page")

        entries = driver.application_cache.to_a
        entries.size.should > 2

        entries.each do |e|
          case e.url
          when /red\.jpg/
            e.type.value.should == :master
          when /yellow\.jpg/
            e.type.value.should == :explicit
          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/app_cache_spec.rb
browserstack-webdriver-0.0.22 spec/integration/selenium/webdriver/app_cache_spec.rb
browserstack-webdriver-0.0.1 spec/integration/selenium/webdriver/app_cache_spec.rb