Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish fixing up app to use JFileChooser. [#7]
- Loading branch information
Showing
6 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
Given t(/^the file chooser "([^\"]*)" is visible$/) do |name| | ||
container.set dialog(name, nil) | ||
container.set file_chooser | ||
end | ||
|
||
Given t(/^the file chooser "([^\"]*)" is the container$/) do |name| | ||
container.set dialog(name, nil) | ||
container.set file_chooser | ||
end | ||
|
||
When t(/^I select the (temp(?:orary)? )?file "([^\"]*)"$/) do |temp, name| | ||
prefix = temp.to_s.empty? ? nil : $TEMP_DIR | ||
When %Q(I fill the text field "#1" with "#{File.join [prefix, name].compact}") | ||
file_chooser.selected_file = java.io.File.new File.join([prefix, name].compact) | ||
end | ||
|
||
When t(/^I approve the file chooser$/) do | ||
When %Q(I click the button "OK") | ||
file_chooser.approve_selection | ||
end | ||
|
||
When t(/^I close the file chooser "([^\"]*)"$/) do |name| | ||
dialog(name, nil).close | ||
file_chooser.close | ||
end | ||
|
||
Then t(/^I should (not )*see the file chooser "([^\"]*)"$/) do |negation, name| | ||
if negation | ||
expect_timeout(:id => "ComponentOperator.WaitComponentTimeout") do | ||
dialog(name, nil) | ||
file_chooser | ||
end | ||
else | ||
dialog(name, nil).visible?.should be_true | ||
file_chooser.visible?.should be_true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Swinger | ||
module FileChooser | ||
java_import org.netbeans.jemmy.operators.JFileChooserOperator | ||
|
||
def file_chooser | ||
JFileChooserOperator.new | ||
end | ||
end | ||
end | ||
World(Swinger::FileChooser) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters