Skip to content
This repository was archived by the owner on Feb 1, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,21 @@ To add new coffeescript test, add those file to the /integration/coffeescript/ip
To add new javascript test, if the iphone and ipad folder don't exist in the /integration/javascript forlder, create them.
Then copy your test file inside those folder depending on your target.
Your file hierarchy should look something like this

<pre><code>
| integration
| coffeescript
| iphone
| exemple.coffee
| ipad
| example.coffee
| universal
| javascript
| iphone
| myTest.js
| ipad
| myiPadtest.js
| universal
|tmp
</code></pre>

Expand Down
5 changes: 4 additions & 1 deletion lib/bwoken/cli/init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def initialize opts
def run
directory "coffeescript/iphone"
directory "coffeescript/ipad"
directory "javascript"
directory "coffeescript/universal"
directory "javascript/iphone"
directory "javascript/ipad"
directory "javascript/universal"
directory "tmp/results"
template "coffeescript/iphone/example.coffee"
template "coffeescript/ipad/example.coffee"
Expand Down
12 changes: 8 additions & 4 deletions lib/bwoken/device_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ def script_filenames
end

def test_files_from_feature_names
feature_names.map do |feature_name|
File.join(Bwoken.test_suite_path, device_family, "#{feature_name}.js")
all_test_files.select do |file_name|
feature_names.any? do |feature_name|
file_name.include?(feature_name)
end
end
end

Expand All @@ -53,11 +55,13 @@ def all_test_files
end

def all_files_in_test_dir
Dir["#{Bwoken.test_suite_path}/#{device_family}/**/*.js"]
Dir["#{Bwoken.test_suite_path}/#{device_family}/**/*.js"] +
Dir["#{Bwoken.test_suite_path}/universal/**/*.js"]
end

def helper_files
Dir["#{Bwoken.test_suite_path}/#{device_family}/**/helpers/**/*.js"]
Dir["#{Bwoken.test_suite_path}/#{device_family}/**/helpers/**/*.js"] +
Dir["#{Bwoken.test_suite_path}/universal/**/helpers/**/*.js"]
end

end
Expand Down
2 changes: 1 addition & 1 deletion lib/bwoken/script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def device_flag
if !device.nil?
return "-w \"#{device}\""
end

simulator ? '' : "-w #{Bwoken::Device.uuid}"
end

Expand Down
12 changes: 8 additions & 4 deletions lib/bwoken/simulator_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ def script_filenames
end

def test_files_from_feature_names
feature_names.map do |feature_name|
File.join(Bwoken.test_suite_path, device_family, "#{feature_name}.js")
all_test_files.select do |file_name|
feature_names.any? do |feature_name|
file_name.include?(feature_name)
end
end
end

Expand All @@ -54,11 +56,13 @@ def all_test_files
end

def all_files_in_test_dir
Dir["#{Bwoken.test_suite_path}/#{device_family}/**/*.js"]
Dir["#{Bwoken.test_suite_path}/#{device_family}/**/*.js"] +
Dir["#{Bwoken.test_suite_path}/universal/**/*.js"]
end

def helper_files
Dir["#{Bwoken.test_suite_path}/#{device_family}/**/helpers/**/*.js"]
Dir["#{Bwoken.test_suite_path}/#{device_family}/**/helpers/**/*.js"] +
Dir["#{Bwoken.test_suite_path}/universal/**/helpers/**/*.js"]
end

end
Expand Down