Sha256: dc5728689476d926a8ad90d936baef21a2c3271b6e38ec983aaa91a358449852

Contents?: true

Size: 815 Bytes

Versions: 10

Compression:

Stored size: 815 Bytes

Contents

# frozen_string_literal: true

Capybara::SpecHelper.spec '#title' do
  it "should get the title of the page" do
    @session.visit('/with_title')
    expect(@session.title).to eq('Test Title')
  end

  context "with css as default selector" do
    before { Capybara.default_selector = :css }
    it "should get the title of the page" do
      @session.visit('/with_title')
      expect(@session.title).to eq('Test Title')
    end
    after { Capybara.default_selector = :xpath }
  end

  context "within iframe", requires: [:frames] do
    it "should get the title of the top level browsing context" do
      @session.visit('/within_frames')
      expect(@session.title).to eq('With Frames')
      @session.within_frame('frameOne') do
        expect(@session.title).to eq('With Frames')
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
tdiary-5.0.9 vendor/bundle/gems/capybara-3.2.1/lib/capybara/spec/session/title_spec.rb
capybara-3.2.1 lib/capybara/spec/session/title_spec.rb
capybara-3.2.0 lib/capybara/spec/session/title_spec.rb
capybara-3.1.1 lib/capybara/spec/session/title_spec.rb
capybara-3.1.0 lib/capybara/spec/session/title_spec.rb
capybara-3.0.3 lib/capybara/spec/session/title_spec.rb
capybara-3.0.2 lib/capybara/spec/session/title_spec.rb
capybara-3.0.1 lib/capybara/spec/session/title_spec.rb
capybara-3.0.0 lib/capybara/spec/session/title_spec.rb
capybara-3.0.0.rc2 lib/capybara/spec/session/title_spec.rb