forked from SeleniumHQ/seleniumhq.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnavigation_spec.rb
More file actions
34 lines (28 loc) · 1.02 KB
/
navigation_spec.rb
File metadata and controls
34 lines (28 loc) · 1.02 KB
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
30
31
32
33
34
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Browser' do
let(:driver) { start_session }
it 'navigates to a page' do
driver.navigate.to 'https://www.selenium.dev/'
driver.get 'https://www.selenium.dev/'
expect(driver.current_url).to eq 'https://www.selenium.dev/'
end
it 'navigates back' do
driver.navigate.to 'https://www.selenium.dev/'
driver.navigate.to 'https://www.selenium.dev/selenium/web/inputs.html'
driver.navigate.back
expect(driver.current_url).to eq 'https://www.selenium.dev/'
end
it 'navigates forward' do
driver.navigate.to 'https://www.selenium.dev/'
driver.navigate.to 'https://www.selenium.dev/selenium/web/inputs.html'
driver.navigate.back
driver.navigate.forward
expect(driver.current_url).to eq 'https://www.selenium.dev/selenium/web/inputs.html'
end
it 'refreshes the page' do
driver.navigate.to 'https://www.selenium.dev/'
driver.navigate.refresh
expect(driver.current_url).to eq 'https://www.selenium.dev/'
end
end