Commit ab32e31f authored by Tails developers's avatar Tails developers
Browse files

Add feature testing the Unsafe Browser.

parent 588e002a
......@@ -187,6 +187,11 @@ Given /^process "([^"]+)" is running$/ do |process|
assert guest_has_process?(process)
end
Given /^I have killed the process "([^"]+)"$/ do |process|
next if @skip_steps_while_restoring_background
assert @vm.execute("killall #{process}").success?
end
Given /^I shutdown Tails$/ do
next if @skip_steps_while_restoring_background
assert @vm.execute("halt").success?
......
When /^I see and accept the Unsafe Browser start verification$/ do
@screen.wait("UnsafeBrowserStartVerification.png", 10)
@screen.type("l", Sikuli::KEY_ALT)
end
Then /^I see and close the Unsafe Browser start notification$/ do
@screen.wait("UnsafeBrowserStartNotification.png", 10)
@screen.click("UnsafeBrowserStartNotification.png")
@screen.hide_cursor
end
Then /^the Unsafe Browser has started$/ do
@screen.wait("UnsafeBrowserWindow.png", 30)
end
Then /^the Unsafe Browser has a red theme$/ do
@screen.wait("UnsafeBrowserRedTheme.png", 10)
end
Then /^the Unsafe Browser has Wikipedia pre-selected in the search bar$/ do
@screen.wait("UnsafeBrowserSearchBar.png", 10)
end
Then /^the Unsafe Browser shows a warning as its start page$/ do
@screen.wait("UnsafeBrowserStartPage.png", 10)
end
When /^I start the Unsafe Browser$/ do
step "I run \"gksu unsafe-browser\""
step "I see and accept the Unsafe Browser start verification"
step "I see and close the Unsafe Browser start notification"
step "the Unsafe Browser has started"
end
Then /^I see a warning about another instance already running$/ do
@screen.wait('UnsafeBrowserWarnAlreadyRunning.png', 10)
end
When /^close the Unsafe Browser$/ do
@screen.type("q", Sikuli::KEY_CTRL)
end
Then /^I see the Unsafe Browser stop notification$/ do
@screen.wait('UnsafeBrowserStopNotification.png', 20)
@screen.waitVanish('UnsafeBrowserStopNotification.png', 20)
end
Then /^I can start the Unsafe Browser again$/ do
step "I start the Unsafe Browser"
end
When /^I open a new tab in the Unsafe Browser$/ do
next if @skip_steps_while_restoring_background
@screen.wait("UnsafeBrowserWindow.png", 10)
@screen.click("UnsafeBrowserWindow.png")
@screen.type("t", Sikuli::KEY_CTRL)
end
When /^I open the address "([^"]*)" in the Unsafe Browser$/ do |address|
next if @skip_steps_while_restoring_background
step "I open a new tab in the Unsafe Browser"
@screen.type("l", Sikuli::KEY_CTRL)
@screen.type(address + Sikuli::KEY_RETURN)
end
Feature: Browsing the web using the Unsafe Browser
As a Tails user
when I browse the web using the Unsafe Browser
I should have direct access to the web
Background:
Given I restore the background snapshot if it exists
And a freshly started Tails
And I log in to a new session
And GNOME has started
And I have a network connection
And Tor has built a circuit
And Iceweasel has autostarted and is not loading a web page
And I have killed the process "firefox-bin"
And the time has synced
And I have closed all annoying notifications
And I save the background snapshot if it does not exist
Scenario: Closing the Unsafe Browser shows a stop notification.
When I start the Unsafe Browser
And close the Unsafe Browser
Then I see the Unsafe Browser stop notification
Scenario: Starting the Unsafe Browser works as it should.
When I run "gksu unsafe-browser"
And I see and accept the Unsafe Browser start verification
Then I see and close the Unsafe Browser start notification
And the Unsafe Browser has started
And the Unsafe Browser has a red theme
And the Unsafe Browser has Wikipedia pre-selected in the search bar
And the Unsafe Browser shows a warning as its start page
Scenario: Starting a second instance of the Unsafe Browser results in an error message being shown.
When I start the Unsafe Browser
And I run "gksu unsafe-browser"
Then I see a warning about another instance already running
Scenario: The Unsafe Browser cannot be restarted before the previous instance has been cleaned up.
When I start the Unsafe Browser
And close the Unsafe Browser
And I run "gksu unsafe-browser"
Then I see a warning about another instance already running
Scenario: Opening check.torproject.org in the Unsafe Browser will show the red onion and the warning message.
When I start the Unsafe Browser
And I open the address "https://check.torproject.org" in the Unsafe Browser
Then I see "UnsafeBrowserTorCheckFail.png" after at most 30 seconds
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment