1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
# 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 }
after { Capybara.default_selector = :xpath }
it 'should get the title of the page' do
@session.visit('/with_title')
expect(@session.title).to eq('Test Title')
end
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
|