Created
August 31, 2009 15:07
-
-
Save liangzan/178505 to your computer and use it in GitHub Desktop.
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
#Cucumber Steps for file uploads | |
When /^I focus on "([^\"]*)" field to attach "([^\"]*)" file$/ do |field_name, file_name| | |
attach_file(field_name, file_name) | |
end | |
Given /^I have "([^\"]*)" csv file containing:$/ do |file_name, csv_values| | |
create_csv_file(file_name, csv_values) | |
end | |
#Celerity Helper | |
#Remember to define browser | |
def attach_file(field_name, file_name) | |
file_path = File.join($upload_path, file_name) | |
browser.file_field(:name, "#{field_name}").set file_path | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment