Commit 30ee168c authored by Tails developers's avatar Tails developers
Browse files

Refactor steps so they are shared between the different browsers.

parent 35b494ca
TorBrowserAddressBar.png
\ No newline at end of file
......@@ -553,18 +553,26 @@ def xul_application_info(application)
user = $live_user
cmd_regex = "#{binary} .* -profile /home/#{user}/\.tor-browser/profile\.default"
chroot = ""
new_tab_button_image = "TorBrowserNewTabButton.png"
address_bar_image = "TorBrowserAddressBar.png"
when "Unsafe Browser"
user = "clearnet"
cmd_regex = "#{binary} .* -profile /home/#{user}/\.unsafe-browser/profile\.default"
chroot = "/var/lib/unsafe-browser/chroot"
new_tab_button_image = "UnsafeBrowserNewTabButton.png"
address_bar_image = "UnsafeBrowserAddressBar.png"
when "I2P Browser"
user = "i2pbrowser"
cmd_regex = "#{binary} .* -profile /home/#{user}/\.i2p-browser/profile\.default"
chroot = "/var/lib/i2p-browser/chroot"
new_tab_button_image = nil
address_bar_image = nil
when "Tor Launcher"
user = "tor-launcher"
cmd_regex = "#{binary} -app /home/#{user}/\.tor-launcher/tor-launcher-standalone/application\.ini"
chroot = ""
new_tab_button_image = nil
address_bar_image = nil
else
raise "Invalid browser or XUL application: #{application}"
end
......@@ -572,9 +580,33 @@ def xul_application_info(application)
:user => user,
:cmd_regex => cmd_regex,
:chroot => chroot,
:new_tab_button_image => new_tab_button_image,
:address_bar_image => address_bar_image,
}
end
When /^I open a new tab in the (.*)$/ do |browser|
next if @skip_steps_while_restoring_background
info = xul_application_info(browser)
@screen.click(info[:new_tab_button_image])
@screen.wait(info[:address_bar_image], 10)
end
When /^I open the address "([^"]*)" in the (.*)$/ do |address, browser|
next if @skip_steps_while_restoring_background
step "I open a new tab in the #{browser}"
info = xul_application_info(browser)
@screen.click(info[:address_bar_image])
sleep 0.5
@screen.type(address + Sikuli::Key.ENTER)
end
Then /^the (.*) has no plugins installed$/ do |browser|
next if @skip_steps_while_restoring_background
step "I open the address \"about:plugins\" in the #{browser}"
step "I see \"TorBrowserNoPlugins.png\" after at most 30 seconds"
end
def xul_app_shared_lib_check(pid, chroot)
expected_absent_tbb_libs = ['libnssdbm3.so']
absent_tbb_libs = []
......
When /^I open a new tab in the Tor Browser$/ do
next if @skip_steps_while_restoring_background
@screen.click("TorBrowserNewTabButton.png")
@screen.wait("TorBrowserAddressBar.png", 10)
end
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 the Tor Browser"
@screen.click("TorBrowserAddressBar.png")
sleep 0.5
@screen.type(address + Sikuli::Key.ENTER)
end
......@@ -59,20 +59,6 @@ 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_and_click("UnsafeBrowserWindow.png", 10)
@screen.type("t", Sikuli::KeyModifier.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::KeyModifier.CTRL)
sleep 0.5
@screen.type(address + Sikuli::Key.ENTER)
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)
......
......@@ -31,5 +31,4 @@ Feature: Browsing the web using the Tor Browser
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
Then the Tor Browser has no plugins installed
Supports Markdown
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