diff options
author | Philip Hands <phil@hands.com> | 2016-05-11 17:11:01 +0200 |
---|---|---|
committer | Philip Hands <phil@hands.com> | 2016-05-11 17:11:01 +0200 |
commit | a5d56e3b5443263b53b0487c81125123411bd0cf (patch) | |
tree | 71b1bdafc0a5978bca9073609eff33e228e29a12 /cucumber/features/step_definitions/evince.rb | |
parent | 555d9414f758cc0062eff700a0352ae177fd9be5 (diff) | |
download | jenkins.debian.net-a5d56e3b5443263b53b0487c81125123411bd0cf.tar.xz |
move cucumber things under cucumber/
Diffstat (limited to 'cucumber/features/step_definitions/evince.rb')
-rw-r--r-- | cucumber/features/step_definitions/evince.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cucumber/features/step_definitions/evince.rb b/cucumber/features/step_definitions/evince.rb new file mode 100644 index 00000000..9411ac4d --- /dev/null +++ b/cucumber/features/step_definitions/evince.rb @@ -0,0 +1,25 @@ +When /^I(?:| try to) open "([^"]+)" with Evince$/ do |filename| + step "I run \"evince #{filename}\" in GNOME Terminal" +end + +Then /^I can print the current document to "([^"]+)"$/ do |output_file| + @screen.type("p", Sikuli::KeyModifier.CTRL) + @screen.wait("EvincePrintDialog.png", 10) + @screen.wait_and_click("EvincePrintToFile.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 + $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) + } +end + +When /^I close Evince$/ do + @screen.type("w", Sikuli::KeyModifier.CTRL) + step 'process "evince" has stopped running after at most 20 seconds' +end |