Commit b715ce42 authored by anonym's avatar anonym
Browse files

Test suite: fixes to make 3.0~beta3 pass.

This includes:

* fixing some mistakes in the merge conflict resolution
  28cf4852.

* switching to an image in the Pidgin tests that doesn't depend on the
  /topic of tails@conference.riseup.net -- the server resets it every
  once in a while, so we should not pretend the test suite can always
  find it.

* Fix a problematic use of try_for (we need refs: #9223!).

* Fix for VM.select_virtual_desktop() and VM.do_focus(): in Stretch we
  only have two virtual desktop, so do_focus() has been broken for a
  while. Also add some `sleep()`:s which sadly seem required.

* Random Gherkin improvement.
parent 4418bd85
...@@ -6,14 +6,10 @@ When /^I start the Unsafe Browser(?: through the GNOME menu)?$/ do ...@@ -6,14 +6,10 @@ When /^I start the Unsafe Browser(?: through the GNOME menu)?$/ do
step "I start \"Unsafe Browser\" via the GNOME \"Internet\" applications menu" step "I start \"Unsafe Browser\" via the GNOME \"Internet\" applications menu"
end end
Then /^I see the Unsafe Browser start notification and wait for it to close$/ do
robust_notification_wait("UnsafeBrowserStartNotification.png", 60)
end
When /^I successfully start the Unsafe Browser$/ do When /^I successfully start the Unsafe Browser$/ do
step "I start the Unsafe Browser" step "I start the Unsafe Browser"
step "I see and accept the Unsafe Browser start verification" step "I see and accept the Unsafe Browser start verification"
step "I see the Unsafe Browser start notification and wait for it to close" step "I see the \"Starting the Unsafe Browser...\" notification after at most 60 seconds"
step "the Unsafe Browser has started" step "the Unsafe Browser has started"
end end
...@@ -21,10 +17,6 @@ When /^I close the Unsafe Browser$/ do ...@@ -21,10 +17,6 @@ When /^I close the Unsafe Browser$/ do
@screen.type("q", Sikuli::KeyModifier.CTRL) @screen.type("q", Sikuli::KeyModifier.CTRL)
end end
Then /^I see the Unsafe Browser stop notification$/ do
robust_notification_wait("UnsafeBrowserStopNotification.png", 60)
end
def xul_application_info(application) def xul_application_info(application)
binary = $vm.execute_successfully( binary = $vm.execute_successfully(
'echo ${TBB_INSTALL}/firefox', :libs => 'tor-browser' 'echo ${TBB_INSTALL}/firefox', :libs => 'tor-browser'
......
...@@ -244,11 +244,12 @@ Given /^Tails is at the boot menu's cmdline( after rebooting)?$/ do |reboot| ...@@ -244,11 +244,12 @@ Given /^Tails is at the boot menu's cmdline( after rebooting)?$/ do |reboot|
'resetting...') 'resetting...')
dealt_with_uefi_setup = false dealt_with_uefi_setup = false
$vm.reset $vm.reset
retry raise e
ensure ensure
Process.kill("TERM", tab_spammer.pid) Process.kill("TERM", tab_spammer.pid)
tab_spammer.close tab_spammer.close
end end
true
end end
end end
......
...@@ -466,4 +466,5 @@ end ...@@ -466,4 +466,5 @@ end
When /^I click on the Tails roadmap URL$/ do When /^I click on the Tails roadmap URL$/ do
@screen.click('PidginTailsRoadmapUrl.png') @screen.click('PidginTailsRoadmapUrl.png')
try_for(60) { @torbrowser = Dogtail::Application.new('Firefox') }
end end
...@@ -168,7 +168,11 @@ Then /^the Unsafe Browser has no proxy configured$/ do ...@@ -168,7 +168,11 @@ Then /^the Unsafe Browser has no proxy configured$/ do
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
@screen.wait("UnsafeBrowserDNSError.png", 30) assert_not_nil(
Dogtail::Application.new('zenity')
.child(roleName: 'label')
.text['No DNS server was obtained']
)
end end
Then /^I configure the Unsafe Browser to check for updates more frequently$/ do Then /^I configure the Unsafe Browser to check for updates more frequently$/ do
......
...@@ -473,7 +473,7 @@ class VM ...@@ -473,7 +473,7 @@ class VM
def select_virtual_desktop(desktop_number, user = LIVE_USER) def select_virtual_desktop(desktop_number, user = LIVE_USER)
assert(desktop_number >= 0 && desktop_number <=3, assert(desktop_number >= 0 && desktop_number <=3,
"Only values between 0 and 3 are valid virtual desktop numbers") "Only values between 0 and 1 are valid virtual desktop numbers")
execute_successfully( execute_successfully(
"xdotool set_desktop '#{desktop_number}'", "xdotool set_desktop '#{desktop_number}'",
:user => user :user => user
...@@ -494,11 +494,17 @@ class VM ...@@ -494,11 +494,17 @@ class VM
# Often when xdotool fails to focus a window it'll work when retried # Often when xdotool fails to focus a window it'll work when retried
# after redrawing the screen. Switching to a new virtual desktop then # after redrawing the screen. Switching to a new virtual desktop then
# back seems to be a reliable way to handle this. # back seems to be a reliable way to handle this.
select_virtual_desktop(3) # Sadly we have to rely on a lot of sleep() here since there's
# little on the screen etc that we truly can rely on.
sleep 5
select_virtual_desktop(1)
sleep 5
select_virtual_desktop(0) select_virtual_desktop(0)
sleep 5 # there aren't any visual indicators which can be used here sleep 5
do_focus(window_title, user) do_focus(window_title, user)
end end
rescue
# noop
end end
def file_exist?(file) def file_exist?(file)
......
...@@ -158,7 +158,7 @@ Feature: Browsing the web using the Tor Browser ...@@ -158,7 +158,7 @@ Feature: Browsing the web using the Tor Browser
And all persistent filesystems have safe access rights And all persistent filesystems have safe access rights
And all persistence configuration files have safe access rights And all persistence configuration files have safe access rights
And all persistent directories have safe access rights And all persistent directories have safe access rights
And I start the Tor Browser in offline mode When I start the Tor Browser in offline mode
And I add a bookmark to eff.org in the Tor Browser And I add a bookmark to eff.org in the Tor Browser
And I warm reboot the computer And I warm reboot the computer
And the computer reboots Tails And the computer reboots Tails
......
...@@ -33,7 +33,7 @@ Feature: Browsing the web using the Unsafe Browser ...@@ -33,7 +33,7 @@ Feature: Browsing the web using the Unsafe Browser
Given I have started Tails from DVD and logged in and the network is connected Given I have started Tails from DVD and logged in and the network is connected
When I successfully start the Unsafe Browser When I successfully start the Unsafe Browser
And I close the Unsafe Browser And I close the Unsafe Browser
Then I see the Unsafe Browser stop notification Then I see the "Shutting down the Unsafe Browser..." notification after at most 60 seconds
And the Unsafe Browser chroot is torn down And the Unsafe Browser chroot is torn down
#11458 #11458
......
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