diff options
author | Tails developers <amnesia@boum.org> | 2014-12-19 00:40:08 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2014-12-21 09:45:40 +0100 |
commit | 51680b6ebb645d37ebdfcd122ca163b3a638aefa (patch) | |
tree | 337e128d2eac3cbc89ecbacf38851bfa33469cd5 /features/step_definitions/evince.rb | |
parent | 44bab3c86ca3d95837f4c50cc535206352385a46 (diff) | |
download | jenkins.debian.net-51680b6ebb645d37ebdfcd122ca163b3a638aefa.tar.xz |
files copied from https://git-tails.immerda.ch/tails - many thanks to the tails developers for their nice work and documentation of it - these files have been released under the GNU General Public License version 3 or (at your option) any later version
features/images has been omitted
Diffstat (limited to 'features/step_definitions/evince.rb')
-rw-r--r-- | features/step_definitions/evince.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/features/step_definitions/evince.rb b/features/step_definitions/evince.rb new file mode 100644 index 00000000..d9bb42c1 --- /dev/null +++ b/features/step_definitions/evince.rb @@ -0,0 +1,20 @@ +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) + # 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) + try_for(10, :msg => "The document was not printed to #{output_file}") { + @vm.file_exist?(output_file) + } +end |