summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--features/images/CupsTestPage.pngbin2859 -> 1908 bytes
-rw-r--r--features/images/SupportDocumentation.pngbin2099 -> 0 bytes
-rw-r--r--features/images/SupportDocumentationGerman.pngbin2629 -> 0 bytes
-rw-r--r--features/images/TorBrowserSaveOutputFileSelected.pngbin1647 -> 1718 bytes
-rw-r--r--features/images/TorBrowserSavedStartupPage.pngbin1700 -> 1250 bytes
-rw-r--r--features/step_definitions/browser.rb11
-rw-r--r--features/step_definitions/checks.rb15
-rw-r--r--features/step_definitions/common_steps.rb4
-rw-r--r--features/step_definitions/icedove.rb2
-rw-r--r--features/step_definitions/torified_misc.rb16
-rw-r--r--features/support/helpers/sikuli_helper.rb33
-rw-r--r--features/torified_misc.feature2
12 files changed, 68 insertions, 15 deletions
diff --git a/features/images/CupsTestPage.png b/features/images/CupsTestPage.png
index 65b3cac..916486e 100644
--- a/features/images/CupsTestPage.png
+++ b/features/images/CupsTestPage.png
Binary files differ
diff --git a/features/images/SupportDocumentation.png b/features/images/SupportDocumentation.png
deleted file mode 100644
index bccfb80..0000000
--- a/features/images/SupportDocumentation.png
+++ /dev/null
Binary files differ
diff --git a/features/images/SupportDocumentationGerman.png b/features/images/SupportDocumentationGerman.png
deleted file mode 100644
index 24c7708..0000000
--- a/features/images/SupportDocumentationGerman.png
+++ /dev/null
Binary files differ
diff --git a/features/images/TorBrowserSaveOutputFileSelected.png b/features/images/TorBrowserSaveOutputFileSelected.png
index 8de38a9..cda7a09 100644
--- a/features/images/TorBrowserSaveOutputFileSelected.png
+++ b/features/images/TorBrowserSaveOutputFileSelected.png
Binary files differ
diff --git a/features/images/TorBrowserSavedStartupPage.png b/features/images/TorBrowserSavedStartupPage.png
index f32a0f9..0d43813 100644
--- a/features/images/TorBrowserSavedStartupPage.png
+++ b/features/images/TorBrowserSavedStartupPage.png
Binary files differ
diff --git a/features/step_definitions/browser.rb b/features/step_definitions/browser.rb
index 896906b..fac23b7 100644
--- a/features/step_definitions/browser.rb
+++ b/features/step_definitions/browser.rb
@@ -116,14 +116,21 @@ end
# This step is limited to the Tor Browser due to #7502 since dogtail
# uses the same interface.
Then /^"([^"]+)" has loaded in the Tor Browser$/ do |title|
- expected_title = "#{title} - Tor Browser"
+ if @language == 'German'
+ browser_name = 'Tor-Browser'
+ reload_action = 'Aktuelle Seite neu laden'
+ else
+ browser_name = 'Tor Browser'
+ reload_action = 'Reload current page'
+ end
+ expected_title = "#{title} - #{browser_name}"
app = Dogtail::Application.new('Firefox')
app.child(expected_title, roleName: 'frame').wait(60)
# The 'Reload current page' button (graphically shown as a looping
# arrow) is only shown when a page has loaded, so once we see the
# expected title *and* this button has appeared, then we can be sure
# that the page has fully loaded.
- app.child('Reload current page', roleName: 'push button').wait(60)
+ app.child(reload_action, roleName: 'push button').wait(60)
end
Then /^the (.*) has no plugins installed$/ do |browser|
diff --git a/features/step_definitions/checks.rb b/features/step_definitions/checks.rb
index 06824b3..507a61b 100644
--- a/features/step_definitions/checks.rb
+++ b/features/step_definitions/checks.rb
@@ -140,7 +140,20 @@ Given /^I setup a filesystem share containing a sample PDF$/ do
end
Then /^the support documentation page opens in Tor Browser$/ do
- @screen.wait("SupportDocumentation#{@language}.png", 120)
+ if @language == 'German'
+ expected_title = 'Tails - Hilfe & Support'
+ expected_heading = 'Die Dokumentation durchsuchen'
+ else
+ expected_title = 'Tails - Support'
+ expected_heading = 'Search the documentation'
+ end
+ step "\"#{expected_title}\" has loaded in the Tor Browser"
+ headings = Dogtail::Application.new('Firefox')
+ .child(expected_title, roleName: 'document frame')
+ .children(roleName: 'heading')
+ assert(
+ headings.any? { |heading| heading.text == expected_heading }
+ )
end
Then /^MAT can clean some sample PDF file$/ do
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index e0ec4f3..722710d 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -5,7 +5,7 @@ def post_vm_start_hook
# focus to virt-viewer or similar) so we do that now rather than
# having an important click lost. The point we click should be
# somewhere where no clickable elements generally reside.
- @screen.click_point(@screen.w, @screen.h/2)
+ @screen.click_point(@screen.w - 1, @screen.h/2)
end
def activate_filesystem_shares
@@ -462,7 +462,7 @@ end
Given /^the Tor Browser (?:has started and )?load(?:ed|s) the (startup page|Tails roadmap)$/ do |page|
case page
when "startup page"
- title = 'Tails - News'
+ title = 'Tails - Dear Tails user'
when "Tails roadmap"
title = 'Roadmap - Tails - RiseupLabs Code Repository'
else
diff --git a/features/step_definitions/icedove.rb b/features/step_definitions/icedove.rb
index 4806622..7e94716 100644
--- a/features/step_definitions/icedove.rb
+++ b/features/step_definitions/icedove.rb
@@ -59,7 +59,7 @@ end
Then /^I see that only the (.+) addons are enabled in Icedove$/ do |addons|
expected_addons = addons.split(/, | and /)
actual_addons =
- @icedove_addons.child('amnesia branding', roleName: 'label')
+ @icedove_addons.child('TorBirdy', roleName: 'label')
.parent.parent.children(roleName: 'list item', recursive: false)
.map { |item| item.name }
expected_addons.each do |addon|
diff --git a/features/step_definitions/torified_misc.rb b/features/step_definitions/torified_misc.rb
index 7112776..7ccdb22 100644
--- a/features/step_definitions/torified_misc.rb
+++ b/features/step_definitions/torified_misc.rb
@@ -1,3 +1,5 @@
+require 'resolv'
+
When /^I query the whois directory service for "([^"]+)"$/ do |domain|
retry_tor do
@vm_execute_res = $vm.execute("whois '#{domain}'", :user => LIVE_USER)
@@ -9,10 +11,18 @@ When /^I query the whois directory service for "([^"]+)"$/ do |domain|
end
end
-When /^I wget "([^"]+)" to stdout(?:| with the '([^']+)' options)$/ do |url, options|
- arguments = "-O - '#{url}'"
- arguments = "#{options} #{arguments}" if options
+When /^I wget "([^"]+)" to stdout(?:| with the '([^']+)' options)$/ do |target, options|
retry_tor do
+ if target == "some Tails mirror"
+ host = 'dl.amnesia.boum.org'
+ address = Resolv.new.getaddresses(host).sample
+ puts "Resolved #{host} to #{address}"
+ url = "http://#{address}/tails/stable/"
+ else
+ url = target
+ end
+ arguments = "-O - '#{url}'"
+ arguments = "#{options} #{arguments}" if options
@vm_execute_res = $vm.execute("wget #{arguments}", :user => LIVE_USER)
if @vm_execute_res.failure?
raise "wget:ing #{url} with options #{options} failed with:\n" +
diff --git a/features/support/helpers/sikuli_helper.rb b/features/support/helpers/sikuli_helper.rb
index 2eb0667..4455ecc 100644
--- a/features/support/helpers/sikuli_helper.rb
+++ b/features/support/helpers/sikuli_helper.rb
@@ -1,9 +1,19 @@
require 'rjb'
require 'rjbextension'
$LOAD_PATH << ENV['SIKULI_HOME']
-require 'sikuli-script.jar'
+begin
+ require 'sikulixapi.jar'
+ USING_SIKULIX = true
+rescue LoadError
+ require 'sikuli-script.jar'
+ USING_SIKULIX = false
+end
Rjb::load
+def using_sikulix?
+ USING_SIKULIX
+end
+
package_members = [
"java.io.FileOutputStream",
"java.io.PrintStream",
@@ -16,11 +26,18 @@ package_members = [
"org.sikuli.script.Pattern",
"org.sikuli.script.Region",
"org.sikuli.script.Screen",
- "org.sikuli.script.Settings",
]
+if using_sikulix?
+ package_members << "org.sikuli.basics.Settings"
+ package_members << "org.sikuli.script.ImagePath"
+else
+ package_members << "org.sikuli.script.Settings"
+end
+
translations = Hash[
"org.sikuli.script", "Sikuli",
+ "org.sikuli.basics", "Sikuli",
"java.lang", "Java::Lang",
"java.io", "Java::Io",
]
@@ -186,14 +203,20 @@ def sikuli_script_proxy.new(*args)
end
def s.hide_cursor
- self.hover_point(self.w, self.h/2)
+ self.hover_point(self.w - 1, self.h/2)
end
s
end
# Configure sikuli
-java.lang.System.setProperty("SIKULI_IMAGE_PATH", "#{Dir.pwd}/features/images/")
+if using_sikulix?
+ Sikuli::ImagePath.add("#{Dir.pwd}/features/images/")
+else
+ java.lang.System.setProperty("SIKULI_IMAGE_PATH",
+ "#{Dir.pwd}/features/images/")
+ ENV["SIKULI_IMAGE_PATH"] = "#{Dir.pwd}/features/images/"
+end
# ruby and rjb doesn't play well together when it comes to static
# fields (and possibly methods) so we instantiate and access the field
@@ -211,4 +234,4 @@ sikuli_settings.MinSimilarity = 0.9
sikuli_settings.ActionLogs = true
sikuli_settings.DebugLogs = true
sikuli_settings.InfoLogs = true
-sikuli_settings.ProfileLogs = true
+sikuli_settings.ProfileLogs = false
diff --git a/features/torified_misc.feature b/features/torified_misc.feature
index 5bb83c8..aab694a 100644
--- a/features/torified_misc.feature
+++ b/features/torified_misc.feature
@@ -15,7 +15,7 @@ Feature: Various checks for torified software
And the wget standard output contains "Example Domain"
Scenario: wget(1) with tricky options should work for HTTP and go through Tor.
- When I wget "http://195.154.14.189/tails/stable/" to stdout with the '--spider --header="Host: dl.amnesia.boum.org"' options
+ When I wget "some Tails mirror" to stdout with the '--spider --header="Host: dl.amnesia.boum.org"' options
Then the wget command is successful
Scenario: whois(1) should work and go through Tor.