summaryrefslogtreecommitdiffstats
path: root/features/step_definitions/evince.rb
diff options
context:
space:
mode:
authorPhilip Hands <phil@hands.com>2016-03-14 15:36:16 +0100
committerHolger Levsen <holger@layer-acht.org>2016-04-28 21:52:10 +0200
commitda080c472fc415b0ce918f4dd4a1ab143bb1bca4 (patch)
treebf63179f32f0eda0c2d5796e3e31c18c3c1185cf /features/step_definitions/evince.rb
parent26a9e8ec2bcae03db4d663d87b44d8708d64fdc2 (diff)
downloadjenkins.debian.net-da080c472fc415b0ce918f4dd4a1ab143bb1bca4.tar.xz
rough attempt to grab the good cucumber bits from recent tails
Diffstat (limited to 'features/step_definitions/evince.rb')
-rw-r--r--features/step_definitions/evince.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/features/step_definitions/evince.rb b/features/step_definitions/evince.rb
index d9bb42c1..9411ac4d 100644
--- a/features/step_definitions/evince.rb
+++ b/features/step_definitions/evince.rb
@@ -1,20 +1,25 @@
When /^I(?:| try to) open "([^"]+)" with Evince$/ do |filename|
- next if @skip_steps_while_restoring_background
step "I run \"evince #{filename}\" in GNOME Terminal"
end
Then /^I can print the current document to "([^"]+)"$/ do |output_file|
- next if @skip_steps_while_restoring_background
@screen.type("p", Sikuli::KeyModifier.CTRL)
@screen.wait("EvincePrintDialog.png", 10)
@screen.wait_and_click("EvincePrintToFile.png", 10)
- @screen.wait_and_double_click("EvincePrintOutputFile.png", 10)
- @screen.hide_cursor
- @screen.wait("EvincePrintOutputFileSelected.png", 10)
+ @screen.wait_and_click("EvincePrintOutputFileButton.png", 10)
+ @screen.wait("EvincePrintFileDialog.png", 10)
# Only the file's basename is selected by double-clicking,
# so we type only the desired file's basename to replace it
- @screen.type(output_file.sub(/[.]pdf$/, '') + Sikuli::Key.ENTER)
+ $vm.set_clipboard(output_file.sub(/[.]pdf$/, ''))
+ @screen.type('v', Sikuli::KeyModifier.CTRL)
+ @screen.type(Sikuli::Key.ENTER)
+ @screen.wait_and_click("EvincePrintButton.png", 10)
try_for(10, :msg => "The document was not printed to #{output_file}") {
- @vm.file_exist?(output_file)
+ $vm.file_exist?(output_file)
}
end
+
+When /^I close Evince$/ do
+ @screen.type("w", Sikuli::KeyModifier.CTRL)
+ step 'process "evince" has stopped running after at most 20 seconds'
+end