1 When /^I(?:| try to) open "([^"]+)" with Evince$/ do |filename|
2 next if @skip_steps_while_restoring_background
3 step "I run \"evince #{filename}\" in GNOME Terminal"
6 Then /^I can print the current document to "([^"]+)"$/ do |output_file|
7 next if @skip_steps_while_restoring_background
8 @screen.type("p", Sikuli::KeyModifier.CTRL)
9 @screen.wait("EvincePrintDialog.png", 10)
10 @screen.wait_and_click("EvincePrintToFile.png", 10)
11 @screen.wait_and_double_click("EvincePrintOutputFile.png", 10)
13 @screen.wait("EvincePrintOutputFileSelected.png", 10)
14 # Only the file's basename is selected by double-clicking,
15 # so we type only the desired file's basename to replace it
16 @screen.type(output_file.sub(/[.]pdf$/, '') + Sikuli::Key.ENTER)
17 try_for(10, :msg => "The document was not printed to #{output_file}") {
18 @vm.file_exist?(output_file)