Commit bd4b0b52 authored by anonym's avatar anonym
Browse files

Update Unsafe Browser tests using the preferences.

In newer versions of Firefox the preferences live in a in-browser tab
that has a different style than the previous preferences window.
parent 4dc0c0d8
...@@ -168,22 +168,8 @@ end ...@@ -168,22 +168,8 @@ end
Then /^I cannot configure the Unsafe Browser to use any local proxies$/ do Then /^I cannot configure the Unsafe Browser to use any local proxies$/ do
next if @skip_steps_while_restoring_background next if @skip_steps_while_restoring_background
@screen.wait_and_click("UnsafeBrowserWindow.png", 10)
# First we open the proxy settings page to prepare it with the
# correct open tabs for the loop below.
@screen.click('UnsafeBrowserMenuButton.png')
@screen.wait_and_click('UnsafeBrowserPreferencesButton.png', 10)
@screen.wait('UnsafeBrowserPreferencesWindow.png', 10)
@screen.wait_and_click('UnsafeBrowserAdvancedSettings.png', 10)
@screen.wait_and_click('UnsafeBrowserNetworkTab.png', 10)
sleep 0.5
@screen.type(Sikuli::Key.ESC)
# @screen.waitVanish('UnsafeBrowserPreferences.png', 10)
sleep 0.5
socks_proxy = 'c' # Alt+c for socks proxy socks_proxy = 'c' # Alt+c for socks proxy
no_proxy = 'y' # Alt+y for no proxy no_proxy = 'y' # Alt+y for no proxy
proxies = [[socks_proxy, 9050], proxies = [[socks_proxy, 9050],
[socks_proxy, 9061], [socks_proxy, 9061],
[socks_proxy, 9062], [socks_proxy, 9062],
...@@ -199,8 +185,12 @@ Then /^I cannot configure the Unsafe Browser to use any local proxies$/ do ...@@ -199,8 +185,12 @@ Then /^I cannot configure the Unsafe Browser to use any local proxies$/ do
# Open proxy settings and select manual proxy configuration # Open proxy settings and select manual proxy configuration
@screen.click('UnsafeBrowserMenuButton.png') @screen.click('UnsafeBrowserMenuButton.png')
@screen.wait_and_click('UnsafeBrowserPreferencesButton.png', 10) @screen.wait_and_click('UnsafeBrowserPreferencesButton.png', 10)
@screen.wait('UnsafeBrowserPreferencesWindow.png', 10) @screen.wait_and_click('UnsafeBrowserAdvancedSettingsButton.png', 10)
@screen.type("e", Sikuli::KeyModifier.ALT) # Beyond the first iteration, the network tab will already be selected
hit, _ = @screen.waitAny(['UnsafeBrowserNetworkTabAlreadySelected.png',
'UnsafeBrowserNetworkTab.png'], 10)
@screen.click(hit) if hit == 'UnsafeBrowserNetworkTab.png'
@screen.wait_and_click('UnsafeBrowserNetworkTabSettingsButton.png', 10)
@screen.wait('UnsafeBrowserProxySettings.png', 10) @screen.wait('UnsafeBrowserProxySettings.png', 10)
@screen.type("m", Sikuli::KeyModifier.ALT) @screen.type("m", Sikuli::KeyModifier.ALT)
...@@ -212,9 +202,6 @@ Then /^I cannot configure the Unsafe Browser to use any local proxies$/ do ...@@ -212,9 +202,6 @@ Then /^I cannot configure the Unsafe Browser to use any local proxies$/ do
@screen.type(Sikuli::Key.ENTER) @screen.type(Sikuli::Key.ENTER)
# @screen.waitVanish('UnsafeBrowserProxySettings.png', 10) # @screen.waitVanish('UnsafeBrowserProxySettings.png', 10)
sleep 0.5 sleep 0.5
@screen.type(Sikuli::Key.ESC)
# @screen.waitVanish('UnsafeBrowserPreferences.png', 10)
sleep 0.5
# Test that the proxy settings work as they should # Test that the proxy settings work as they should
step "I open the address \"https://check.torproject.org\" in the Unsafe Browser" step "I open the address \"https://check.torproject.org\" in the Unsafe Browser"
...@@ -230,14 +217,13 @@ Then /^the Unsafe Browser has no proxy configured$/ do ...@@ -230,14 +217,13 @@ Then /^the Unsafe Browser has no proxy configured$/ do
next if @skip_steps_while_restoring_background next if @skip_steps_while_restoring_background
@screen.click('UnsafeBrowserMenuButton.png') @screen.click('UnsafeBrowserMenuButton.png')
@screen.wait_and_click('UnsafeBrowserPreferencesButton.png', 10) @screen.wait_and_click('UnsafeBrowserPreferencesButton.png', 10)
@screen.wait('UnsafeBrowserPreferencesWindow.png', 10) @screen.wait_and_click('UnsafeBrowserAdvancedSettingsButton.png', 10)
@screen.wait_and_click('UnsafeBrowserAdvancedSettings.png', 10)
@screen.wait_and_click('UnsafeBrowserNetworkTab.png', 10) @screen.wait_and_click('UnsafeBrowserNetworkTab.png', 10)
@screen.type("e", Sikuli::KeyModifier.ALT) @screen.wait_and_click('UnsafeBrowserNetworkTabSettingsButton.png', 10)
@screen.wait('UnsafeBrowserProxySettings.png', 10) @screen.wait('UnsafeBrowserProxySettings.png', 10)
@screen.wait('UnsafeBrowserNoProxySelected.png', 10) @screen.wait('UnsafeBrowserNoProxySelected.png', 10)
@screen.type(Sikuli::Key.F4, Sikuli::KeyModifier.ALT) @screen.type(Sikuli::Key.F4, Sikuli::KeyModifier.ALT)
@screen.type(Sikuli::Key.F4, Sikuli::KeyModifier.ALT) @screen.type("w", Sikuli::KeyModifier.CTRL)
end end
Then /^the Unsafe Browser complains that no DNS server is configured$/ do Then /^the Unsafe Browser complains that no DNS server is configured$/ do
......
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