1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/lib/capybara/spec/session/title_spec.rb

30 lines
817 B
Ruby
Raw Normal View History

2016-03-07 19:52:19 -05:00
# frozen_string_literal: true
2018-02-28 19:11:41 -05:00
Capybara::SpecHelper.spec '#title' do
2018-07-10 17:18:39 -04:00
it 'should get the title of the page' do
@session.visit('/with_title')
expect(@session.title).to eq('Test Title')
end
2018-07-10 17:18:39 -04:00
context 'with css as default selector' do
before { Capybara.default_selector = :css }
2018-06-19 16:57:42 -04:00
2018-08-27 12:34:33 -04:00
after { Capybara.default_selector = :xpath }
2018-07-10 17:18:39 -04:00
it 'should get the title of the page' do
@session.visit('/with_title')
expect(@session.title).to eq('Test Title')
end
end
2018-07-10 17:18:39 -04:00
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
2016-03-07 19:52:19 -05:00
end