Commit 8c176bbb authored by Tails developers's avatar Tails developers
Browse files

Fix automated test suite for migration to TBB.

Beyond s/Iceweasel/Tor Browser/ (incl. renaming affected images) we
also try to rely more on clicking on GUI elements instead of keyboard
shortcuts. The TBB is noticeably slower on start, and often loses key
presses at that stage, so clicking is much more reliable then.

The most remarkable change may be the switch to the step "the Tor
Browser has started and loaded the startup page". It seems a fair
amount of complexity is required to reliably stop the loading of the
startup page so this simpler approach seems better, and as a bonus it
actualy tests the startup page. The issue described in the removed
comment doesn't seem very relevant any more, too.
parent 63d7e04d
......@@ -240,21 +240,17 @@ Given /^available upgrades have been checked$/ do
}
end
Given /^Iceweasel has started and is not loading a web page$/ do
Given /^the Tor Browser has started and loaded the startup page$/ do
next if @skip_steps_while_restoring_background
case @theme
when "windows"
iceweasel_picture = "WindowsIceweaselWindow.png"
tor_browser_picture = "WindowsTorBrowserWindow.png"
else
iceweasel_picture = "IceweaselWindow.png"
tor_browser_picture = "TorBrowserWindow.png"
end
# Stop iceweasel to load its home page. We do this to prevent Tor
# from getting confused in case we save and restore a snapshot in
# the middle of loading a page.
@screen.wait_and_click(iceweasel_picture, 120)
@screen.type("l", Sikuli::KeyModifier.CTRL)
@screen.type("about:blank" + Sikuli::Key.ENTER)
@screen.wait(tor_browser_picture, 60)
@screen.wait("TorBrowserStartupPage.png", 120)
end
Given /^all notifications have disappeared$/ do
......@@ -425,17 +421,17 @@ Given /^package "([^"]+)" is installed$/ do |package|
"Package '#{package}' is not installed")
end
When /^I start Iceweasel$/ do
When /^I start the Tor Browser$/ do
next if @skip_steps_while_restoring_background
case @theme
when "windows"
step 'I click the start menu'
@screen.wait_and_click("WindowsApplicationsInternet.png", 10)
@screen.wait_and_click("WindowsApplicationsIceweasel.png", 10)
@screen.wait_and_click("WindowsApplicationsTorBrowser.png", 10)
else
@screen.wait_and_click("GnomeApplicationsMenu.png", 10)
@screen.wait_and_click("GnomeApplicationsInternet.png", 10)
@screen.wait_and_click("GnomeApplicationsIceweasel.png", 10)
@screen.wait_and_click("GnomeApplicationsTorBrowser.png", 10)
end
end
......
When /^I open a new tab in Iceweasel$/ do
When /^I open a new tab in the Tor Browser$/ do
next if @skip_steps_while_restoring_background
@screen.wait_and_click("IceweaselWindow.png", 10)
@screen.type("t", Sikuli::KeyModifier.CTRL)
@screen.click("TorBrowserNewTabButton.png")
end
When /^I open the address "([^"]*)" in Iceweasel$/ do |address|
When /^I open the address "([^"]*)" in the Tor Browser$/ do |address|
next if @skip_steps_while_restoring_background
step "I open a new tab in Iceweasel"
@screen.type("l", Sikuli::KeyModifier.CTRL)
step "I open a new tab in the Tor Browser"
@screen.click("TorBrowserAddressBar.png")
sleep 0.5
@screen.type(address + Sikuli::Key.ENTER)
end
......@@ -78,12 +78,11 @@ end
Then /^I cannot configure the Unsafe Browser to use any local proxies$/ do
next if @skip_steps_while_restoring_background
@screen.wait_and_click("UnsafeBrowserWindow.png", 10)
sleep 0.5
# First we open the proxy settings page to prepare it with the
# correct open tabs for the loop below.
@screen.type("e", Sikuli::KeyModifier.ALT)
@screen.type("n")
@screen.wait('UnsafeBrowserPreferences.png', 10)
@screen.wait_and_click('UnsafeBrowserEditMenu.png', 10)
@screen.wait_and_click('UnsafeBrowserEditPreferences.png', 10)
@screen.wait('UnsafeBrowserPreferencesWindow.png', 10)
@screen.wait_and_click('UnsafeBrowserAdvancedSettings.png', 10)
@screen.wait_and_click('UnsafeBrowserNetworkTab.png', 10)
sleep 0.5
......@@ -109,10 +108,12 @@ Then /^I cannot configure the Unsafe Browser to use any local proxies$/ do
proxy_type = proxy[0]
proxy_port = proxy[1]
@screen.hide_cursor
# Open proxy settings and select manual proxy configuration
@screen.type("e", Sikuli::KeyModifier.ALT)
@screen.type("n")
@screen.wait('UnsafeBrowserPreferences.png', 10)
@screen.wait_and_click('UnsafeBrowserEditMenu.png', 10)
@screen.wait_and_click('UnsafeBrowserEditPreferences.png', 10)
@screen.wait('UnsafeBrowserPreferencesWindow.png', 10)
@screen.type("e", Sikuli::KeyModifier.ALT)
@screen.wait('UnsafeBrowserProxySettings.png', 10)
@screen.type("m", Sikuli::KeyModifier.ALT)
......
@product
Feature: Browsing the web using Iceweasel
Feature: Browsing the web using the Tor Browser
As a Tails user
when I browse the web using Iceweasel
when I browse the web using the Tor Browser
all Internet traffic should flow only through Tor
Background:
......@@ -16,15 +16,15 @@ Feature: Browsing the web using Iceweasel
And all notifications have disappeared
And I save the state so the background can be restored next scenario
Scenario: Opening check.torproject.org in Iceweasel shows the green onion and the congratulations message
When I start Iceweasel
And Iceweasel has started and is not loading a web page
And I open the address "https://check.torproject.org" in Iceweasel
Then I see "IceweaselTorCheck.png" after at most 180 seconds
Scenario: Opening check.torproject.org in the Tor Browser shows the green onion and the congratulations message
When I start the Tor Browser
And the Tor Browser has started and loaded the startup page
And I open the address "https://check.torproject.org" in the Tor Browser
Then I see "TorBrowserTorCheck.png" after at most 180 seconds
And all Internet traffic has only flowed through Tor
Scenario: Iceweasel should not have any plugins enabled
When I start Iceweasel
And Iceweasel has started and is not loading a web page
And I open the address "about:plugins" in Iceweasel
Then I see "IceweaselNoPlugins.png" after at most 60 seconds
Scenario: The Tor Browser should not have any plugins enabled
When I start the Tor Browser
And the Tor Browser has started and loaded the startup page
And I open the address "about:plugins" in the Tor Browser
Then I see "TorBrowserNoPlugins.png" after at most 60 seconds
......@@ -26,9 +26,9 @@ Feature: Microsoft Windows Camouflage
And Tor is ready
And all notifications have disappeared
And available upgrades have been checked
And I start Iceweasel
Then I see "WindowsIceweaselWindow.png" after at most 120 seconds
And I see "WindowsIceweaselTaskBar.png" after at most 10 seconds
And I start the Tor Browser
Then I see "WindowsTorBrowserWindow.png" after at most 120 seconds
And I see "WindowsTorBrowserTaskBar.png" after at most 10 seconds
And I see "WindowsWindowButtons.png" after at most 10 seconds
Scenario: The panel menu should look like Microsoft Windows's start menu
......
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